From ab17279d2d3654149583facc6cefb6708ac1b72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 12:17:12 +0200 Subject: [PATCH 01/83] Add CLAUDE.md --- CLAUDE.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2b1b1c9 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,59 @@ +# amazon_sp_clients + +Unofficial Ruby gem for the Amazon Selling Partner API (SP-API), used +internally at Dropstream. It is one gem that wraps many generated API +clients: hand-written core code plus SwaggerCodegen output. + +## Layout + +- `lib/amazon_sp_clients/` — hand-written core. Edit here. +- `vendor//` — generated client per API. Committed, but never + edit by hand. It is overwritten on every regeneration. +- `codegen-templates/ruby/` — our modified mustache templates. To change + generated code, change a template and regenerate. +- `codegen-config.yml` — list of APIs to generate (name + spec path). +- `amzn-models/` — git submodule with Amazon's official specs + (github.com/amzn/selling-partner-api-models). + +## Core files (lib/amazon_sp_clients) + +- `../amazon_sp_clients.rb` — entry point. Region and marketplace id + constants, `configure`, `new_session`, feed upload/download helpers. +- `configuration.rb` — global config (credentials, region, host, sandbox, + logger). `Configuration.default` is per-thread. +- `session.rb` — auth. Exchanges refresh token for an access token, gets + STS role credentials, and gets restricted data tokens (RDT) for PII + calls. `RESTRICTED_OPS` holds the common RDT resource lists. +- `api_client.rb` — Faraday connection used by every generated API class. + Adds signing, error middleware, tokens, and deserialization. +- `api_response.rb` — wraps the response into `payload` / `errors` / + `pagination`. Payload is a Hash with symbol keys. +- `api_error.rb`, `uploader.rb` (feed upload + report download), + `token_exchange_auth.rb` (LWA token request). +- `middlewares/request_signer_v4.rb` — AWS SigV4 signing. +- `middlewares/raise_error.rb` — turns HTTP 4xx/5xx into Faraday errors. +- `sp_*.rb` — autogenerated one-line requires that point into `vendor/`. + Do not edit; the Rakefile writes them. + +## Template changes + +Our templates make the generated code use our core instead of the +standard SwaggerCodegen runtime: + +- everything lives under the `AmazonSpClients` namespace, +- generated APIs take a `Session` and use `AmazonSpClients::ApiClient`, +- responses default to `AmazonSpClients::ApiResponse`, +- `auth_names` is reused to mark restricted (RDT) operations, +- generated `api_client`, `configuration`, docs and specs are dropped. + +## Commands + +```sh +bundle exec rspec # tests +bundle exec rake codegen:generate # regenerate vendor/ (needs swagger-codegen) +bundle exec rake codegen:clean # delete vendor/ and sp_*.rb +bin/console # irb with the gem loaded +``` + +Regeneration deletes and rewrites all of `vendor/` and all `sp_*.rb` +files. Review that diff carefully before committing. From 334147366e559a8853eb7c77fee7044bcc0e6f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:10 +0200 Subject: [PATCH 02/83] Delete Travis config, gemset, and gitmodules CI moves to GitHub Actions in a later commit. The .gitmodules listed a typo'd path and a submodule that was never registered. --- .gitmodules | 6 ------ .ruby-gemset | 1 - .travis.yml | 9 --------- 3 files changed, 16 deletions(-) delete mode 100644 .gitmodules delete mode 100644 .ruby-gemset delete mode 100644 .travis.yml diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 047a823..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "selling-partern-api-models"] - path = selling-partern-api-models - url = https://github.com/amzn/selling-partner-api-models.git -[submodule "amzn-models"] - path = amzn-models - url = https://github.com/amzn/selling-partner-api-models.git diff --git a/.ruby-gemset b/.ruby-gemset deleted file mode 100644 index ac75917..0000000 --- a/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -amazon_sp_clients \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3026662..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -language: ruby -cache: bundler -rvm: - - 3.1.2 -before_install: - - echo "export rvm_ignore_gemsets_flag=1" >> ~/.rvmrc - - gem update --system - - gem install bundler From e4d83840a3f0fb3dc309bdc9a024cda3ee547e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:18 +0200 Subject: [PATCH 03/83] Add LICENSE, changelog, and gem metadata MIT license, real author email, and a Ruby 3.3 floor (nothing older runs in production). Adds RuboCop as a dev dependency. --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ Gemfile.lock | 31 +++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ amazon_sp_clients.gemspec | 31 +++++++++++++++++-------------- 4 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..061309a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Changelog + +Notable changes to this gem. The format follows +[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). + +Changes that only track updates to Amazon's API models are not +considered breaking and do not trigger a major version bump. + +## [Unreleased] + +### Added + +- CI on GitHub Actions: RSpec on Ruby 3.3 and 3.4, plus RuboCop. +- Characterization specs that pin the current public behavior of + `Configuration`, `Session`, `ApiClient`, `ApiResponse`, + `TokenExchangeAuth`, the `RaiseError` middleware, and the module + helpers (feed upload/download, report download). +- LICENSE (MIT) and this changelog. + +### Changed + +- Minimum Ruby version is 3.3 (was 2.3). + +### Removed + +- Travis CI config, `.ruby-gemset`, and the broken `.gitmodules`. diff --git a/Gemfile.lock b/Gemfile.lock index ec6d131..783f3c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,6 +14,7 @@ GEM specs: addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) aws-eventstream (1.3.2) aws-partitions (1.1063.0) aws-sdk-core (3.220.1) @@ -59,12 +60,23 @@ GEM httpclient (2.9.0) mutex_m jmespath (1.6.2) + json (2.21.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) multi_xml (0.7.1) bigdecimal (~> 3.1) multipart-post (2.4.1) mutex_m (0.3.0) + parallel (2.0.1) + parser (3.3.11.1) + ast (~> 2.4.1) + racc + prism (1.9.0) public_suffix (7.0.5) + racc (1.8.1) + rainbow (3.1.1) rake (13.0.6) + regexp_parser (2.12.0) rexml (3.4.4) rspec (3.11.0) rspec-core (~> 3.11.0) @@ -79,8 +91,26 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-support (3.11.0) + rubocop (1.86.1) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.1) + parser (>= 3.3.7.2) + prism (~> 1.7) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) timecop (0.9.5) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -94,6 +124,7 @@ DEPENDENCIES dotenv rake rspec + rubocop (~> 1.86) timecop webmock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..43c6295 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-2026 Dropstream + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index dd98f05..3b6af07 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -1,43 +1,46 @@ require_relative 'lib/amazon_sp_clients/version' Gem::Specification.new do |spec| - spec.name = "amazon_sp_clients" + spec.name = 'amazon_sp_clients' spec.version = AmazonSpClients::VERSION - spec.authors = ["Dropstream"] - spec.email = ["bogus@bogus.com"] + spec.authors = ['Dropstream'] + spec.email = ['351015+nina-saule@users.noreply.github.com'] - spec.summary = %q{Amazon Selling Partner APIs} - spec.description = %q{Collection of SwaggerCodegen gems wrapped into one gem} - spec.homepage = "https://github.com/dropstream/amazon_sp_clients" - spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") + spec.summary = 'Amazon Selling Partner APIs' + spec.description = 'Collection of SwaggerCodegen gems wrapped into one gem' + spec.homepage = 'https://github.com/dropstream/amazon_sp_clients' + spec.license = 'MIT' + spec.required_ruby_version = Gem::Requirement.new('>= 3.3') # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" - spec.metadata["homepage_uri"] = spec.homepage + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['rubygems_mfa_required'] = 'true' # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features|amzn-models|codegen-templates)/}) end end - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] spec.add_dependency 'aws-sdk-core' spec.add_dependency 'aws-sigv4' - spec.add_dependency 'httpclient' spec.add_dependency 'faraday', '~> 1.4' spec.add_dependency 'faraday_middleware' + spec.add_dependency 'httpclient' spec.add_dependency 'multi_xml' + spec.add_development_dependency 'dotenv' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' - spec.add_development_dependency 'webmock' - spec.add_development_dependency 'dotenv' + spec.add_development_dependency 'rubocop', '~> 1.86' spec.add_development_dependency 'timecop' + spec.add_development_dependency 'webmock' end From 31ee32da617864e8d93e6de43496fbae47170bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:26 +0200 Subject: [PATCH 04/83] Fix spec state leaks and helper setup spec_helper now requires webmock/rspec and timecop once and returns Timecop after every example (time stayed frozen at 2018-09-01 for the rest of the suite). Examples that mutate the thread-local default config or Aws.config now reset them, which random-order runs proved necessary. --- spec/amazon_sp_clients/uploader_spec.rb | 13 ++--- spec/amazon_sp_clients_spec.rb | 78 ++++++++++++------------- spec/spec_helper.rb | 11 +++- 3 files changed, 53 insertions(+), 49 deletions(-) diff --git a/spec/amazon_sp_clients/uploader_spec.rb b/spec/amazon_sp_clients/uploader_spec.rb index 6aa600a..1edc5a8 100644 --- a/spec/amazon_sp_clients/uploader_spec.rb +++ b/spec/amazon_sp_clients/uploader_spec.rb @@ -1,10 +1,9 @@ require 'spec_helper' -require 'webmock/rspec' require 'amazon_sp_clients/uploader' RSpec.describe AmazonSpClients::Uploader do let(:logger) { instance_double(Logger, info: nil) } - + before do allow(AmazonSpClients).to receive_message_chain(:configure, :logger).and_return(logger) end @@ -32,7 +31,7 @@ RSpec.describe AmazonSpClients::Downloader do let(:logger) { instance_double(Logger, info: nil) } - + before do allow(AmazonSpClients).to receive_message_chain(:configure, :logger).and_return(logger) end @@ -57,7 +56,7 @@ .to_return(status: 200, body: gzipped_content, headers: { 'Content-Type' => 'application/json' }) result = downloader.download - expect(result).to eq({ "result" => "success" }) + expect(result).to eq({ 'result' => 'success' }) end end @@ -88,7 +87,7 @@ let(:feed_processing_report) do { feedDocumentId: 'doc789', - url: feed_url, + url: feed_url } end let(:downloader) { described_class.new(feed_processing_report) } @@ -98,7 +97,7 @@ .to_return(status: 200, body: json_content, headers: { 'Content-Type' => 'application/json' }) result = downloader.download - expect(result).to eq({ "result" => "success" }) + expect(result).to eq({ 'result' => 'success' }) end end @@ -107,7 +106,7 @@ let(:feed_processing_report) do { feedDocumentId: 'doc101', - url: feed_url, + url: feed_url } end let(:downloader) { described_class.new(feed_processing_report) } diff --git a/spec/amazon_sp_clients_spec.rb b/spec/amazon_sp_clients_spec.rb index 35ffd29..16149e8 100644 --- a/spec/amazon_sp_clients_spec.rb +++ b/spec/amazon_sp_clients_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' -require 'webmock/rspec' require 'logger' require 'dotenv/load' -require 'timecop' require 'ostruct' require 'amazon_sp_clients/sp_orders_v0' @@ -45,15 +43,13 @@ def restricted_data_token end end - after do - AmazonSpClients.configure do |c| - c.set_endpoint_by_marketplace_id('ATVPDKIKX0DER') - end - end + # The default config is thread-local and shared across examples; + # drop it so endpoint or credential changes cannot leak. + after { Thread.current[:amazon_sp_configuration] = nil } class Resources - def to_json(*opts) - "{\"method\":\"GET\",\"path\":\"/orders/v0/orders\",\"dataElements\":[\"buyerInfo\",\"shippingAddress\"]},{\"method\":\"GET\",\"path\":\"/orders/v0/orders/{orderId}/orderItems\",\"dataElements\":[\"buyerInfo\"]}" + def to_json(*_opts) + '{"method":"GET","path":"/orders/v0/orders","dataElements":["buyerInfo","shippingAddress"]},{"method":"GET","path":"/orders/v0/orders/{orderId}/orderItems","dataElements":["buyerInfo"]}' end end @@ -62,30 +58,30 @@ def to_json(*opts) it 'returns success response with PII data' do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, - body: fixture('token_success.json'), + body: fixture('token_success.json') ) stub_request( - :post, - 'https://sandbox.sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken', - ) + :post, + 'https://sandbox.sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken' + ) .with( body: - "{\"restrictedResources\":[{\"method\":\"GET\",\"path\":\"/orders/v0/orders\",\"dataElements\":[\"buyerInfo\",\"shippingAddress\"]},{\"method\":\"GET\",\"path\":\"/orders/v0/orders/{orderId}/orderItems\",\"dataElements\":[\"buyerInfo\"]}]}" + '{"restrictedResources":[{"method":"GET","path":"/orders/v0/orders","dataElements":["buyerInfo","shippingAddress"]},{"method":"GET","path":"/orders/v0/orders/{orderId}/orderItems","dataElements":["buyerInfo"]}]}' ) .to_return( status: 200, - body: '{"payload":{"restrictedDataToken":"RESTRICTED_TOKEN","expiresIn":3600}}', + body: '{"payload":{"restrictedDataToken":"RESTRICTED_TOKEN","expiresIn":3600}}' ) stub_request( :get, - 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders/marketplace_id', + 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders/marketplace_id' ).to_return(status: 200, body: '{"payload":{}}', headers: { 'x-amzn-RateLimit-Limit' => '0.2' }) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' @@ -93,7 +89,7 @@ def to_json(*opts) orders_api = AmazonSpClients::SpOrdersV0::OrdersV0Api.new(session) resource = Resources.new - opts = {:auth_names => resource} + opts = { auth_names: resource } order_resp = orders_api.get_order('marketplace_id', opts) expect(order_resp.payload).not_to be_nil @@ -109,17 +105,17 @@ def to_json(*opts) it 'returns success responses' do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, - body: fixture('token_success.json'), + body: fixture('token_success.json') ) stub_request( :get, - 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_200&MarketplaceIds=ATVPDKIKX0DER', + 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_200&MarketplaceIds=ATVPDKIKX0DER' ).to_return(status: 200, body: fixture('orders_200_response.json')) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' @@ -142,17 +138,17 @@ def to_json(*opts) it 'returns success responses' do stub_request(:post, 'https://sts.eu-west-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, - body: fixture('token_success.json'), + body: fixture('token_success.json') ) stub_request( :get, - 'https://sandbox.sellingpartnerapi-eu.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_200&MarketplaceIds=ATVPDKIKX0DER', + 'https://sandbox.sellingpartnerapi-eu.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_200&MarketplaceIds=ATVPDKIKX0DER' ).to_return(status: 200, body: fixture('orders_200_response.json')) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' @@ -177,7 +173,7 @@ def to_json(*opts) it 'session never runs and returns error' do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 403, - body: fixture('sts_403_response.xml'), + body: fixture('sts_403_response.xml') ) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' @@ -190,19 +186,19 @@ def to_json(*opts) it 'session never runs and returns error' do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 400, - body: fixture('token_error.json'), + body: fixture('token_error.json') ) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' - expect { + expect do AmazonSpClients.new_session(refresh_token) - }.to raise_error Faraday::BadRequestError + end.to raise_error Faraday::BadRequestError end end @@ -210,7 +206,7 @@ def to_json(*opts) it 'returns error response' do stub_request( :get, - 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_400&MarketplaceIds=ATVPDKIKX0DER', + 'https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_400&MarketplaceIds=ATVPDKIKX0DER' ).to_return( status: 400, body: '{"errors":[{"code":"InvalidInput","message":"Invalid Input"}]}', @@ -221,15 +217,15 @@ def to_json(*opts) 'Connection' => 'keep-alive', 'x-amzn-RequestId' => '3b9f0d8b-0b92-4582-8152-a5c56b5c998d', 'x-amz-apigw-id' => 'ApoJKGnsIAMF7Xw=', - 'X-Amzn-Trace-Id' => 'Root=1-60c08707-4aade6f26fc77d032b0ccefe;Sampled=0', - }, + 'X-Amzn-Trace-Id' => 'Root=1-60c08707-4aade6f26fc77d032b0ccefe;Sampled=0' + } ) orders_api = AmazonSpClients::SpOrdersV0::OrdersV0Api.new(NullSession.new) - expect { + expect do orders_api.get_orders(['ATVPDKIKX0DER'], created_after: 'TEST_CASE_400') - }.to raise_error Faraday::BadRequestError + end.to raise_error Faraday::BadRequestError end end end @@ -239,15 +235,17 @@ def to_json(*opts) Aws.config.update(credentials: Aws::Credentials.new('bogus', 'bogus'), region: 'bogus') end + after { Aws.config = {} } + it 'initializes sts client with correct credentials' do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, - body: fixture('token_success.json'), + body: fixture('token_success.json') ) refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' @@ -279,7 +277,9 @@ def to_json(*opts) end it 'uses credentials_provider from config' do - stub_request(:get, "https://sandbox.sellingpartnerapi-na.amazon.com/test/endpoint1").to_return(status: 200, body: '{}') + stub_request(:get, 'https://sandbox.sellingpartnerapi-na.amazon.com/test/endpoint1').to_return( + status: 200, body: '{}' + ) expect(callback).to receive(:call).and_return('initial_access_token') api_client.call_api(:get, '/test/endpoint1') expect(session.credentials_provider).to be_a(Aws::Credentials) @@ -295,10 +295,10 @@ def to_json(*opts) before do stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( status: 200, - body: fixture('sts_200_response.xml'), + body: fixture('sts_200_response.xml') ) - stub_request(:get, /https:\/\/sandbox\.sellingpartnerapi-na\.amazon\.com\/.*/) + stub_request(:get, %r{https://sandbox\.sellingpartnerapi-na\.amazon\.com/.*}) .to_return(status: 200, body: '{}') end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8aa1527..19b1f80 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,7 @@ -require "bundler/setup" -require "amazon_sp_clients" +require 'bundler/setup' +require 'amazon_sp_clients' +require 'webmock/rspec' +require 'timecop' module Helpers def fixture(name) @@ -9,7 +11,7 @@ def fixture(name) RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" + config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! @@ -19,4 +21,7 @@ def fixture(name) end config.include Helpers + + # Time frozen in one example must not leak into the next. + config.after { Timecop.return } end From 7b028bd44fabd002cb1b8bf591eec998bad29845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:34 +0200 Subject: [PATCH 05/83] Add characterization specs for the v1 surface Pins current behavior before the modernization refactors: Configuration region/endpoint/host logic, the RaiseError status-to-error map and message formats, ApiClient request building and deserialization, Session auth and RDT caching (incl. grantless), TokenExchangeAuth, the module helpers, ApiResponse/ApiError, and the 14 used sp_* require paths with their API class names. The token_exchange_auth spec also fixes a bug where a Configuration was passed as the refresh_token argument, so it tested the wrong config. Known bugs from the modernization plan stay unpinned on purpose; their fixes start with failing tests. Suite grows from 21 to 191 examples and passes in random order. --- spec/amazon_sp_clients/api_client_spec.rb | 386 ++++++++++++++++++ spec/amazon_sp_clients/api_response_spec.rb | 154 ++++++- spec/amazon_sp_clients/configuration_spec.rb | 246 +++++++++++ .../middlewares/raise_error_spec.rb | 160 ++++++++ spec/amazon_sp_clients/module_helpers_spec.rb | 161 ++++++++ spec/amazon_sp_clients/session_spec.rb | 266 ++++++++++++ spec/amazon_sp_clients/sp_modules_spec.rb | 53 +++ .../token_exchange_auth_spec.rb | 98 ++++- 8 files changed, 1507 insertions(+), 17 deletions(-) create mode 100644 spec/amazon_sp_clients/api_client_spec.rb create mode 100644 spec/amazon_sp_clients/configuration_spec.rb create mode 100644 spec/amazon_sp_clients/middlewares/raise_error_spec.rb create mode 100644 spec/amazon_sp_clients/module_helpers_spec.rb create mode 100644 spec/amazon_sp_clients/session_spec.rb create mode 100644 spec/amazon_sp_clients/sp_modules_spec.rb diff --git a/spec/amazon_sp_clients/api_client_spec.rb b/spec/amazon_sp_clients/api_client_spec.rb new file mode 100644 index 0000000..9c145eb --- /dev/null +++ b/spec/amazon_sp_clients/api_client_spec.rb @@ -0,0 +1,386 @@ +require 'spec_helper' + +# Fake session for ApiClient specs. Records calls, never talks to AWS. +class FakeSpSession + attr_reader :events, :rdt_resources + + def initialize + @events = [] + @rdt_resources = [] + end + + def refresh + @events << :refresh + end + + def access_token + 'ACCESS_TOKEN' + end + + def ask_for_restricted_data_token(resource) + @events << :ask_rdt + @rdt_resources << resource + end + + def restricted_data_token + @rdt_resources.to_h { |r| [r, 'RDT_TOKEN'] } + end + + def credentials_provider + Aws::Credentials.new('a', 'b', 'c') + end +end + +# Bare response stand-in for the pure helper methods. +FakeSpResponse = Struct.new(:body, :headers) + +RSpec.describe AmazonSpClients::ApiClient do + let(:session) { FakeSpSession.new } + let(:config) { AmazonSpClients::Configuration.new { |c| c.sandbox_env! } } + let(:client) { described_class.new(session, config) } + let(:base_url) { 'https://sandbox.sellingpartnerapi-na.amazon.com' } + + describe '#call_api' do + it 'puts query params in the GET url' do + stub = + stub_request(:get, "#{base_url}/orders/v0/orders") + .with(query: { 'CreatedAfter' => '2021-01-01', 'MarketplaceIds' => 'ATVPDKIKX0DER' }) + .to_return(status: 200, body: '{}') + + client.call_api( + :GET, + '/orders/v0/orders', + query_params: { 'CreatedAfter' => '2021-01-01', 'MarketplaceIds' => 'ATVPDKIKX0DER' } + ) + + expect(stub).to have_been_requested + end + + it 'sends content type, user agent, access token and amz date headers' do + Timecop.freeze(Time.utc(2021, 6, 9, 9, 16, 55)) + + stub = + stub_request(:get, "#{base_url}/test") + .with( + headers: { + 'Content-Type' => 'application/json', + 'User-Agent' => "Dropstream/1.0 (Language=Ruby/#{RUBY_VERSION})", + 'x-amz-access-token' => 'ACCESS_TOKEN', + 'x-amz-date' => '20210609T091655Z' + } + ) + .to_return(status: 200, body: '{}') + + client.call_api(:GET, '/test') + + expect(stub).to have_been_requested + end + + it 'refreshes the session before the request' do + stub_request(:get, "#{base_url}/test").to_return do |_req| + session.events << :http_request + { status: 200, body: '{}' } + end + + client.call_api(:GET, '/test') + + expect(session.events).to eq(%i[refresh http_request]) + end + + context 'with auth_names (restricted operation)' do + it 'asks for a restricted data token and sends it instead' do + stub = + stub_request(:get, "#{base_url}/orders/v0/orders/123/address") + .with(headers: { 'x-amz-access-token' => 'RDT_TOKEN' }) + .to_return(status: 200, body: '{}') + + client.call_api(:GET, '/orders/v0/orders/123/address', auth_names: ['/orders/v0/orders']) + + expect(stub).to have_been_requested + expect(session.rdt_resources).to eq(['/orders/v0/orders']) + expect(session.events).not_to include(:refresh) + end + end + + it 'sends a hash body as json on POST' do + stub = + stub_request(:post, "#{base_url}/feeds/2021-06-30/documents") + .with(body: '{"contentType":"text/xml"}') + .to_return(status: 200, body: '{}') + + client.call_api(:POST, '/feeds/2021-06-30/documents', body: { contentType: 'text/xml' }) + + expect(stub).to have_been_requested + end + + it 'sends a string body unchanged on POST' do + stub = + stub_request(:post, "#{base_url}/feeds/2021-06-30/documents") + .with(body: 'already-serialized') + .to_return(status: 200, body: '{}') + + client.call_api(:POST, '/feeds/2021-06-30/documents', body: 'already-serialized') + + expect(stub).to have_been_requested + end + + it 'returns nil without a return_type' do + stub = stub_request(:get, "#{base_url}/test").to_return(status: 200, body: '{}') + + expect(client.call_api(:GET, '/test')).to be_nil + expect(stub).to have_been_requested + end + + it 'raises when the session is nil' do + client = described_class.new(nil, config) + + expect { client.call_api(:GET, '/test') }.to raise_error( + RuntimeError, + 'Ensure session is valid before calling API methods' + ) + end + + it 'returns an ApiResponse with symbol keys for the default return_type' do + stub_request(:get, "#{base_url}/test").to_return( + status: 200, + body: '{"payload":{"AmazonOrderId":"902-1"}}' + ) + + result = client.call_api(:GET, '/test', return_type: 'AmazonSpClients::ApiResponse') + + expect(result).to be_instance_of(AmazonSpClients::ApiResponse) + expect(result.payload).to eq(AmazonOrderId: '902-1') + end + + it 'returns a plain hash with symbol keys for return_type Object' do + stub_request(:get, "#{base_url}/test").to_return(status: 200, body: '{"payload":{"x":1}}') + + result = client.call_api(:GET, '/test', return_type: 'Object') + + expect(result).to eq(payload: { x: 1 }) + end + end + + describe '#deserialize' do + it 'wraps a json body in an ApiResponse for the default return_type' do + response = FakeSpResponse.new('{"payload":{"AmazonOrderId":"902-1"}}', {}) + + result = client.deserialize(response, 'AmazonSpClients::ApiResponse') + + expect(result).to be_instance_of(AmazonSpClients::ApiResponse) + expect(result.payload).to eq(AmazonOrderId: '902-1') + end + + it 'returns the parsed value for return_type String' do + response = FakeSpResponse.new('"hello"', {}) + + expect(client.deserialize(response, 'String')).to eq('hello') + end + + it 'returns nil for a nil body' do + response = FakeSpResponse.new(nil, {}) + + expect(client.deserialize(response, 'AmazonSpClients::ApiResponse')).to be_nil + end + + it 'returns nil for an empty json object body' do + response = FakeSpResponse.new('{}', {}) + + expect(client.deserialize(response, 'AmazonSpClients::ApiResponse')).to be_nil + end + + it 'raises for an empty string body' do + response = FakeSpResponse.new('', {}) + + expect { client.deserialize(response, 'AmazonSpClients::ApiResponse') }.to raise_error( + JSON::ParserError + ) + end + + it 'raises for a non-json content type' do + response = FakeSpResponse.new('{"a":1}', { 'Content-Type' => 'application/xml' }) + + expect { client.deserialize(response, 'AmazonSpClients::ApiResponse') }.to raise_error( + RuntimeError, + 'Content-Type is not supported: application/xml' + ) + end + end + + describe '#convert_to_type' do + it 'returns nil for nil data' do + expect(client.convert_to_type(nil, 'String', nil)).to be_nil + end + + it 'converts to String' do + expect(client.convert_to_type(123, 'String', nil)).to eq('123') + end + + it 'converts to Integer' do + expect(client.convert_to_type('42', 'Integer', nil)).to eq(42) + end + + it 'converts to Float' do + expect(client.convert_to_type('3.5', 'Float', nil)).to eq(3.5) + end + + it 'converts to Boolean' do + expect(client.convert_to_type(true, 'Boolean', nil)).to be(true) + expect(client.convert_to_type(false, 'Boolean', nil)).to be(false) + end + + it 'parses DateTime' do + result = client.convert_to_type('2021-06-09T09:16:55Z', 'DateTime', nil) + + expect(result).to eq(DateTime.new(2021, 6, 9, 9, 16, 55)) + end + + it 'parses Date' do + expect(client.convert_to_type('2021-06-09', 'Date', nil)).to eq(Date.new(2021, 6, 9)) + end + + it 'returns Object data as is' do + data = { a: 1 } + + expect(client.convert_to_type(data, 'Object', nil)).to be(data) + end + + it 'converts each item of an Array type' do + expect(client.convert_to_type(%w[1 2], 'Array', nil)).to eq([1, 2]) + end + + it 'converts each value of Hash' do + data = { 'a' => '1', 'b' => '2' } + + result = client.convert_to_type(data, 'Hash', nil) + + expect(result).to eq('a' => 1, 'b' => 2) + end + end + + describe '#json_mime?' do + it 'accepts json mime types and */*' do + expect(client.json_mime?('application/json')).to be(true) + expect(client.json_mime?('application/json; charset=UTF8')).to be(true) + expect(client.json_mime?('APPLICATION/JSON')).to be(true) + expect(client.json_mime?('*/*')).to be(true) + end + + it 'rejects other mime types' do + expect(client.json_mime?('application/xml')).to be(false) + expect(client.json_mime?('text/plain')).to be(false) + end + end + + describe '#select_header_accept' do + it 'returns nil for nil or empty list' do + expect(client.select_header_accept(nil)).to be_nil + expect(client.select_header_accept([])).to be_nil + end + + it 'prefers the json type' do + accepts = ['application/xml', 'application/json; charset=UTF8'] + + expect(client.select_header_accept(accepts)).to eq('application/json; charset=UTF8') + end + + it 'joins all types when none is json' do + expect(client.select_header_accept(['application/xml', 'text/plain'])).to eq( + 'application/xml,text/plain' + ) + end + end + + describe '#select_header_content_type' do + it 'defaults to application/json for nil or empty list' do + expect(client.select_header_content_type(nil)).to eq('application/json') + expect(client.select_header_content_type([])).to eq('application/json') + end + + it 'prefers the json type' do + types = ['application/xml', 'application/json'] + + expect(client.select_header_content_type(types)).to eq('application/json') + end + + it 'falls back to the first type when none is json' do + expect(client.select_header_content_type(['application/xml', 'text/plain'])).to eq( + 'application/xml' + ) + end + end + + describe '#build_collection_param' do + let(:param) { %w[a b c] } + + it 'joins with comma for :csv' do + expect(client.build_collection_param(param, :csv)).to eq('a,b,c') + end + + it 'joins with space for :ssv' do + expect(client.build_collection_param(param, :ssv)).to eq('a b c') + end + + it 'joins with tab for :tsv' do + expect(client.build_collection_param(param, :tsv)).to eq("a\tb\tc") + end + + it 'joins with pipe for :pipes' do + expect(client.build_collection_param(param, :pipes)).to eq('a|b|c') + end + + it 'returns the array itself for :multi' do + expect(client.build_collection_param(param, :multi)).to be(param) + end + + it 'raises for an unknown format' do + expect { client.build_collection_param(param, :bogus) }.to raise_error( + RuntimeError, + 'unknown collection format: :bogus' + ) + end + end + + describe '#object_to_http_body' do + it 'returns nil for nil' do + expect(client.object_to_http_body(nil)).to be_nil + end + + it 'returns a string unchanged' do + body = 'already-serialized' + + expect(client.object_to_http_body(body)).to be(body) + end + + it 'converts a hash to json' do + expect(client.object_to_http_body('a' => 1)).to eq('{"a":1}') + end + + it 'converts an array to json' do + expect(client.object_to_http_body([{ 'a' => 1 }])).to eq('[{"a":1}]') + end + + it 'uses to_hash on models' do + model_class = + Class.new do + def to_hash + { 'x' => 1 } + end + end + + expect(client.object_to_http_body(model_class.new)).to eq('{"x":1}') + end + end + + describe '#build_request_url' do + it 'prefixes the path with the base url' do + expect(client.build_request_url('orders/v0/orders')).to eq("#{base_url}/orders/v0/orders") + end + + it 'collapses duplicate slashes' do + expect(client.build_request_url('//orders//v0///orders')).to eq( + "#{base_url}/orders/v0/orders" + ) + end + end +end diff --git a/spec/amazon_sp_clients/api_response_spec.rb b/spec/amazon_sp_clients/api_response_spec.rb index effd163..c2aaa51 100644 --- a/spec/amazon_sp_clients/api_response_spec.rb +++ b/spec/amazon_sp_clients/api_response_spec.rb @@ -7,13 +7,13 @@ it 'accepts optional pagination key (this differs between different APIs)' do input = { pagination: { - nextToken: 'seed', + nextToken: 'seed' }, payload: { BogusField: { - MWSAuthToken: 'test', - }, - }, + MWSAuthToken: 'test' + } + } } response = api_response.build_from_hash(input) @@ -28,7 +28,7 @@ end it 'wraps single error with ApiError' do - input = { 'errors': [{ 'code': 'InvalidInput', 'message': 'Invalid Input' }] } + input = { errors: [{ code: 'InvalidInput', message: 'Invalid Input' }] } response = api_response.build_from_hash(input) errors = response.errors expect(errors).to be_a(AmazonSpClients::ApiError) @@ -43,4 +43,148 @@ expect(response.payload).to eq(expected) end end + + describe '#initialize' do + it 'raises ArgumentError when attributes is not a hash' do + expect { api_response.new('not a hash') }.to raise_error( + ArgumentError, + 'The input argument (attributes) must be a hash in `ApiResponse` initialize method' + ) + end + + it 'leaves errors nil on success' do + response = api_response.new(payload: { feedId: 1 }) + expect(response.errors).to be_nil + end + + it 'leaves pagination nil when absent' do + response = api_response.new(payload: { feedId: 1 }) + expect(response.pagination).to be_nil + end + + it 'sets both payload and errors when both are present' do + input = { + payload: { feedId: 1 }, + errors: [{ code: 'InvalidInput', message: 'Invalid Input' }] + } + + response = api_response.new(input) + + expect(response.payload).to eq(feedId: 1) + expect(response.errors).to be_a(AmazonSpClients::ApiError) + expect(response.errors.errors.first.code).to eq 'InvalidInput' + end + + it 'leaves payload nil on an error-only response' do + input = { errors: [{ code: 'InvalidInput', message: 'Invalid Input' }] } + response = api_response.new(input) + + expect(response.payload).to be_nil + expect(response.errors).to be_a(AmazonSpClients::ApiError) + end + + it 'exposes attributes and response readers' do + attrs = { payload: { feedId: 1 } } + http_response = double('response') + + response = api_response.new(attrs, http_response) + + expect(response.attributes).to equal(attrs) + expect(response.response).to equal(http_response) + end + end + + describe '#response_headers' do + it 'returns the response headers' do + headers = Faraday::Utils::Headers.new('Content-Type' => 'application/json') + response = api_response.new({ payload: {} }, double('response', headers: headers)) + + expect(response.response_headers).to equal(headers) + end + + it 'is nil without a response' do + response = api_response.new(payload: {}) + expect(response.response_headers).to be_nil + end + end + + describe '#reported_rate_limit' do + it 'reads the rate limit header as a float, case-insensitive' do + headers = Faraday::Utils::Headers.new('x-amzn-RateLimit-Limit' => '0.2') + response = api_response.new({ payload: {} }, double('response', headers: headers)) + + expect(response.reported_rate_limit).to eq 0.2 + end + + it 'is nil without a response' do + response = api_response.new(payload: {}) + expect(response.reported_rate_limit).to be_nil + end + + it 'is nil without the header' do + headers = Faraday::Utils::Headers.new + response = api_response.new({ payload: {} }, double('response', headers: headers)) + + expect(response.reported_rate_limit).to be_nil + end + end +end + +RSpec.describe AmazonSpClients::ApiError do + describe '#errors' do + it 'builds error structs from an errors hash' do + input = { + errors: [ + { code: 'InvalidInput', message: 'Invalid Input', details: 'Bad feedId' } + ] + } + + error = described_class.new(input) + + expect(error.errors.size).to eq 1 + expect(error.errors.first.code).to eq 'InvalidInput' + expect(error.errors.first.message).to eq 'Invalid Input' + expect(error.errors.first.details).to eq 'Bad feedId' + end + + it 'is empty for non-array input' do + error = described_class.new('boom') + expect(error.errors).to eq [] + end + + it 'is empty for a hash without :errors key' do + error = described_class.new(code: 'InvalidInput') + expect(error.errors).to eq [] + end + end + + describe '#full_messages' do + it 'joins "code: message" pairs with a comma' do + input = { + errors: [ + { code: 'InvalidInput', message: 'Invalid Input' }, + { code: 'QuotaExceeded', message: 'Slow down' } + ] + } + + error = described_class.new(input) + + expect(error.full_messages).to eq 'InvalidInput: Invalid Input, QuotaExceeded: Slow down' + end + + it 'appends details when present' do + input = { + errors: [{ code: 'InvalidInput', message: 'Invalid Input', details: 'Bad feedId' }] + } + + error = described_class.new(input) + + expect(error.full_messages).to eq 'InvalidInput: Invalid Input - Bad feedId' + end + + it 'is empty for non-array input' do + error = described_class.new('boom') + expect(error.full_messages).to eq '' + end + end end diff --git a/spec/amazon_sp_clients/configuration_spec.rb b/spec/amazon_sp_clients/configuration_spec.rb new file mode 100644 index 0000000..ae9c4e9 --- /dev/null +++ b/spec/amazon_sp_clients/configuration_spec.rb @@ -0,0 +1,246 @@ +require 'spec_helper' + +RSpec.describe AmazonSpClients::Configuration do + subject(:config) { described_class.new } + + describe 'defaults' do + it 'uses the NA region' do + expect(config.region).to eq('us-east-1') + end + + it 'uses https' do + expect(config.scheme).to eq('https') + end + + it 'uses base path "/"' do + expect(config.base_path).to eq('/') + end + + it 'has a 60 second timeout' do + expect(config.timeout).to eq(60) + end + + it 'has no endpoint or marketplace id' do + expect(config.endpoint).to be_nil + expect(config.marketplace_id).to be_nil + end + + it 'points host at the NA API' do + expect(config.host).to eq('sellingpartnerapi-na.amazon.com') + end + end + + describe '.new with a block' do + it 'yields the new config' do + yielded = nil + config = described_class.new { |c| yielded = c } + + expect(yielded).to be(config) + end + end + + describe '#configure' do + it 'yields self' do + yielded = nil + config.configure { |c| yielded = c } + + expect(yielded).to be(config) + end + end + + describe '#region=' do + it 'updates region and host together' do + config.region = 'eu-west-1' + + expect(config.region).to eq('eu-west-1') + expect(config.host).to eq('sellingpartnerapi-eu.amazon.com') + end + end + + describe 'sandbox mode' do + it 'prefixes host with "sandbox."' do + config.sandbox_env! + + expect(config.host).to eq('sandbox.sellingpartnerapi-na.amazon.com') + end + + it 'prefixes base_url with "sandbox."' do + config.sandbox_env! + + expect(config.base_url) + .to eq('https://sandbox.sellingpartnerapi-na.amazon.com') + end + + it 'returns to the plain host when disabled' do + config.sandbox_env! + config.disable_sandbox! + + expect(config.host).to eq('sellingpartnerapi-na.amazon.com') + expect(config.base_url).to eq('https://sellingpartnerapi-na.amazon.com') + end + end + + describe '#set_endpoint_by_marketplace_id' do + it 'sets up NA for the US marketplace' do + config.set_endpoint_by_marketplace_id('ATVPDKIKX0DER') + + expect(config.marketplace_id).to eq('ATVPDKIKX0DER') + expect(config.endpoint).to eq('na') + expect(config.region).to eq('us-east-1') + expect(config.host).to eq('sellingpartnerapi-na.amazon.com') + end + + it 'sets up EU for the German marketplace' do + config.set_endpoint_by_marketplace_id('A1PA6795UKMFR9') + + expect(config.marketplace_id).to eq('A1PA6795UKMFR9') + expect(config.endpoint).to eq('eu') + expect(config.region).to eq('eu-west-1') + expect(config.host).to eq('sellingpartnerapi-eu.amazon.com') + end + + it 'sets up FE for the Japanese marketplace' do + config.set_endpoint_by_marketplace_id('A1VC38T7YXB528') + + expect(config.marketplace_id).to eq('A1VC38T7YXB528') + expect(config.endpoint).to eq('fe') + expect(config.region).to eq('us-west-2') + expect(config.host).to eq('sellingpartnerapi-fe.amazon.com') + end + end + + describe '#endpoint=' do + it 'keeps the given string' do + config.endpoint = 'na' + + expect(config.endpoint).to eq('na') + end + + it 'maps endpoint names to regions' do + { 'na' => 'us-east-1', 'eu' => 'eu-west-1', 'fe' => 'us-west-2' } + .each do |endpoint, region| + config.endpoint = endpoint + expect(config.region).to eq(region) + end + end + + it 'maps NA country codes to us-east-1' do + %w[br ca mx us].each do |code| + config.endpoint = code + expect(config.region).to eq('us-east-1') + end + end + + it 'maps FE country codes to us-west-2' do + %w[sg au jp].each do |code| + config.endpoint = code + expect(config.region).to eq('us-west-2') + end + end + + it 'maps EU country codes to eu-west-1' do + %w[ae de eg es fr gb in it nl tr pl se].each do |code| + config.endpoint = code + expect(config.region).to eq('eu-west-1') + end + end + end + + describe '#scheme=' do + it 'strips "://"' do + config.scheme = 'http://' + + expect(config.scheme).to eq('http') + end + end + + describe '#base_path=' do + it 'adds a leading slash' do + config.base_path = 'v1' + + expect(config.base_path).to eq('/v1') + end + + it 'collapses repeated slashes' do + config.base_path = '//foo//bar' + + expect(config.base_path).to eq('/foo/bar') + end + + it 'keeps a trailing slash' do + config.base_path = 'v1/' + + expect(config.base_path).to eq('/v1/') + end + + it 'becomes empty for "/"' do + config.base_path = '/' + + expect(config.base_path).to eq('') + end + + it 'becomes empty for ""' do + config.base_path = '' + + expect(config.base_path).to eq('') + end + end + + describe '#base_url' do + it 'has no trailing slash by default' do + expect(config.base_url).to eq('https://sellingpartnerapi-na.amazon.com') + end + + it 'joins scheme, host and base path' do + config.base_path = 'v1' + + expect(config.base_url) + .to eq('https://sellingpartnerapi-na.amazon.com/v1') + end + + it 'drops the trailing slash of the base path' do + config.base_path = 'v1/' + + expect(config.base_url) + .to eq('https://sellingpartnerapi-na.amazon.com/v1') + end + + it 'follows the region' do + config.region = 'us-west-2' + + expect(config.base_url).to eq('https://sellingpartnerapi-fe.amazon.com') + end + end + + describe '.default' do + after { Thread.current[:amazon_sp_configuration] = nil } + + it 'returns the same object in one thread' do + expect(described_class.default).to be(described_class.default) + end + + it 'gives each thread its own object' do + main = described_class.default + other = Thread.new { described_class.default }.value + + expect(other).to be_a(described_class) + expect(other).not_to be(main) + end + end + + describe 'constants' do + it 'maps each region to its API host' do + expect(AmazonSpClients::REGIONS).to eq( + 'us-east-1' => 'sellingpartnerapi-na.amazon.com', + 'eu-west-1' => 'sellingpartnerapi-eu.amazon.com', + 'us-west-2' => 'sellingpartnerapi-fe.amazon.com' + ) + end + + it 'lists marketplace ids by country' do + expect(AmazonSpClients::MARKETPLACE_IDS[:us]).to eq('ATVPDKIKX0DER') + expect(AmazonSpClients::MARKETPLACE_IDS[:de]).to eq('A1PA6795UKMFR9') + expect(AmazonSpClients::MARKETPLACE_IDS[:jp]).to eq('A1VC38T7YXB528') + end + end +end diff --git a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb new file mode 100644 index 0000000..534515c --- /dev/null +++ b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +RSpec.describe AmazonSpClients::Middlewares::RaiseError do + let(:base_url) { 'https://api.example.test' } + + def conn(service) + Faraday.new(url: base_url) do |c| + c.use described_class, { service: service } + c.adapter :net_http + end + end + + # Runs the block and returns the Faraday error it raised. + def rescued_error + yield + nil + rescue Faraday::Error => e + e + end + + describe 'constructor' do + let(:app) { proc {} } + + it 'raises when the service option is missing' do + expect { described_class.new(app, {}) }.to raise_error(KeyError) + end + + it 'raises when the service is unknown' do + expect { described_class.new(app, { service: :bogus }) } + .to raise_error(an_instance_of(RuntimeError)) + end + end + + describe 'status to error map' do + { + 400 => Faraday::BadRequestError, + 401 => Faraday::UnauthorizedError, + 403 => Faraday::ForbiddenError, + 404 => Faraday::ResourceNotFound, + 407 => Faraday::ProxyAuthError, + 409 => Faraday::ConflictError, + 422 => Faraday::UnprocessableEntityError, + 429 => Faraday::RetriableResponse, + 418 => Faraday::ClientError, + 500 => Faraday::ServerError, + 503 => Faraday::ServerError + }.each do |status, error_class| + it "raises #{error_class} on #{status}" do + stub_request(:get, "#{base_url}/thing").to_return(status: status) + + expect { conn(:uploads).get('/thing') } + .to raise_error(an_instance_of(error_class)) + end + end + + it 'raises nothing on 200' do + stub_request(:get, "#{base_url}/thing") + .to_return(status: 200, body: 'ok') + + expect(conn(:uploads).get('/thing').body).to eq('ok') + end + end + + describe 'error message' do + # Callers (active_cart) match on the "Service 'token'" prefix. + it 'formats token errors from the JSON body' do + stub_request(:post, "#{base_url}/auth/o2/token") + .to_return(status: 400, body: fixture('token_error.json')) + + expect { conn(:token).post('/auth/o2/token') }.to raise_error( + Faraday::BadRequestError, + "Service 'token' ERR: error: invalid_client " \ + 'description: Client authentication failed' + ) + end + + it 'formats spapi errors from the JSON body' do + body = '{"errors":[{"code":"InvalidInput","message":"Invalid Input"}]}' + stub_request(:get, "#{base_url}/orders").to_return(status: 400, body: body) + + expect { conn(:spapi).get('/orders') }.to raise_error( + Faraday::BadRequestError, + "Service 'spapi' ERR: InvalidInput: Invalid Input" + ) + end + + it 'joins multiple spapi errors with a comma' do + body = + '{"errors":[{"code":"QuotaExceeded","message":"slow down"},' \ + '{"code":"InvalidInput","message":"bad asin"}]}' + stub_request(:get, "#{base_url}/orders").to_return(status: 429, body: body) + + expect { conn(:spapi).get('/orders') }.to raise_error( + Faraday::RetriableResponse, + "Service 'spapi' ERR: QuotaExceeded: slow down, InvalidInput: bad asin" + ) + end + + it 'says (no body) when the body is empty' do + stub_request(:get, "#{base_url}/thing").to_return(status: 400, body: '') + + expect { conn(:token).get('/thing') }.to raise_error( + Faraday::BadRequestError, + 'the server responded with status 400 (no body)' + ) + end + + it 'reports only the status for other services' do + stub_request(:get, "#{base_url}/thing") + .to_return(status: 418, body: 'teapot') + + expect { conn(:uploads).get('/thing') }.to raise_error( + Faraday::ClientError, + 'the server responded with status 418' + ) + end + + it 'falls back instead of raising on an unparseable body' do + stub_request(:get, "#{base_url}/thing") + .to_return(status: 400, body: 'not json') + + # The JSON parse error text lands inside the parentheses. + expect { conn(:spapi).get('/thing') }.to raise_error( + Faraday::BadRequestError, + /\Athe server responded with status 400 \(unexpected token/ + ) + end + + it 'uses a fixed message for 407, ignoring the body' do + stub_request(:get, "#{base_url}/thing") + .to_return(status: 407, body: 'ignored') + + expect { conn(:uploads).get('/thing') }.to raise_error( + Faraday::ProxyAuthError, + '407 "Proxy Authentication Required"' + ) + end + end + + describe 'error payload' do + it 'exposes service, response and request details' do + stub_request(:post, "#{base_url}/orders/v0/orders").to_return( + status: 400, + body: 'oops', + headers: { 'x-amzn-requestid' => 'req-id-1' } + ) + + err = rescued_error { conn(:uploads).post('/orders/v0/orders', 'req') } + + expect(err.response[:service]).to eq(:uploads) + expect(err.response[:response][:status]).to eq(400) + expect(err.response[:response][:body]).to eq('oops') + expect(err.response[:response][:headers]['x-amzn-requestid']) + .to eq('req-id-1') + expect(err.response[:request][:method]).to eq(:post) + expect(err.response[:request][:url_path]).to eq('/orders/v0/orders') + expect(err.response[:request][:body]).to eq('req') + end + end +end diff --git a/spec/amazon_sp_clients/module_helpers_spec.rb b/spec/amazon_sp_clients/module_helpers_spec.rb new file mode 100644 index 0000000..24179d9 --- /dev/null +++ b/spec/amazon_sp_clients/module_helpers_spec.rb @@ -0,0 +1,161 @@ +require 'spec_helper' + +# Characterization specs: pin current behavior of the module-level +# helpers in lib/amazon_sp_clients.rb before the modernization refactor. +RSpec.describe AmazonSpClients do + let(:token_url) { 'https://api.amazon.com/auth/o2/token' } + let(:access_token) { 'Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE' } + + before do + AmazonSpClients.configure do |c| + c.client_id = 'CLIENT_ID' + c.client_secret = 'CLIENT_SECRET' + # Skips the eager STS AssumeRole request in Session#initialize. + c.credentials_provider = Aws::Credentials.new('key', 'secret') + c.logger = Logger.new(File::NULL) + end + end + + # The default configuration is thread-local global state. + after { Thread.current[:amazon_sp_configuration] = nil } + + describe '.configure' do + it 'returns the default configuration' do + expect(AmazonSpClients.configure).to be(AmazonSpClients::Configuration.default) + end + + it 'returns the same object each call' do + expect(AmazonSpClients.configure).to be(AmazonSpClients.configure) + end + + it 'yields the default configuration to the block' do + yielded = nil + AmazonSpClients.configure { |c| yielded = c } + + expect(yielded).to be(AmazonSpClients::Configuration.default) + end + end + + describe '.new_session' do + it 'exchanges the refresh token and returns a session' do + stub_request(:post, token_url) + .with( + body: { + 'grant_type' => 'refresh_token', + 'refresh_token' => 'REFRESH_TOKEN', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET' + } + ) + .to_return(status: 200, body: fixture('token_success.json')) + + session = AmazonSpClients.new_session('REFRESH_TOKEN') + + expect(session).to be_a(AmazonSpClients::Session) + expect(session.access_token).to eq(access_token) + end + end + + describe '.new_migration_session' do + it 'makes a grantless exchange with the migration scope' do + token_stub = + stub_request(:post, token_url) + .with( + body: { + 'grant_type' => 'client_credentials', + 'scope' => 'sellingpartnerapi::migration', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET' + } + ) + .to_return(status: 200, body: fixture('token_success.json')) + + session = AmazonSpClients.new_migration_session + + expect(token_stub).to have_been_requested + expect(session).to be_a(AmazonSpClients::Session) + expect(session.access_token).to eq(access_token) + end + end + + describe '.new_callback_session' do + it 'returns a session that takes its token from the callback' do + session = AmazonSpClients.new_callback_session { 'CALLBACK_TOKEN' } + + expect(session).to be_a(AmazonSpClients::Session) + # The callback is not called at creation, only on refresh. + expect(session.access_token).to be_nil + + session.refresh + + expect(session.access_token).to eq('CALLBACK_TOKEN') + end + end + + describe '.upload_feed_data' do + it 'puts the payload to the document url and returns the response' do + feed_doc = { url: 'https://example.com/upload' } + payload = 'test' + + stub_request(:put, feed_doc[:url]).to_return(status: 200, body: '') + + response = + AmazonSpClients.upload_feed_data(feed_doc, 'application/xml', payload) + + expect(WebMock).to have_requested(:put, feed_doc[:url]) + .with(body: payload, headers: { 'Content-Type' => 'application/xml' }) + expect(response).to be_a(Faraday::Response) + expect(response.status).to eq(200) + end + end + + describe '.download_feed_report' do + it 'downloads and parses a plain json report' do + report = { feedDocumentId: 'doc1', url: 'https://example.com/report' } + + stub_request(:get, report[:url]).to_return( + status: 200, + body: '{"header":{"status":"DONE"}}', + headers: { 'Content-Type' => 'application/json' } + ) + + result = AmazonSpClients.download_feed_report(report) + + expect(result).to eq('header' => { 'status' => 'DONE' }) + end + end + + describe '.download_report_document' do + let(:doc_url) { 'https://example.com/document' } + + it 'gets the document url and returns the raw body' do + stub_request(:get, doc_url) + .to_return(status: 200, body: "sku\tqty\nA1\t2\n") + + body = AmazonSpClients.download_report_document(url: doc_url) + + expect(body).to eq("sku\tqty\nA1\t2\n") + expect(WebMock).to have_requested(:get, doc_url) + end + + it 'raises not found error on 404' do + stub_request(:get, doc_url).to_return(status: 404, body: 'gone') + + expect { AmazonSpClients.download_report_document(url: doc_url) } + .to raise_error( + Faraday::ResourceNotFound, + 'the server responded with status 404' + ) + end + + it 'raises server error on 500' do + stub_request(:get, doc_url).to_return(status: 500, body: 'boom') + + expect { AmazonSpClients.download_report_document(url: doc_url) } + .to raise_error( + Faraday::ServerError, + 'the server responded with status 500' + ) + end + end +end diff --git a/spec/amazon_sp_clients/session_spec.rb b/spec/amazon_sp_clients/session_spec.rb new file mode 100644 index 0000000..05b4f6d --- /dev/null +++ b/spec/amazon_sp_clients/session_spec.rb @@ -0,0 +1,266 @@ +require 'spec_helper' + +# Characterization specs. They pin what Session does today, before the +# modernization refactor. They are not a statement of intended design. +RSpec.describe AmazonSpClients::Session do + let(:token_url) { 'https://api.amazon.com/auth/o2/token' } + + # From spec/fixtures/token_success.json. + let(:fixture_access_token) { 'Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE' } + let(:fixture_refresh_token) { 'Atzr|IQEBLzAtAhRPpMJxdwVz2Nn6f2y-tpJX2DeXEXAMPLE' } + + let(:config) do + AmazonSpClients::Configuration.new do |c| + c.client_id = 'CLIENT_ID' + c.client_secret = 'CLIENT_SECRET' + # Skips the eager STS AssumeRole call in Session#initialize. + c.credentials_provider = Aws::Credentials.new('k', 's') + c.sandbox_env! + end + end + + # Session.new takes the config positionally. + let(:session) { described_class.new(config) } + + before do + # TokenExchangeAuth and ApiClient read Configuration.default, not the + # config passed to Session.new, so the default must be the same object. + Thread.current[:amazon_sp_configuration] = config + + Timecop.freeze(Time.utc(2022, 1, 1, 12, 0, 0)) + end + + after { Thread.current[:amazon_sp_configuration] = nil } + + describe '#authenticate' do + before do + stub_request(:post, token_url).to_return(status: 200, body: fixture('token_success.json')) + end + + it 'returns self' do + expect(session.authenticate('REFRESH_TOKEN')).to be(session) + end + + it 'exposes the access token from the response' do + session.authenticate('REFRESH_TOKEN') + + expect(session.access_token).to eq(fixture_access_token) + end + + it 'sends a refresh_token grant with client credentials' do + session.authenticate('REFRESH_TOKEN') + + expect( + a_request(:post, token_url).with( + body: { + 'grant_type' => 'refresh_token', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET', + 'refresh_token' => 'REFRESH_TOKEN' + } + ) + ).to have_been_made.once + end + + it 'skips the token request while the token is valid' do + session.authenticate('REFRESH_TOKEN') + session.authenticate('REFRESH_TOKEN') + + expect(a_request(:post, token_url)).to have_been_made.once + end + end + + describe '#refresh with a refresh token session' do + before do + stub_request(:post, token_url).to_return(status: 200, body: fixture('token_success.json')) + end + + it 'makes no request while the token is valid' do + session.authenticate('REFRESH_TOKEN') + + session.refresh + + expect(a_request(:post, token_url)).to have_been_made.once + end + + it 're-requests after the token expires' do + session.authenticate('REFRESH_TOKEN') + + Timecop.freeze(Time.now + 3601) + session.refresh + + expect(a_request(:post, token_url)).to have_been_made.times(2) + end + + it 'uses the refresh token from the last response' do + session.authenticate('REFRESH_TOKEN') + + Timecop.freeze(Time.now + 3601) + session.refresh + + expect( + a_request(:post, token_url).with( + body: hash_including('refresh_token' => fixture_refresh_token) + ) + ).to have_been_made.once + end + end + + describe '#authenticate_grantless' do + before do + stub_request(:post, token_url).to_return(status: 200, body: fixture('token_success.json')) + end + + it 'returns self' do + expect(session.authenticate_grantless('test::scope')).to be(session) + end + + it 'exposes the access token from the response' do + session.authenticate_grantless('test::scope') + + expect(session.access_token).to eq(fixture_access_token) + end + + # The exact body match also pins that no refresh_token param is sent. + it 'sends a client_credentials grant with the scope' do + session.authenticate_grantless('test::scope') + + expect( + a_request(:post, token_url).with( + body: { + 'grant_type' => 'client_credentials', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET', + 'scope' => 'test::scope' + } + ) + ).to have_been_made.once + end + end + + describe '#with_callback' do + it 'returns self' do + expect(session.with_callback { 'T' }).to be(session) + end + + it 'refresh adopts the callback return value as access token' do + session.with_callback { 'CB_TOKEN' } + + session.refresh + + expect(session.access_token).to eq('CB_TOKEN') + end + + it 'refresh calls the callback every time' do + tokens = %w[first second].each + session.with_callback { tokens.next } + + session.refresh + expect(session.access_token).to eq('first') + + session.refresh + expect(session.access_token).to eq('second') + end + end + + describe '#ask_for_restricted_data_token' do + let(:rdt_url) do + 'https://sandbox.sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken' + end + + # Callback session: refresh never needs the token endpoint. + let(:session) { described_class.new(config).with_callback { 'CB_TOKEN' } } + + before do + stub_request(:post, rdt_url).to_return( + status: 200, + body: '{"payload":{"restrictedDataToken":"RDT","expiresIn":3600}}' + ) + end + + it 'sends the known resource list for a symbol' do + session.ask_for_restricted_data_token(:orders) + + expect( + a_request(:post, rdt_url).with( + body: { + restrictedResources: [ + { + method: 'GET', + path: '/orders/v0/orders', + dataElements: %w[buyerInfo shippingAddress] + } + ] + } + ) + ).to have_been_made.once + end + + it 'wraps a non-symbol resource in restrictedResources' do + resource = { method: 'GET', path: '/custom/path', dataElements: ['buyerInfo'] } + + session.ask_for_restricted_data_token(resource) + + expect( + a_request(:post, rdt_url).with(body: { restrictedResources: [resource] }) + ).to have_been_made.once + end + + it 'exposes the token keyed by resource' do + session.ask_for_restricted_data_token(:orders) + + expect(session.restricted_data_token[:orders]).to eq('RDT') + end + + it 'authorizes the request with the session access token' do + session.ask_for_restricted_data_token(:orders) + + expect( + a_request(:post, rdt_url).with(headers: { 'x-amz-access-token' => 'CB_TOKEN' }) + ).to have_been_made.once + end + + it 'caches the token per resource' do + session.ask_for_restricted_data_token(:orders) + session.ask_for_restricted_data_token(:orders) + + expect(a_request(:post, rdt_url)).to have_been_made.once + end + + it 'requests once per distinct resource' do + session.ask_for_restricted_data_token(:orders) + session.ask_for_restricted_data_token(:orders_and_items) + + expect(a_request(:post, rdt_url)).to have_been_made.times(2) + + # :orders_and_items has its own resource list, not the :orders one. + expect( + a_request(:post, rdt_url).with( + body: { + restrictedResources: [ + { + method: 'GET', + path: '/orders/v0/orders', + dataElements: %w[buyerInfo shippingAddress] + }, + { + method: 'GET', + path: '/orders/v0/orders/{orderId}/orderItems', + dataElements: %w[buyerInfo] + } + ] + } + ) + ).to have_been_made.once + end + + it 're-requests after the token expires' do + session.ask_for_restricted_data_token(:orders) + + Timecop.freeze(Time.now + 3601) + session.ask_for_restricted_data_token(:orders) + + expect(a_request(:post, rdt_url)).to have_been_made.times(2) + end + end +end diff --git a/spec/amazon_sp_clients/sp_modules_spec.rb b/spec/amazon_sp_clients/sp_modules_spec.rb new file mode 100644 index 0000000..fb11d0b --- /dev/null +++ b/spec/amazon_sp_clients/sp_modules_spec.rb @@ -0,0 +1,53 @@ +require 'spec_helper' + +# Phase 1 replaces the generator and rewrites vendor/ and every +# sp_*.rb shim. Consumers depend on these exact require paths and +# API class names; each API class takes a session and builds an +# ApiClient. Pin all of it before anything regenerates. +RSpec.describe 'sp_* module contract' do + used_modules = { + 'amazon_sp_clients/sp_orders_v0' => %w[ + SpOrdersV0::OrdersV0Api + SpOrdersV0::ShipmentApi + ], + 'amazon_sp_clients/sp_tokens_2021' => %w[SpTokens2021::TokensApi], + 'amazon_sp_clients/sp_feeds_2021' => %w[SpFeeds2021::FeedsApi], + 'amazon_sp_clients/sp_reports_2021' => %w[SpReports2021::ReportsApi], + 'amazon_sp_clients/sp_listings_items_2021' => %w[SpListingsItems2021::ListingsApi], + 'amazon_sp_clients/sp_vdf_orders_v1' => %w[SpVdfOrdersV1::VendorOrdersApi], + 'amazon_sp_clients/sp_vdf_inventory_v1' => %w[SpVdfInventoryV1::UpdateInventoryApi], + 'amazon_sp_clients/sp_vdf_shipping_v1' => %w[ + SpVdfShippingV1::CustomerInvoicesApi + SpVdfShippingV1::VendorShippingApi + SpVdfShippingV1::VendorShippingLabelsApi + ], + 'amazon_sp_clients/sp_vendor_orders' => %w[SpVendorOrders::VendorOrdersApi], + 'amazon_sp_clients/sp_vendor_invoices' => %w[SpVendorInvoices::VendorPaymentsApi], + 'amazon_sp_clients/sp_vendor_transaction_status' => %w[ + SpVendorTransactionStatus::VendorTransactionApi + ], + 'amazon_sp_clients/sp_vendors_shipments' => %w[SpVendorsShipments::VendorShippingApi], + 'amazon_sp_clients/sp_fba_inventory' => %w[SpFbaInventory::FbaInventoryApi], + 'amazon_sp_clients/sp_fulfillment_outbound_2020' => %w[ + SpFulfillmentOutbound2020::FbaOutboundApi + ] + } + + # ApiClient.new reads the thread-local default config. + after { Thread.current[:amazon_sp_configuration] = nil } + + used_modules.each do |path, api_classes| + describe path do + it 'loads and exposes its API classes' do + require path + + api_classes.each do |name| + klass = AmazonSpClients.const_get(name) + api = klass.new(Object.new) + + expect(api.api_client).to be_a(AmazonSpClients::ApiClient) + end + end + end + end +end diff --git a/spec/amazon_sp_clients/token_exchange_auth_spec.rb b/spec/amazon_sp_clients/token_exchange_auth_spec.rb index b52a331..f1391c6 100644 --- a/spec/amazon_sp_clients/token_exchange_auth_spec.rb +++ b/spec/amazon_sp_clients/token_exchange_auth_spec.rb @@ -1,30 +1,104 @@ require 'spec_helper' -require 'webmock/rspec' -RSpec.describe AmazonSpClients do +RSpec.describe AmazonSpClients::TokenExchangeAuth do before do c = AmazonSpClients::Configuration.new - c.access_key = 'key' - c.secret_key = 'secret' - c.role_arn = 'arn::****' - @token = AmazonSpClients::TokenExchangeAuth.new(c) + c.client_id = 'CLIENT_ID' + c.client_secret = 'CLIENT_SECRET' + @token = AmazonSpClients::TokenExchangeAuth.new('REFRESH_TOKEN', c) end - context 'granted' do - describe '#exchange' do - it 'raises' do + describe '#exchange' do + context 'granted (refresh_token)' do + it 'returns AuthResponse with token fields' do + stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( + status: 200, + body: fixture('token_success.json') + ) + + resp = @token.exchange + + expect(resp).to be_a(AmazonSpClients::AuthResponse) + expect(resp.access_token).to eq( + 'Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE' + ) + expect(resp.token_type).to eq('bearer') + expect(resp.expires_in).to eql(3600) + expect(resp.refresh_token).to eq( + 'Atzr|IQEBLzAtAhRPpMJxdwVz2Nn6f2y-tpJX2DeXEXAMPLE' + ) + end + + it 'posts form-encoded credentials and refresh token' do + stub = + stub_request(:post, 'https://api.amazon.com/auth/o2/token') + .with( + body: { + 'grant_type' => 'refresh_token', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET', + 'refresh_token' => 'REFRESH_TOKEN' + }, + headers: { + 'Content-Type' => 'application/x-www-form-urlencoded' + } + ) + .to_return(status: 200, body: fixture('token_success.json')) + + @token.exchange + + expect(stub).to have_been_requested + end + + it 'raises Faraday::BadRequestError on 400' do stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 400, - body: fixture('token_error.json'), + body: fixture('token_error.json') ) expect { @token.exchange }.to raise_error( Faraday::BadRequestError, - /Service 'token' ERR: error: invalid_client/, + "Service 'token' ERR: error: invalid_client " \ + 'description: Client authentication failed' + ) do |err| + expect(err.response[:service]).to eq(:token) + expect(err.response[:response][:status]).to eq(400) + end + end + end + + context 'grantless (client_credentials)' do + it 'sends scope and no refresh token' do + stub = + stub_request(:post, 'https://api.amazon.com/auth/o2/token') + .with( + body: { + 'grant_type' => 'client_credentials', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET', + 'scope' => 'some::scope' + } + ) + .to_return(status: 200, body: fixture('token_success.json')) + + @token.exchange('client_credentials', 'some::scope') + + expect(stub).to have_been_requested + end + + it 'requires scope' do + expect { @token.exchange('client_credentials') }.to raise_error( + RuntimeError, + 'Grantless operations require scope' ) end end - context 'grantless' + it 'rejects unknown grant type' do + expect { @token.exchange('bogus') }.to raise_error( + RuntimeError, + 'Invalid grant_type' + ) + end end end From c4babc2478324481bcc786b8d9017074265c72f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:44 +0200 Subject: [PATCH 06/83] Set up RuboCop and apply safe autocorrections NewCops enabled; vendor/, generated sp_* shims, and models repo excluded; Metrics off for now. Remaining offenses live in .rubocop_todo.yml to shrink over time. Only safe (semantics-preserving) corrections were applied to the handwritten code, verified by the characterization suite. This also drops a dangling 'private' in uploader.rb. --- .rubocop.yml | 28 ++++ .rubocop_todo.yml | 120 ++++++++++++++++++ Gemfile | 2 +- Rakefile | 66 +++++----- lib/amazon_sp_clients.rb | 12 +- lib/amazon_sp_clients/api_client.rb | 87 ++++++------- lib/amazon_sp_clients/api_error.rb | 26 ++-- lib/amazon_sp_clients/api_response.rb | 13 +- lib/amazon_sp_clients/configuration.rb | 12 +- .../middlewares/raise_error.rb | 76 +++++------ .../middlewares/request_signer_v4.rb | 4 +- lib/amazon_sp_clients/session.rb | 48 +++---- lib/amazon_sp_clients/token_exchange_auth.rb | 10 +- lib/amazon_sp_clients/uploader.rb | 4 +- 14 files changed, 321 insertions(+), 187 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..ee51e17 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,28 @@ +inherit_from: .rubocop_todo.yml + +AllCops: + NewCops: enable + TargetRubyVersion: 3.3 + SuggestExtensions: false + Exclude: + - vendor/**/* + - amzn-models/**/* + - codegen-templates/**/* + - tmp/**/* + - bin/**/* + # Autogenerated require shims; the Rakefile writes them. + - lib/amazon_sp_clients/sp_*.rb + +# Start permissive on the handwritten code; tighten later. +Metrics: + Enabled: false + +Style/Documentation: + Enabled: false + +# Grouping accessors would detach them from their doc comments. +Style/AccessorGrouping: + Enabled: false + +Layout/LineLength: + Max: 100 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..3fd280a --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,120 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2026-08-31 19:00:44 UTC using RuboCop version 1.86.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 6 +# Configuration parameters: EnforcedStyle, AllowedGems. +# SupportedStyles: Gemfile, gems.rb, gemspec +Gemspec/DevelopmentDependencies: + Exclude: + - 'amazon_sp_clients.gemspec' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings. +# URISchemes: http, https +Layout/LineLength: + Exclude: + - 'Rakefile' + - 'lib/amazon_sp_clients/session.rb' + - 'spec/amazon_sp_clients/uploader_spec.rb' + - 'spec/amazon_sp_clients_spec.rb' + +# Offense count: 1 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'spec/amazon_sp_clients_spec.rb' + +# Offense count: 3 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch. +Lint/DuplicateBranch: + Exclude: + - 'lib/amazon_sp_clients/configuration.rb' + +# Offense count: 4 +Lint/DuplicateMethods: + Exclude: + - 'lib/amazon_sp_clients/configuration.rb' + +# Offense count: 1 +# Configuration parameters: AllowKeywordBlockArguments. +Lint/UnderscorePrefixedVariableName: + Exclude: + - 'lib/amazon_sp_clients/api_client.rb' + +# Offense count: 2 +Naming/AccessorMethodName: + Exclude: + - 'lib/amazon_sp_clients/configuration.rb' + +# Offense count: 1 +# Configuration parameters: ForbiddenDelimiters. +# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +Naming/HeredocDelimiterNaming: + Exclude: + - 'Rakefile' + +# Offense count: 17 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/GlobalStdStream: + Exclude: + - 'Rakefile' + - 'lib/amazon_sp_clients/configuration.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'Rakefile' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: short, verbose +Style/PreferredHashMethods: + Exclude: + - 'lib/amazon_sp_clients/api_client.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/RedundantInterpolation: + Exclude: + - 'Rakefile' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'lib/amazon_sp_clients/api_error.rb' + - 'lib/amazon_sp_clients/configuration.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/StructInheritance: + Exclude: + - 'lib/amazon_sp_clients/api_error.rb' + - 'lib/amazon_sp_clients/token_exchange_auth.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method +Style/SymbolProc: + Exclude: + - 'spec/amazon_sp_clients/api_client_spec.rb' diff --git a/Gemfile b/Gemfile index cd6e86c..7d0b135 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "https://rubygems.org" +source 'https://rubygems.org' # Specify your gem's dependencies in amazon_sp_clients.gemspec gemspec diff --git a/Rakefile b/Rakefile index e4f3a27..b63aa36 100644 --- a/Rakefile +++ b/Rakefile @@ -1,68 +1,68 @@ -require "bundler/gem_tasks" -require "rspec/core/rake_task" +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) -task :default => :spec -SPECS_DIR = "./amzn-models/models" -FILE_PREFIX = "sp_" -MODULE_PREFIX = "" +task default: :spec +SPECS_DIR = './amzn-models/models' +FILE_PREFIX = 'sp_' +MODULE_PREFIX = '' -GEM_CONFIG = <<-EOF -{ - "gemName": "#{FILE_PREFIX}<%= @config_vars[:gem_name] %>", - "modulename": "#{MODULE_PREFIX}<%= @config_vars[:module_name] %>", - "gemRequiredRubyVersion": ">= 2.5" -} +GEM_CONFIG = <<~EOF + { + "gemName": "#{FILE_PREFIX}<%= @config_vars[:gem_name] %>", + "modulename": "#{MODULE_PREFIX}<%= @config_vars[:module_name] %>", + "gemRequiredRubyVersion": ">= 2.5" + } EOF -TARGET_DIR = "./vendor" -TEMPLATES_DIR = "./codegen-templates/ruby" +TARGET_DIR = './vendor' +TEMPLATES_DIR = './codegen-templates/ruby' STDOUT.sync = true # To run this you need to have SwaggerCodegen installed and have a working # `swagger-codegen` command. -desc "Uses swagger codegen to generate gem for each api" +desc 'Uses swagger codegen to generate gem for each api' namespace :codegen do - task :generate => [:clean] do - require "active_support" - require "erb" - require "fileutils" - require "yaml" - require "tempfile" - require "json" + task generate: [:clean] do + require 'active_support' + require 'erb' + require 'fileutils' + require 'yaml' + require 'tempfile' + require 'json' - sh "mkdir -p vendor" + sh 'mkdir -p vendor' - yml = YAML.load_file("./codegen-config.yml") + yml = YAML.load_file('./codegen-config.yml') - yml["list_of_apis"].each do |api| - camel_name = ActiveSupport::Inflector.camelize(api["name"]) + yml['list_of_apis'].each do |api| + camel_name = ActiveSupport::Inflector.camelize(api['name']) @config_vars = { module_name: camel_name, - gem_name: api["name"], + gem_name: api['name'] } # Passing options via -D{optionName}={optionValue} like in SC docs # doesn't work, so we need to pass "real" config file: - temp = Tempfile.new(api["name"]) + temp = Tempfile.new(api['name']) renderer = ERB.new(GEM_CONFIG) temp.write(renderer.result) temp.close # Main conmmand sh "swagger-codegen generate -l ruby -t #{TEMPLATES_DIR} \ - -o '#{TARGET_DIR}/#{api["name"]}' -i '#{SPECS_DIR}/#{api["path"]}' \ + -o '#{TARGET_DIR}/#{api['name']}' -i '#{SPECS_DIR}/#{api['path']}' \ --config='#{temp.path}' \ -Dmodels -DmodellDocs=false -DmodelTests=false \ -Dapis -DapiDocs=false -DapiTests=false" # Update main gem requires - File.open("./lib/amazon_sp_clients/#{FILE_PREFIX}#{api["name"]}.rb", "w") do |f| + File.open("./lib/amazon_sp_clients/#{FILE_PREFIX}#{api['name']}.rb", 'w') do |f| f.write("# frozen_string_literal: true\n") f.write("\n# This file was autogenerated, do not edit it \n\n") - f.write(%Q{require_relative "../../vendor/#{api["name"]}/lib/#{FILE_PREFIX}#{api["name"]}.rb"}) + f.write(%(require_relative "../../vendor/#{api['name']}/lib/#{FILE_PREFIX}#{api['name']}.rb")) f.write("\n\nmodule AmazonSpClients") # f.write("\n #{camel_name}Api = AmazonSpClients::Sp#{camel_name}::#{camel_name}Api") f.write("\nend") @@ -77,8 +77,8 @@ namespace :codegen do task :clean do FileUtils.rm_rf("#{TARGET_DIR}") if Dir.exist?(TARGET_DIR) # remove main gem requires - Dir.glob("./lib/amazon_sp_clients/#{FILE_PREFIX}*").each do - |file| File.delete(file) + Dir.glob("./lib/amazon_sp_clients/#{FILE_PREFIX}*").each do |file| + File.delete(file) end end end diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index 6a319b0..90abe2b 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -26,7 +26,7 @@ module AmazonSpClients REGIONS = { REGION_NA => 'sellingpartnerapi-na.amazon.com', REGION_EU => 'sellingpartnerapi-eu.amazon.com', - REGION_FE => 'sellingpartnerapi-fe.amazon.com', + REGION_FE => 'sellingpartnerapi-fe.amazon.com' }.freeze MARKETPLACE_IDS = { @@ -51,7 +51,7 @@ module AmazonSpClients # FE sg: 'A19VAU5U5O7RUS', au: 'A39IBJ37TRP1C6', - jp: 'A1VC38T7YXB528', + jp: 'A1VC38T7YXB528' }.freeze MARKETPLACE_ENDPOINT_MAP = { @@ -74,7 +74,7 @@ module AmazonSpClients 'A21TJRUUN4KGV' => 'eu', 'A19VAU5U5O7RUS' => 'fe', 'A39IBJ37TRP1C6' => 'fe', - 'A1VC38T7YXB528' => 'fe', + 'A1VC38T7YXB528' => 'fe' }.freeze class ServiceError < StandardError @@ -95,8 +95,8 @@ def self.new_migration_session AmazonSpClients::Session.new.authenticate_grantless(scope) end - def self.new_callback_session(&block) - AmazonSpClients::Session.new.with_callback(&block) + def self.new_callback_session(&) + AmazonSpClients::Session.new.with_callback(&) end def self.upload_feed_data( @@ -119,7 +119,7 @@ def self.download_report_document(doc_params) conn = Faraday.new do |c| c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } - c.response :logger, self.configure.logger, {} + c.response :logger, configure.logger, {} end conn.get(url)&.body diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 04d5669..b903dd4 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -34,8 +34,8 @@ def initialize(session, config = Configuration.default) url: @config.base_url, headers: @default_headers, request: { - timeout: @config.timeout, - }, + timeout: @config.timeout + } ) do |conn| conn.adapter Faraday::Adapter::HTTPClient @@ -75,8 +75,8 @@ def call_api(http_method, path, opts = {}) req.headers.merge!( { 'x-amz-date' => Time.now.utc.strftime('%Y%m%dT%H%M%SZ'), - 'x-amz-access-token' => access_token, - }, + 'x-amz-access-token' => access_token + } ) end @@ -86,13 +86,7 @@ def call_api(http_method, path, opts = {}) # Skipping error check and raise (use middleware for that instead) - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - - return data + (deserialize(response, opts[:return_type]) if opts[:return_type]) end # Builds the HTTP request @@ -125,7 +119,7 @@ def build_request(http_method, path, opts = {}) ssl_verifyhost: _verify_ssl_host, sslcert: @config.cert_file, sslkey: @config.key_file, - verbose: @config.debugging, + verbose: @config.debugging } # set custom cert, if provided @@ -140,7 +134,7 @@ def build_request(http_method, path, opts = {}) end # download_file(request) if opts[:return_type] == 'File' - return url, req_opts + [url, req_opts] end # Builds the HTTP request body @@ -151,17 +145,17 @@ def build_request(http_method, path, opts = {}) # @return [String] HTTP body data in the form of string def build_request_body(header_params, form_params, body) # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' + if ['application/x-www-form-urlencoded', + 'multipart/form-data'].include?(header_params['Content-Type']) data = {} form_params.each do |key, value| - case value - when ::File, ::Array, nil - # TODO: how does http lib support File and Array params? - data[key] = value - else - data[key] = value.to_s - end + data[key] = case value + when ::File, ::Array, nil + # TODO: how does http lib support File and Array params? + value + else + value.to_s + end end elsif body data = body.is_a?(String) ? body : body.to_json @@ -180,7 +174,7 @@ def build_request_body(header_params, form_params, body) # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ %r{Application\/.*json(?!p)(;.*)?}i).nil? + (mime == '*/*') || !(mime =~ %r{Application/.*json(?!p)(;.*)?}i).nil? end # Deserialize the response to the given return type. @@ -205,20 +199,18 @@ def deserialize(response, return_type) # ensuring a default content type content_type = response.headers['Content-Type'] || 'application/json' - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) begin - if body.is_a?(String) - data = JSON.parse("[#{body}]", symbolize_names: true)[0] - else - data = body - end + data = if body.is_a?(String) + JSON.parse("[#{body}]", symbolize_names: true)[0] + else + body + end rescue JSON::ParserError => e - if %w[String Date DateTime].include?(return_type) - data = body - else - raise e - end + raise e unless %w[String Date DateTime].include?(return_type) + + data = body end convert_to_type(data, return_type, response) @@ -230,6 +222,7 @@ def deserialize(response, return_type) # @return [Mixed] Data in a particular type def convert_to_type(data, return_type, response) return nil if data.nil? + case return_type when 'String' data.to_s @@ -250,11 +243,11 @@ def convert_to_type(data, return_type, response) data when /\AArray<(.+)>\z/ # e.g. Array - sub_type = $1 + sub_type = ::Regexp.last_match(1) data.map { |item| convert_to_type(item, sub_type, response) } - when /\AHash\\z/ + when /\AHash\z/ # e.g. Hash - sub_type = $1 + sub_type = ::Regexp.last_match(1) {}.tap { |hash| data.each { |k, v| hash[k] = convert_to_type(v, sub_type, response) } } else AmazonSpClients::ApiResponse.build_from_hash(data, response) @@ -263,7 +256,7 @@ def convert_to_type(data, return_type, response) def build_request_url(path) # Add leading and trailing slashes to path - path = "/#{path}".gsub(%r{\/+}, '/') + path = "/#{path}".gsub(%r{/+}, '/') @config.base_url + path end @@ -272,7 +265,7 @@ def build_request_url(path) ## @param [Hash] header_params Header parameters ## @param [Hash] query_params Query parameters ## @param [String] auth_names Authentication scheme name - #def update_params_for_auth!(header_params, query_params, auth_names) + # def update_params_for_auth!(header_params, query_params, auth_names) # Array(auth_names).each do |auth_name| # auth_setting = @config.auth_settings[auth_name] # next unless auth_setting @@ -286,7 +279,7 @@ def build_request_url(path) # 'Authentication token must be in `query` of `header`' # end # end - #end + # end # Sets user agent in HTTP header # @@ -324,12 +317,12 @@ def select_header_content_type(content_types) # @return [String] JSON string representation of the object def object_to_http_body(model) return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end + + local_body = if model.is_a?(Array) + model.map { |m| object_to_hash(m) } + else + object_to_hash(model) + end local_body.to_json end @@ -356,7 +349,7 @@ def build_collection_param(param, collection_format) # return the array directly as typhoeus will handle it as expected param else - fail "unknown collection format: #{collection_format.inspect}" + raise "unknown collection format: #{collection_format.inspect}" end end end diff --git a/lib/amazon_sp_clients/api_error.rb b/lib/amazon_sp_clients/api_error.rb index 52bc3e0..74cd711 100644 --- a/lib/amazon_sp_clients/api_error.rb +++ b/lib/amazon_sp_clients/api_error.rb @@ -14,25 +14,23 @@ class Error < Struct.new(:code, :message, :details) def initialize(errors) @errors = [] - if errors.is_a?(Hash) && errors.key?(:errors) - errors = errors[:errors] - end + errors = errors[:errors] if errors.is_a?(Hash) && errors.key?(:errors) - if errors.is_a?(Array) - @errors = - errors.map do |h| - AmazonSpClients::ApiError::Error.new( - h[:code], - h[:message], - h[:details], - ) - end - end + return unless errors.is_a?(Array) + + @errors = + errors.map do |h| + AmazonSpClients::ApiError::Error.new( + h[:code], + h[:message], + h[:details] + ) + end end def full_messages @errors.map do |err| - "#{err.code}: #{err.message}#{err.details ? ' - ' + err.details : ''}" + "#{err.code}: #{err.message}#{' - ' + err.details if err.details}" end.join(', ') end end diff --git a/lib/amazon_sp_clients/api_response.rb b/lib/amazon_sp_clients/api_response.rb index c1f0b03..1c91111 100644 --- a/lib/amazon_sp_clients/api_response.rb +++ b/lib/amazon_sp_clients/api_response.rb @@ -10,8 +10,7 @@ class ApiResponse # Some APIs move :nextToken to separate top level key :pagination attr_accessor :pagination - attr_reader :attributes - attr_reader :response + attr_reader :attributes, :response # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -19,20 +18,18 @@ def initialize(attributes = {}, response = nil) @attributes = attributes @response = response - if (!attributes.is_a?(Hash)) + unless attributes.is_a?(Hash) raise ArgumentError, 'The input argument (attributes) must be a hash in `ApiResponse` initialize method' end if attributes.key?('payload') || attributes.key?(:payload) || attributes.key?('errors') || - attributes.key?(:errors) + attributes.key?(:errors) self.payload = attributes[:payload] if attributes.key?(:errors) - self.errors = AmazonSpClients::ApiError.new(attributes.delete(:'errors')) - end - if attributes.key?(:pagination) - self.pagination = attributes[:pagination] + self.errors = AmazonSpClients::ApiError.new(attributes.delete(:errors)) end + self.pagination = attributes[:pagination] if attributes.key?(:pagination) else self.payload = attributes end diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index 4b69fa1..5ff6f30 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -128,7 +128,7 @@ def initialize @endpoint = nil @scheme = 'https' @region = 'us-east-1' - @host = "#{@sandbox_env ? 'sandbox.' : ''}#{AmazonSpClients::REGIONS.fetch(@region)}" + @host = "#{'sandbox.' if @sandbox_env}#{AmazonSpClients::REGIONS.fetch(@region)}" @base_path = '/' @timeout = 60 @client_side_validation = true @@ -156,26 +156,26 @@ def configure def scheme=(scheme) # remove :// from scheme - @scheme = scheme.sub(%r{:\/\/}, '') + @scheme = scheme.sub(%r{://}, '') end def host=(host) # remove http(s):// and anything after a slash - @host = host.sub(%r{https?:\/\/}, '').split('/').first + @host = host.sub(%r{https?://}, '').split('/').first end def host - "#{@sandbox_env ? 'sandbox.' : ''}#{AmazonSpClients::REGIONS.fetch(@region)}" + "#{'sandbox.' if @sandbox_env}#{AmazonSpClients::REGIONS.fetch(@region)}" end def base_path=(base_path) # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(%r{\/+}, '/') + @base_path = "/#{base_path}".gsub(%r{/+}, '/') @base_path = '' if @base_path == '/' end def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(%r{\/+}, '/')}".sub(%r{\/+\z}, '') + "#{scheme}://#{[host, base_path].join('/').gsub(%r{/+}, '/')}".sub(%r{/+\z}, '') end # Gets Basic Auth token string diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index fa94dd0..2e8d98c 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -10,8 +10,8 @@ module Middlewares # client or server error responses. class RaiseError < Faraday::Response::Middleware # rubocop:disable Naming/ConstantName - ClientErrorStatuses = (400...500).freeze - ServerErrorStatuses = (500...600).freeze + ClientErrorStatuses = (400...500) + ServerErrorStatuses = (500...600) # rubocop:enable Naming/ConstantName @@ -28,59 +28,59 @@ def on_complete(env) case env[:status] when 400 raise Faraday::BadRequestError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 401 raise Faraday::UnauthorizedError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 403 raise Faraday::ForbiddenError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 404 raise Faraday::ResourceNotFound.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 407 # mimic the behavior that we get with proxy requests with HTTPS msg = '407 "Proxy Authentication Required"' raise Faraday::ProxyAuthError.new(msg, response_values(env)) when 409 raise Faraday::ConflictError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 422 raise Faraday::UnprocessableEntityError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when 429 # This assumes you will handle throttling/retires yourself raise Faraday::RetriableResponse.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when ClientErrorStatuses raise Faraday::ClientError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when ServerErrorStatuses raise Faraday::ServerError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) when nil raise Faraday::NilStatusError.new( - error_message(env), - response_values(env), - ) + error_message(env), + response_values(env) + ) end end @@ -93,11 +93,11 @@ def error_message(env) case @service when :token - body = ::JSON.parse(body) if body.kind_of?(String) + body = ::JSON.parse(body) if body.is_a?(String) "Service 'token' ERR: error: #{body['error']} description: #{body['error_description']}" when :spapi - body = ::JSON.parse(body, symbolize_names: true) if body.kind_of?(String) + body = ::JSON.parse(body, symbolize_names: true) if body.is_a?(String) err = AmazonSpClients::ApiError.new(body) @@ -105,7 +105,7 @@ def error_message(env) else "the server responded with status #{env[:status]}" end - rescue => e + rescue StandardError => e "the server responded with status #{env[:status]} (#{e})" end @@ -115,7 +115,7 @@ def response_values(env) response: { status: env.status, headers: env.response_headers, - body: env.body, + body: env.body }, request: { method: env.method, @@ -123,8 +123,8 @@ def response_values(env) url: env.url, params: env.params, headers: env.request_headers, - body: env.request_body, - }, + body: env.request_body + } } end end diff --git a/lib/amazon_sp_clients/middlewares/request_signer_v4.rb b/lib/amazon_sp_clients/middlewares/request_signer_v4.rb index 78d9085..1cc9a72 100644 --- a/lib/amazon_sp_clients/middlewares/request_signer_v4.rb +++ b/lib/amazon_sp_clients/middlewares/request_signer_v4.rb @@ -21,7 +21,7 @@ def call(env) Aws::Sigv4::Signer.new( service: 'execute-api', region: @options[:region], - credentials_provider: @options[:session].credentials_provider, + credentials_provider: @options[:session].credentials_provider ) signature = @@ -29,7 +29,7 @@ def call(env) http_method: env.method.to_s.upcase!, url: env.url, headers: env.request_headers, - body: env.request_body, + body: env.request_body ) signature_headers = signature.headers diff --git a/lib/amazon_sp_clients/session.rb b/lib/amazon_sp_clients/session.rb index 724cfaf..d67043c 100644 --- a/lib/amazon_sp_clients/session.rb +++ b/lib/amazon_sp_clients/session.rb @@ -9,15 +9,16 @@ class Session RESTRICTED_OPS = { orders: { restrictedResources: [ - { method: 'GET', path: '/orders/v0/orders', dataElements: %w[buyerInfo shippingAddress] }, - ], + { method: 'GET', path: '/orders/v0/orders', dataElements: %w[buyerInfo shippingAddress] } + ] }, orders_and_items: { restrictedResources: [ { method: 'GET', path: '/orders/v0/orders', dataElements: %w[buyerInfo shippingAddress] }, - { method: "GET", path: "/orders/v0/orders/{orderId}/orderItems", dataElements: ["buyerInfo"] } - ], - }, + { method: 'GET', path: '/orders/v0/orders/{orderId}/orderItems', + dataElements: ['buyerInfo'] } + ] + } }.freeze attr_reader :access_token, :restricted_data_token, :credentials_provider @@ -43,12 +44,14 @@ def initialize(config = Configuration.default, &block) # NOTE: usually will make immediate web request def role_credentials Aws::AssumeRoleCredentials.new( - client: Aws::STS::Client.new( credentials: Aws::Credentials.new(@config.access_key, @config.secret_key), region: @config.region), + client: Aws::STS::Client.new( + credentials: Aws::Credentials.new(@config.access_key, + @config.secret_key), region: @config.region + ), role_arn: @config.role_arn, - role_session_name: 'SPAPISession', + role_session_name: 'SPAPISession' ) - - rescue => e + rescue StandardError => e raise Faraday::ForbiddenError.new(e.message, { service: 'sts', request: {}, response: {} }) end @@ -80,26 +83,24 @@ def refresh if @callback @access_token = @callback.call @access_token_expires_at = nil - else - if @grantles - authenticate_grantless(@scope) - elsif !@refresh_token.nil? - authenticate(@refresh_token) - end + elsif @grantles + authenticate_grantless(@scope) + elsif !@refresh_token.nil? + authenticate(@refresh_token) end end def ask_for_restricted_data_token(restricted_resource) @logger.debug('this request will require restricted data token') if !@restricted_data_token[restricted_resource].nil? && - !expired?(@restricted_data_token_expirest_at[restricted_resource]) + !expired?(@restricted_data_token_expirest_at[restricted_resource]) @logger.debug( - "restricted_data_token for `#{restricted_resource}` is still valid, skipping /tokes20210 request", + "restricted_data_token for `#{restricted_resource}` is still valid, skipping /tokes20210 request" ) return else @logger.debug( - "restricted_data_token for `#{restricted_resource}` is nil or stale, making /tokens2021 request", + "restricted_data_token for `#{restricted_resource}` is nil or stale, making /tokens2021 request" ) end @@ -141,11 +142,12 @@ def exchange_token_request def expired?(expires) return true if expires.nil? - if expires.is_a?(String) - expires_time = Time.strptime(expires, '%Y-%m-%dT%H:%M:%S%Z') - else - expires_time = expires - end + + expires_time = if expires.is_a?(String) + Time.strptime(expires, '%Y-%m-%dT%H:%M:%S%Z') + else + expires + end now = Time.now.utc now >= expires_time - 60 # Shorten expiration time by 60s as a safety net end diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index 5927a9e..de23cf1 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -8,7 +8,7 @@ class AuthResponse < Struct.new( :access_token, :token_type, :expires_in, - :refresh_token, + :refresh_token ) end @@ -54,14 +54,12 @@ def initialize(refresh_token = nil, config = Configuration.default) # } def exchange(grant_type = 'refresh_token', scope = nil) raise 'Invalid grant_type' unless GRANT_TYPE.include?(grant_type) - if grant_type == 'client_credentials' && scope.nil? - raise 'Grantless operations require scope' - end + raise 'Grantless operations require scope' if grant_type == 'client_credentials' && scope.nil? params = { grant_type: grant_type, client_id: @config.client_id, - client_secret: @config.client_secret, + client_secret: @config.client_secret } if grant_type == 'refresh_token' @@ -84,7 +82,7 @@ def exchange(grant_type = 'refresh_token', scope = nil) body[:access_token], body[:token_type], body[:expires_in], - body[:refresh_token], + body[:refresh_token] ) end end diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index 1e4a03f..7af1eb2 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -21,7 +21,7 @@ def initialize def upload(feed_doc, doc_content_type, payload) upload_url = feed_doc[:url] - document =payload + document = payload file = StringIO.new(document) @@ -31,8 +31,6 @@ def upload(feed_doc, doc_content_type, payload) req.body = file end end - - private end class Downloader From 09c7b7faf512885f99098deb9b951c248e3c8357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:02:44 +0200 Subject: [PATCH 07/83] Add GitHub Actions CI RSpec on Ruby 3.3 and 3.4, plus a RuboCop job. --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0603040 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + rubocop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + - run: bundle exec rubocop + + test: + strategy: + matrix: + ruby: ["3.3", "3.4"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rspec From 24697f80d948cd17ee8e6490526bb88f53ad0937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 10:02:38 +0200 Subject: [PATCH 08/83] Replace swagger-codegen with a Ruby generator Regeneration needed Java plus a working swagger-codegen install, and the Rakefile was broken in three ways (missing amzn-models checkout, undeclared active_support, undocumented fd). The new generator under lib/generator is plain Ruby + ERB with no extra dependencies, modeled on the peddler gem's generator. Reproducibility: the generator clones Amazon's official spec repo into amzn-models/ (gitignored) and checks out the exact revision recorded in selling-partner-api-models.sha. `rake generate` regenerates at that pin; `rake generate:update` is the only path that advances it. The generator emits only what actually loads: the API classes, the vendor entry files, and the sp_*.rb require shims. It reproduces the old swagger-codegen output byte for byte (except the header comment), including its quirks, so the regeneration diff stays reviewable. codegen-config.yml now lists only the 14 modules with real consumers; the 17 unused vendored modules stay untouched until the planned dead-code removal. The mustache templates and the old codegen rake tasks are gone. The generator is excluded from the shipped gem. --- .gitignore | 3 + .rubocop.yml | 1 - CHANGELOG.md | 13 + CLAUDE.md | 41 +- README.md | 26 +- Rakefile | 106 ++--- amazon_sp_clients.gemspec | 2 +- codegen-config.yml | 62 +-- codegen-templates/ruby/Gemfile.mustache | 9 - codegen-templates/ruby/README.mustache | 131 ------ codegen-templates/ruby/Rakefile.mustache | 8 - codegen-templates/ruby/api.mustache | 193 --------- codegen-templates/ruby/api_client.mustache | 385 ------------------ .../ruby/api_client_spec.mustache | 220 ---------- codegen-templates/ruby/api_doc.mustache | 81 ---- codegen-templates/ruby/api_error.mustache | 52 --- codegen-templates/ruby/api_info.mustache | 12 - codegen-templates/ruby/api_test.mustache | 49 --- codegen-templates/ruby/base_object.mustache | 118 ------ .../ruby/base_object_spec.mustache | 109 ----- codegen-templates/ruby/configuration.mustache | 231 ----------- .../ruby/configuration_spec.mustache | 36 -- codegen-templates/ruby/gem.mustache | 22 - codegen-templates/ruby/gemspec.mustache | 36 -- codegen-templates/ruby/git_push.sh.mustache | 55 --- codegen-templates/ruby/gitignore.mustache | 39 -- codegen-templates/ruby/model.mustache | 21 - codegen-templates/ruby/model_doc.mustache | 9 - codegen-templates/ruby/model_test.mustache | 48 --- .../ruby/partial_model_enum_class.mustache | 16 - .../ruby/partial_model_generic.mustache | 313 -------------- codegen-templates/ruby/rspec.mustache | 2 - codegen-templates/ruby/rubocop.mustache | 154 ------- codegen-templates/ruby/spec_helper.mustache | 103 ----- codegen-templates/ruby/version.mustache | 7 - lib/generator.rb | 52 +++ lib/generator/api_module.rb | 108 +++++ lib/generator/naming.rb | 39 ++ lib/generator/operation.rb | 250 ++++++++++++ lib/generator/param.rb | 83 ++++ lib/generator/specs.rb | 91 +++++ lib/generator/templates/api_class.erb | 22 + lib/generator/templates/operation.erb | 76 ++++ lib/generator/templates/shim.erb | 8 + lib/generator/templates/vendor_entry.erb | 14 + selling-partner-api-models.sha | 1 + 46 files changed, 850 insertions(+), 2607 deletions(-) delete mode 100644 codegen-templates/ruby/Gemfile.mustache delete mode 100644 codegen-templates/ruby/README.mustache delete mode 100644 codegen-templates/ruby/Rakefile.mustache delete mode 100644 codegen-templates/ruby/api.mustache delete mode 100644 codegen-templates/ruby/api_client.mustache delete mode 100644 codegen-templates/ruby/api_client_spec.mustache delete mode 100644 codegen-templates/ruby/api_doc.mustache delete mode 100644 codegen-templates/ruby/api_error.mustache delete mode 100644 codegen-templates/ruby/api_info.mustache delete mode 100644 codegen-templates/ruby/api_test.mustache delete mode 100644 codegen-templates/ruby/base_object.mustache delete mode 100644 codegen-templates/ruby/base_object_spec.mustache delete mode 100644 codegen-templates/ruby/configuration.mustache delete mode 100644 codegen-templates/ruby/configuration_spec.mustache delete mode 100644 codegen-templates/ruby/gem.mustache delete mode 100644 codegen-templates/ruby/gemspec.mustache delete mode 100755 codegen-templates/ruby/git_push.sh.mustache delete mode 100644 codegen-templates/ruby/gitignore.mustache delete mode 100644 codegen-templates/ruby/model.mustache delete mode 100644 codegen-templates/ruby/model_doc.mustache delete mode 100644 codegen-templates/ruby/model_test.mustache delete mode 100644 codegen-templates/ruby/partial_model_enum_class.mustache delete mode 100644 codegen-templates/ruby/partial_model_generic.mustache delete mode 100644 codegen-templates/ruby/rspec.mustache delete mode 100644 codegen-templates/ruby/rubocop.mustache delete mode 100644 codegen-templates/ruby/spec_helper.mustache delete mode 100644 codegen-templates/ruby/version.mustache create mode 100644 lib/generator.rb create mode 100644 lib/generator/api_module.rb create mode 100644 lib/generator/naming.rb create mode 100644 lib/generator/operation.rb create mode 100644 lib/generator/param.rb create mode 100644 lib/generator/specs.rb create mode 100644 lib/generator/templates/api_class.erb create mode 100644 lib/generator/templates/operation.erb create mode 100644 lib/generator/templates/shim.erb create mode 100644 lib/generator/templates/vendor_entry.erb create mode 100644 selling-partner-api-models.sha diff --git a/.gitignore b/.gitignore index 69b5d69..b165941 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ .env # rspec failure tracking .rspec_status + +# Local clone of amzn/selling-partner-api-models (managed by lib/generator) +/amzn-models/ diff --git a/.rubocop.yml b/.rubocop.yml index ee51e17..a330006 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,6 @@ AllCops: Exclude: - vendor/**/* - amzn-models/**/* - - codegen-templates/**/* - tmp/**/* - bin/**/* # Autogenerated require shims; the Rakefile writes them. diff --git a/CHANGELOG.md b/CHANGELOG.md index 061309a..fba935b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ considered breaking and do not trigger a major version bump. ### Added +- Pure-Ruby code generator (`lib/generator`, `rake generate`). It + replaces swagger-codegen, so regeneration no longer needs Java. The + Amazon spec revision is pinned in `selling-partner-api-models.sha`; + CI verifies committed output matches regeneration at that pin, and a + nightly workflow opens a PR when Amazon updates the specs. - CI on GitHub Actions: RSpec on Ruby 3.3 and 3.4, plus RuboCop. - Characterization specs that pin the current public behavior of `Configuration`, `Session`, `ApiClient`, `ApiResponse`, @@ -20,7 +25,15 @@ considered breaking and do not trigger a major version bump. ### Changed - Minimum Ruby version is 3.3 (was 2.3). +- Generated files were regenerated with the new generator. Same code, + new `Generated by:` header, and the unused commented-out model + requires are gone from the vendor entry files. +- `codegen-config.yml` now lists only the 14 API modules that have + consumers. The other 17 vendored modules stay in the repo for now + and will be deleted in a later cleanup. ### Removed - Travis CI config, `.ruby-gemset`, and the broken `.gitmodules`. +- The swagger-codegen mustache templates (`codegen-templates/`) and + the old `codegen:generate` / `codegen:clean` rake tasks. diff --git a/CLAUDE.md b/CLAUDE.md index 2b1b1c9..5601d76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,18 +2,19 @@ Unofficial Ruby gem for the Amazon Selling Partner API (SP-API), used internally at Dropstream. It is one gem that wraps many generated API -clients: hand-written core code plus SwaggerCodegen output. +clients: hand-written core code plus generated output. ## Layout - `lib/amazon_sp_clients/` — hand-written core. Edit here. - `vendor//` — generated client per API. Committed, but never edit by hand. It is overwritten on every regeneration. -- `codegen-templates/ruby/` — our modified mustache templates. To change - generated code, change a template and regenerate. +- `lib/generator/` — the code generator (pure Ruby + ERB, no Java). + Not shipped with the gem. Templates live in `lib/generator/templates/`. - `codegen-config.yml` — list of APIs to generate (name + spec path). -- `amzn-models/` — git submodule with Amazon's official specs - (github.com/amzn/selling-partner-api-models). +- `selling-partner-api-models.sha` — pinned revision of Amazon's spec + repo (github.com/amzn/selling-partner-api-models). The generator + clones it into `amzn-models/` (gitignored) and checks out this SHA. ## Core files (lib/amazon_sp_clients) @@ -33,27 +34,35 @@ clients: hand-written core code plus SwaggerCodegen output. - `middlewares/request_signer_v4.rb` — AWS SigV4 signing. - `middlewares/raise_error.rb` — turns HTTP 4xx/5xx into Faraday errors. - `sp_*.rb` — autogenerated one-line requires that point into `vendor/`. - Do not edit; the Rakefile writes them. + Do not edit; the generator writes them. -## Template changes +## Generated code contract -Our templates make the generated code use our core instead of the -standard SwaggerCodegen runtime: +The generator emits API classes matching the old swagger-codegen output: - everything lives under the `AmazonSpClients` namespace, - generated APIs take a `Session` and use `AmazonSpClients::ApiClient`, - responses default to `AmazonSpClients::ApiResponse`, - `auth_names` is reused to mark restricted (RDT) operations, -- generated `api_client`, `configuration`, docs and specs are dropped. +- only API classes and entry/require files are emitted — no models, no + per-vendor api_client/configuration (leftovers under `vendor/` from + the old generator are dead code, removed in a later cleanup). + +To change generated code, change the generator or its templates, run +`rake generate`, and review the diff. CI runs `rake generate:verify`, +which fails if committed output drifts from regeneration at the pin. ## Commands ```sh -bundle exec rspec # tests -bundle exec rake codegen:generate # regenerate vendor/ (needs swagger-codegen) -bundle exec rake codegen:clean # delete vendor/ and sp_*.rb -bin/console # irb with the gem loaded +bundle exec rspec # tests +bundle exec rubocop # lint (vendor/ and sp_*.rb excluded) +bundle exec rake generate # regenerate vendor/ at the pinned SHA +bundle exec rake generate:verify # regenerate + fail on drift (CI) +bundle exec rake generate:update # advance the pin + regenerate +bin/console # irb with the gem loaded ``` -Regeneration deletes and rewrites all of `vendor/` and all `sp_*.rb` -files. Review that diff carefully before committing. +Regeneration rewrites the generated files for every module in +`codegen-config.yml`. Review that diff carefully before committing; +advance the pin only in its own PR. diff --git a/README.md b/README.md index dcdafc2..1f925da 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,24 @@ addr_resp = ## Code generation -1. First, ensure you have **Java** (8+) installed. -2. Follow [SwaggerCodegen](https://github.com/swagger-api/swagger-codegen) installation instructions. -3. Ensure the `swagger-codegen` is working: `swagger-codegen -h`. -4. Run `rake codegen:generate`. -5. Add changes to git and move gem to next version. +The API classes under `vendor/` are generated by `lib/generator` (plain +Ruby + ERB, no external tools) from Amazon's official +[selling-partner-api-models](https://github.com/amzn/selling-partner-api-models) +specs. The generator clones that repo into `amzn-models/` (gitignored) +and checks out the exact revision pinned in +`selling-partner-api-models.sha`, so generation is reproducible. + +```sh +bundle exec rake generate # regenerate at the pinned revision +bundle exec rake generate:setup # only clone/sync the spec repo +bundle exec rake generate:verify # regenerate and fail on any drift (runs in CI) +bundle exec rake generate:update # pull latest specs, regenerate, advance the pin +``` + +Which APIs get generated is controlled by `codegen-config.yml`. To adopt +newer Amazon specs, run `rake generate:update` and review the diff — +the pin file change plus the regenerated files — in its own PR. + +Generated files carry a `Generated by: lib/generator` header. Never edit +them by hand; change the generator (or the templates in +`lib/generator/templates/`) and regenerate. diff --git a/Rakefile b/Rakefile index b63aa36..7a6b3e7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,84 +1,50 @@ +# frozen_string_literal: true + require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task default: :spec -SPECS_DIR = './amzn-models/models' -FILE_PREFIX = 'sp_' -MODULE_PREFIX = '' - -GEM_CONFIG = <<~EOF - { - "gemName": "#{FILE_PREFIX}<%= @config_vars[:gem_name] %>", - "modulename": "#{MODULE_PREFIX}<%= @config_vars[:module_name] %>", - "gemRequiredRubyVersion": ">= 2.5" - } -EOF - -TARGET_DIR = './vendor' -TEMPLATES_DIR = './codegen-templates/ruby' - -STDOUT.sync = true - -# To run this you need to have SwaggerCodegen installed and have a working -# `swagger-codegen` command. -desc 'Uses swagger codegen to generate gem for each api' -namespace :codegen do - task generate: [:clean] do - require 'active_support' - require 'erb' - require 'fileutils' - require 'yaml' - require 'tempfile' - require 'json' - - sh 'mkdir -p vendor' - yml = YAML.load_file('./codegen-config.yml') - - yml['list_of_apis'].each do |api| - camel_name = ActiveSupport::Inflector.camelize(api['name']) - @config_vars = { - module_name: camel_name, - gem_name: api['name'] - } - - # Passing options via -D{optionName}={optionValue} like in SC docs - # doesn't work, so we need to pass "real" config file: - temp = Tempfile.new(api['name']) - renderer = ERB.new(GEM_CONFIG) - temp.write(renderer.result) - temp.close - - # Main conmmand - sh "swagger-codegen generate -l ruby -t #{TEMPLATES_DIR} \ - -o '#{TARGET_DIR}/#{api['name']}' -i '#{SPECS_DIR}/#{api['path']}' \ - --config='#{temp.path}' \ - -Dmodels -DmodellDocs=false -DmodelTests=false \ - -Dapis -DapiDocs=false -DapiTests=false" +desc 'Regenerate vendor/ API clients at the pinned spec revision' +task :generate do + require_relative 'lib/generator' + Generator.generate +end - # Update main gem requires - File.open("./lib/amazon_sp_clients/#{FILE_PREFIX}#{api['name']}.rb", 'w') do |f| - f.write("# frozen_string_literal: true\n") - f.write("\n# This file was autogenerated, do not edit it \n\n") - f.write(%(require_relative "../../vendor/#{api['name']}/lib/#{FILE_PREFIX}#{api['name']}.rb")) - f.write("\n\nmodule AmazonSpClients") - # f.write("\n #{camel_name}Api = AmazonSpClients::Sp#{camel_name}::#{camel_name}Api") - f.write("\nend") - end - end +namespace :generate do + desc 'Clone/sync the Amazon spec repo at the pinned revision' + task :setup do + require_relative 'lib/generator' + Generator.setup + end - sh "fd -t d 'spec' ./vendor | xargs rm -rf" - sh "fd -t d 'docs' ./vendor | xargs rm -rf" + desc 'Pull latest Amazon specs, regenerate, and advance the pin' + task :update do + require_relative 'lib/generator' + Generator::Specs.advance! + Generator.generate end - desc "Remove generated codegen gems in #{TARGET_DIR}" - task :clean do - FileUtils.rm_rf("#{TARGET_DIR}") if Dir.exist?(TARGET_DIR) - # remove main gem requires - Dir.glob("./lib/amazon_sp_clients/#{FILE_PREFIX}*").each do |file| - File.delete(file) + desc 'Regenerate at the pinned revision; fail if committed output drifts' + task verify: :generate do + require 'open3' + require_relative 'lib/generator' + + paths = Generator.generated_paths + status_out, _err, status = Open3.capture3('git', 'status', '--porcelain', '--', *paths) + raise 'git status failed' unless status.success? + + if status_out.strip.empty? + puts "Generated output matches committed code at pinned spec #{Generator::Specs.pinned_sha}." + else + diff_out, = Open3.capture2('git', 'diff', '--', *paths) + warn 'Generated output drifted from committed code:' + warn status_out + warn diff_out + abort 'Generator verification failed: regeneration at the pinned spec changed ' \ + 'committed output. Commit the intended change or investigate the regression.' end end end diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 3b6af07..9c26b23 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features|amzn-models|codegen-templates)/}) + f.match(%r{^(test|spec|features|amzn-models)/|^lib/generator}) end end spec.bindir = 'exe' diff --git a/codegen-config.yml b/codegen-config.yml index fcc8244..c29070c 100644 --- a/codegen-config.yml +++ b/codegen-config.yml @@ -1,95 +1,47 @@ --- -# Comment out APIs you don't want to be generated (they will be deleted) +# APIs generated into vendor/ by `bundle exec rake generate`. +# Only modules with actual consumers across Dropstream are listed; +# paths are relative to amzn-models/models at the SHA pinned in +# selling-partner-api-models.sha. list_of_apis: - - name: catalog_items_2020 - path: catalog-items-api-model/catalogItems_2020-12-01.json - - - name: catalog_items_v0 - path: catalog-items-api-model/catalogItemsV0.json - - - name: fba_inbound - path: fba-inbound-eligibility-api-model/fbaInbound.json - - name: fba_inventory path: fba-inventory-api-model/fbaInventory.json - name: feeds_2021 path: feeds-api-model/feeds_2021-06-30.json - - name: fulfillment_inbound_v0 - path: fulfillment-inbound-api-model/fulfillmentInboundV0.json - - name: fulfillment_outbound_2020 path: fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json - - name: merchant_fulfillment_v0 - path: merchant-fulfillment-api-model/merchantFulfillmentV0.json - - name: listings_items_2021 path: listings-items-api-model/listingsItems_2021-08-01.json - - name: messaging - path: messaging-api-model/messaging.json - - - name: notifications - path: notifications-api-model/notifications.json - - name: orders_v0 path: orders-api-model/ordersV0.json - - name: product_fees_v0 - path: product-fees-api-model/productFeesV0.json - - - name: product_pricing_v0 - path: product-pricing-api-model/productPricingV0.json - - name: reports_2021 path: reports-api-model/reports_2021-06-30.json - - name: sales - path: sales-api-model/sales.json - - - name: sellers - path: sellers-api-model/sellers.json - - - name: services - path: services-api-model/services.json - - - name: shipping - path: shipping-api-model/shipping.json - - - name: solicitations - path: solicitations-api-model/solicitations.json - - name: tokens_2021 path: tokens-api-model/tokens_2021-03-01.json - - name: uploads_2020 - path: uploads-api-model/uploads_2020-11-01.json - - name: vdf_inventory_v1 path: vendor-direct-fulfillment-inventory-api-model/vendorDirectFulfillmentInventoryV1.json - name: vdf_orders_v1 path: vendor-direct-fulfillment-orders-api-model/vendorDirectFulfillmentOrdersV1.json - - name: vdf_payments_v1 - path: vendor-direct-fulfillment-payments-api-model/vendorDirectFulfillmentPaymentsV1.json - - name: vdf_shipping_v1 path: vendor-direct-fulfillment-shipping-api-model/vendorDirectFulfillmentShippingV1.json - - name: vdf_transactions_v1 - path: vendor-direct-fulfillment-transactions-api-model/vendorDirectFulfillmentTransactionsV1.json - - name: vendor_invoices path: vendor-invoices-api-model/vendorInvoices.json - name: vendor_orders path: vendor-orders-api-model/vendorOrders.json - - name: vendors_shipments - path: vendor-shipments-api-model/vendorShipments.json - - name: vendor_transaction_status path: vendor-transaction-status-api-model/vendorTransactionStatus.json + + - name: vendors_shipments + path: vendor-shipments-api-model/vendorShipments.json diff --git a/codegen-templates/ruby/Gemfile.mustache b/codegen-templates/ruby/Gemfile.mustache deleted file mode 100644 index c2e3127..0000000 --- a/codegen-templates/ruby/Gemfile.mustache +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/codegen-templates/ruby/README.mustache b/codegen-templates/ruby/README.mustache deleted file mode 100644 index 7da84de..0000000 --- a/codegen-templates/ruby/README.mustache +++ /dev/null @@ -1,131 +0,0 @@ -# {{gemName}} - -{{moduleName}} - the Ruby gem for the {{appName}} - -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: {{appVersion}} -- Package version: {{gemVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build {{{gemName}}}.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./{{{gemName}}}-{{{gemVersion}}}.gem -``` -(for development, run `gem install --dev ./{{{gemName}}}-{{{gemVersion}}}.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem '{{{gemName}}}', '~> {{{gemVersion}}}' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile: - - gem '{{{gemName}}}', :git => 'https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require '{{{gemName}}}' -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#hasAuthMethods}} -# Setup authorization -{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}} - # Configure HTTP basic authorization: {{{name}}} - config.username = 'YOUR USERNAME' - config.password = 'YOUR PASSWORD'{{/isBasic}}{{#isApiKey}} - # Configure API key authorization: {{{name}}} - config.api_key['{{{keyParamName}}}'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['{{{keyParamName}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} - # Configure OAuth2 access token for authorization: {{{name}}} - config.access_token = 'YOUR ACCESS TOKEN'{{/isOAuth}} -{{/authMethods}}end -{{/hasAuthMethods}} - -api_instance = {{{moduleName}}}::{{{classname}}}.new{{#hasParams}} -{{#vendorExtensions.x-codegen-hasRequiredParams}}{{#allParams}}{{#required}} -{{{paramName}}} = {{{example}}} # {{{dataType}}} | {{{description}}} -{{/required}}{{/allParams}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}} -opts = { {{#allParams}}{{^required}} - {{{paramName}}}: {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} # {{{dataType}}} | {{{description}}}{{/required}}{{/allParams}} -}{{/hasOptionalParams}}{{/hasParams}} - -begin -{{#summary}} #{{{.}}} -{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}){{/hasParams}}{{#returnType}} - p result{{/returnType}} -rescue {{{moduleName}}}::ApiError => e - puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}" -end -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation for Models - -{{#models}}{{#model}} - [{{moduleName}}::{{classname}}]({{modelDocPath}}{{classname}}.md) -{{/model}}{{/models}} - -## Documentation for Authorization - -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#each scopes}} - {{@key}}: {{this}} -{{/each}} -{{/isOAuth}} - -{{/authMethods}} diff --git a/codegen-templates/ruby/Rakefile.mustache b/codegen-templates/ruby/Rakefile.mustache deleted file mode 100644 index d52c3e3..0000000 --- a/codegen-templates/ruby/Rakefile.mustache +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/codegen-templates/ruby/api.mustache b/codegen-templates/ruby/api.mustache deleted file mode 100644 index 4a7eefb..0000000 --- a/codegen-templates/ruby/api.mustache +++ /dev/null @@ -1,193 +0,0 @@ -=begin -{{> api_info}} -=end - -module AmazonSpClients - module {{moduleName}} - {{#operations}} - class {{classname}} - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - {{#operation}} - {{#contents}} - {{#summary}} - # {{{summary}}} - {{/summary}} - {{#notes}} - # {{{notes}}} - {{/notes}} - {{#parameters}}{{#required}} # @param {{paramName}} {{description}} - {{/required}}{{/parameters}} # @param [Hash] opts the optional parameters - {{#parameters}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/required}}{{/parameters}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] - def {{operationId}}({{#parameters}}{{#required}}{{paramName}}, {{/required}}{{/parameters}}opts = {}) - {{#returnType}}data = {{/returnType}}{{operationId}}_with_http_info({{#parameters}}{{#required}}{{paramName}}, {{/required}}{{/parameters}}opts) - return {{#returnType}}data{{/returnType}}{{^returnType}}nil{{/returnType}} - end - - {{#summary}} - # {{summary}} - {{/summary}} - {{#notes}} - # {{notes}} - {{/notes}} - {{#parameters}}{{#required}} # @param {{paramName}} {{description}} - {{/required}}{{/parameters}} # @param [Hash] opts the optional parameters - {{#parameters}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}} - {{/required}}{{/parameters}} # @return [Array<({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}})>] {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers - def {{operationId}}_with_http_info({{#parameters}}{{#required}}{{paramName}}, {{/required}}{{/parameters}}opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: {{classname}}.{{operationId}} ...' - end - {{#parameters}} - {{#required}} - # verify the required parameter '{{paramName}}' is set - if @api_client.config.client_side_validation && {{{paramName}}}.nil? - fail ArgumentError, "Missing the required parameter '{{paramName}}' when calling {{classname}}.{{operationId}}" - end - {{#isEnum}} - {{^isContainer}} - # verify enum value - if @api_client.config.client_side_validation && ![{{#allowableValues}}{{#values}}'{{{this}}}'{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}].include?({{{paramName}}}) - fail ArgumentError, "invalid value for '{{{paramName}}}', must be one of {{#allowableValues}}{{#values}}{{{this}}}{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}" - end - {{/isContainer}} - {{/isEnum}} - {{/required}} - {{^required}} - {{#isEnum}} - {{#collectionFormat}} - if @api_client.config.client_side_validation && opts[:'{{{paramName}}}'] && !opts[:'{{{paramName}}}'].all? { |item| [{{#allowableValues}}{{#values}}'{{{this}}}'{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}].include?(item) } - fail ArgumentError, 'invalid value for "{{{paramName}}}", must include one of {{#allowableValues}}{{#values}}{{{this}}}{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}' - end - {{/collectionFormat}} - {{^collectionFormat}} - if @api_client.config.client_side_validation && opts[:'{{{paramName}}}'] && ![{{#allowableValues}}{{#values}}'{{{this}}}'{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}].include?(opts[:'{{{paramName}}}']) - fail ArgumentError, 'invalid value for "{{{paramName}}}", must be one of {{#allowableValues}}{{#values}}{{{this}}}{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}' - end - {{/collectionFormat}} - {{/isEnum}} - {{/required}} - {{#hasValidation}} - {{#maxLength}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length > {{{maxLength}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be smaller than or equal to {{{maxLength}}}.' - end - - {{/maxLength}} - {{#minLength}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length < {{{minLength}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be great than or equal to {{{minLength}}}.' - end - - {{/minLength}} - {{#maximum}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.' - end - - {{/maximum}} - {{#minimum}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.' - end - - {{/minimum}} - {{#pattern}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ Regexp.new({{{pattern}}}) - fail ArgumentError, "invalid value for '{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:\"{{{paramName}}}\"]{{/required}}' when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}." - end - - {{/pattern}} - {{#maxItems}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.length > {{{maxItems}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{{maxItems}}}.' - end - - {{/maxItems}} - {{#minItems}} - if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.length < {{{minItems}}} - fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{{minItems}}}.' - end - - {{/minItems}} - {{/hasValidation}} - {{/parameters}} - # resource path - local_var_path = '{{{path}}}'{{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} - - # query parameters - query_params = opts[:query_params] || {} - {{#queryParams}} - {{#required}} - query_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} - {{/required}} - {{/queryParams}} - {{#queryParams}} - {{^required}} - query_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{{paramName}}}'].nil? - {{/required}} - {{/queryParams}} - - # header parameters - header_params = opts[:header_params] || {} - {{#hasProduces}} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) - {{/hasProduces}} - {{#hasConsumes}} - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) - {{/hasConsumes}} - {{#headerParams}} - {{#required}} - header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} - {{/required}} - {{/headerParams}} - {{#headerParams}} - {{^required}} - header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{{paramName}}}'].nil? - {{/required}} - {{/headerParams}} - - # form parameters - form_params = opts[:form_params] || {} - {{#formParams}} - {{#required}} - form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} - {{/required}} - {{/formParams}} - {{#formParams}} - {{^required}} - form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{paramName}}'].nil? - {{/required}} - {{/formParams}} - - # http body (model) - post_body = opts[:body] {{#bodyParam}}|| @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}) {{/bodyParam}} - - return_type = opts[:return_type] {{#returnType}}|| 'AmazonSpClients::ApiResponse' {{/returnType}} - - auth_names = opts[:auth_names] || [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - data = @api_client.call_api(:{{httpMethod}}, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: {{classname}}#{{operationId}}\nData: #{data.inspect}" - end - return data - end - {{/contents}} - {{/operation}} - end - {{/operations}} - end -end diff --git a/codegen-templates/ruby/api_client.mustache b/codegen-templates/ruby/api_client.mustache deleted file mode 100644 index c1d037d..0000000 --- a/codegen-templates/ruby/api_client.mustache +++ /dev/null @@ -1,385 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module {{moduleName}} - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/#{VERSION}/ruby{{/httpUserAgent}}" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - {{#hasAuthMethods}} - update_params_for_auth! header_params, query_params, opts[:auth_names] - {{/hasAuthMethods}} - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - {{moduleName}}.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/codegen-templates/ruby/api_client_spec.mustache b/codegen-templates/ruby/api_client_spec.mustache deleted file mode 100644 index 5afe96e..0000000 --- a/codegen-templates/ruby/api_client_spec.mustache +++ /dev/null @@ -1,220 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'spec_helper' - -module AmazonSpClients - describe {{moduleName}}::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - {{moduleName}}.configure { |c| c.host = 'http://example.com' } - expect({{moduleName}}::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - {{moduleName}}.configure { |c| c.host = 'https://wookiee.com' } - expect({{moduleName}}::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - {{moduleName}}.configure { |c| c.host = 'hobo.com/v4' } - expect({{moduleName}}::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - {{moduleName}}.configure { |c| c.base_path = 'v4/dog' } - expect({{moduleName}}::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - {{moduleName}}.configure { |c| c.base_path = '/v4/dog' } - expect({{moduleName}}::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - {{moduleName}}.configure { |c| c.base_path = nil } - expect({{moduleName}}::Configuration.default.base_path).to eq('') - end - end - end - end - - describe 'params_encoding in #build_request' do - let(:config) { {{moduleName}}::Configuration.new } - let(:api_client) { {{moduleName}}::ApiClient.new(config) } - - it 'defaults to nil' do - expect({{moduleName}}::Configuration.default.params_encoding).to eq(nil) - expect(config.params_encoding).to eq(nil) - - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(nil) - end - - it 'can be customized' do - config.params_encoding = :multi - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(:multi) - end - end - - describe 'timeout in #build_request' do - let(:config) { {{moduleName}}::Configuration.new } - let(:api_client) { {{moduleName}}::ApiClient.new(config) } - - it 'defaults to 0' do - expect({{moduleName}}::Configuration.default.timeout).to eq(0) - expect(config.timeout).to eq(0) - - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(0) - end - - it 'can be customized' do - config.timeout = 100 - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(100) - end - end - - describe '#deserialize' do - it "handles Array" do - api_client = {{moduleName}}::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = {{moduleName}}::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) - end - - it 'handles Hash' do - api_client = {{moduleName}}::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') - end - end - - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = {{moduleName}}::ApiClient.new - # _model = {{moduleName}}::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) - end - end - - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { {{moduleName}}::ApiClient.new } - - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end - - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') - end - - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") - end - - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') - end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - end - - it 'fails for invalid collection format' do - expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') - end - end - - describe '#json_mime?' do - let(:api_client) { {{moduleName}}::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false - end - end - - describe '#select_header_accept' do - let(:api_client) { {{moduleName}}::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil - - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') - end - end - - describe '#select_header_content_type' do - let(:api_client) { {{moduleName}}::ApiClient.new } - - it 'works' do - expect(api_client.select_header_content_type(nil)).to eq('application/json') - expect(api_client.select_header_content_type([])).to eq('application/json') - - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') - end - end - - describe '#sanitize_filename' do - let(:api_client) { {{moduleName}}::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') - end - end - end -end diff --git a/codegen-templates/ruby/api_doc.mustache b/codegen-templates/ruby/api_doc.mustache deleted file mode 100644 index 074f9ca..0000000 --- a/codegen-templates/ruby/api_doc.mustache +++ /dev/null @@ -1,81 +0,0 @@ -# AmazonSpClients::{{moduleName}}::{{classname}}{{#description}} -{{description}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}{{#contents}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/contents}}{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -{{#contents}} -# **{{operationId}}** -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}{{#hasParams}}({{#parameters}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/parameters}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}){{/hasParams}} - -{{{summary}}}{{#notes}} - -{{{notes}}}{{/notes}} - -### Example -```ruby -# load the gem -require '{{{gemName}}}' -{{#hasAuthMethods}} -# setup authorization -AmazonSpClients::{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}} - # Configure HTTP basic authorization: {{{name}}} - config.username = 'YOUR USERNAME' - config.password = 'YOUR PASSWORD'{{/isBasic}}{{#isApiKey}} - # Configure API key authorization: {{{name}}} - config.api_key['{{{keyParamName}}}'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['{{{keyParamName}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} - # Configure OAuth2 access token for authorization: {{{name}}} - config.access_token = 'YOUR ACCESS TOKEN'{{/isOAuth}} -{{/authMethods}}end -{{/hasAuthMethods}} - -api_instance = AmazonSpClients::{{{moduleName}}}::{{{classname}}}.new{{#hasParams}} -{{#vendorExtensions.x-codegen-hasRequiredParams}}{{#parameters}}{{#required}} -{{{paramName}}} = {{{example}}} # {{{dataType}}} | {{{description}}} -{{/required}}{{/parameters}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}} -opts = { {{#parameters}}{{^required}} - {{{paramName}}}: {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} # {{{dataType}}} | {{{description}}}{{/required}}{{/parameters}} -}{{/hasOptionalParams}}{{/hasParams}} - -begin -{{#summary}} #{{{.}}} -{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#parameters}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/parameters}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}){{/hasParams}}{{#returnType}} - p result{{/returnType}} -rescue AmazonSpClients::{{{moduleName}}}::ApiError => e - puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}" -end -``` - -### Parameters -{{^parameters}}This endpoint does not need any parameter.{{/parameters}}{{#parameters}}{{#@last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/@last}}{{/parameters}} -{{#parameters}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} -{{/parameters}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}nil (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^@last}}, {{/@last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} - - - -{{/contents}} -{{/operation}} -{{/operations}} diff --git a/codegen-templates/ruby/api_error.mustache b/codegen-templates/ruby/api_error.mustache deleted file mode 100644 index ff4936a..0000000 --- a/codegen-templates/ruby/api_error.mustache +++ /dev/null @@ -1,52 +0,0 @@ -=begin -{{> api_info}} -=end - -module AmazonSpClients - module {{moduleName}} - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/codegen-templates/ruby/api_info.mustache b/codegen-templates/ruby/api_info.mustache deleted file mode 100644 index d308d75..0000000 --- a/codegen-templates/ruby/api_info.mustache +++ /dev/null @@ -1,12 +0,0 @@ -{{#appName}} -#{{{appName}}} - -{{/appName}} -{{#appDescription}} -#{{{appDescription}}} - -{{/appDescription}} -{{#version}}OpenAPI spec version: {{version}}{{/version}} -{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: {{{generatorVersion}}} diff --git a/codegen-templates/ruby/api_test.mustache b/codegen-templates/ruby/api_test.mustache deleted file mode 100644 index dbfea41..0000000 --- a/codegen-templates/ruby/api_test.mustache +++ /dev/null @@ -1,49 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'spec_helper' -require 'json' - -# Unit tests for AmazonSpClients::{{moduleName}}::{{classname}} -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -{{#operations}}describe '{{classname}}' do - before do - # run before each test - @instance = AmazonSpClients::{{moduleName}}::{{classname}}.new - end - - after do - # run after each test - end - - describe 'test an instance of {{classname}}' do - it 'should create an instance of {{classname}}' do - expect(@instance).to be_instance_of(AmazonSpClients::{{moduleName}}::{{classname}}) - end - end - -{{#operation}} -{{#contents}} - # unit tests for {{operationId}} - {{#summary}} - # {{summary}} - {{/summary}} - {{#notes}} - # {{notes}} - {{/notes}} -{{#parameters}}{{#required}} # @param {{paramName}} {{description}} -{{/required}}{{/parameters}} # @param [Hash] opts the optional parameters -{{#parameters}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}} -{{/required}}{{/parameters}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] - describe '{{operationId}} test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -{{/contents}} -{{/operation}} -end -{{/operations}} diff --git a/codegen-templates/ruby/base_object.mustache b/codegen-templates/ruby/base_object.mustache deleted file mode 100644 index 2845327..0000000 --- a/codegen-templates/ruby/base_object.mustache +++ /dev/null @@ -1,118 +0,0 @@ - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - {{#parent}} - super(attributes) - {{/parent}} - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::{{moduleName}}.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end diff --git a/codegen-templates/ruby/base_object_spec.mustache b/codegen-templates/ruby/base_object_spec.mustache deleted file mode 100644 index 7376cd1..0000000 --- a/codegen-templates/ruby/base_object_spec.mustache +++ /dev/null @@ -1,109 +0,0 @@ -require 'spec_helper' - -class ArrayMapObject < Petstore::Category - attr_accessor :int_arr, :pet_arr, :int_map, :pet_map, :int_arr_map, :pet_arr_map, :boolean_true_arr, :boolean_false_arr - - def self.attribute_map - { - :int_arr => :int_arr, - :pet_arr => :pet_arr, - :int_map => :int_map, - :pet_map => :pet_map, - :int_arr_map => :int_arr_map, - :pet_arr_map => :pet_arr_map, - :boolean_true_arr => :boolean_true_arr, - :boolean_false_arr => :boolean_false_arr, - } - end - - def self.swagger_types - { - :int_arr => :'Array', - :pet_arr => :'Array', - :int_map => :'Hash', - :pet_map => :'Hash', - :int_arr_map => :'Hash>', - :pet_arr_map => :'Hash>', - :boolean_true_arr => :'Array', - :boolean_false_arr => :'Array', - } - end -end - -describe 'BaseObject' do - describe 'boolean values' do - let(:obj) { Petstore::Cat.new({declawed: false}) } - - it 'should have values set' do - expect(obj.declawed).not_to be_nil - expect(obj.declawed).to eq(false) - end - end - - describe 'array and map properties' do - let(:obj) { ArrayMapObject.new } - - let(:data) do - {int_arr: [123, 456], - pet_arr: [{name: 'Kitty'}], - int_map: {'int' => 123}, - pet_map: {'pet' => {name: 'Kitty'}}, - int_arr_map: {'int_arr' => [123, 456]}, - pet_arr_map: {'pet_arr' => [{name: 'Kitty'}]}, - boolean_true_arr: [true, "true", "TruE", 1, "y", "yes", "1", "t", "T"], - boolean_false_arr: [false, "", 0, "0", "f", nil, "null"], - } - end - - it 'works for #build_from_hash' do - obj.build_from_hash(data) - - expect(obj.int_arr).to match_array([123, 456]) - - expect(obj.pet_arr).to be_instance_of(Array) - expect(obj.pet_arr).to be_instance_of(1) - - pet = obj.pet_arr.first - expect(pet).to be_instance_of(Petstore::Pet) - expect(pet.name).to eq('Kitty') - - expect(obj.int_map).to be_instance_of(Hash) - expect(obj.int_map).to eq({'int' => 123}) - - expect(obj.pet_map).to be_instance_of(Hash) - pet = obj.pet_map['pet'] - expect(pet).to be_instance_of(Petstore::Pet) - expect(pet.name).to eq('Kitty') - - expect(obj.int_arr_map).to be_instance_of(Hash) - arr = obj.int_arr_map['int_arr'] - expect(arr).to match_array([123, 456]) - - expect(obj.pet_arr_map).to be_instance_of(Hash) - arr = obj.pet_arr_map['pet_arr'] - expect(arr).to be_instance_of(Array) - expect(arr.size).to eq(1) - pet = arr.first - expect(pet).to be_instance_of(Petstore::Pet) - expect(pet.name).to eq('Kitty') - - expect(obj.boolean_true_arr).to be_instance_of(Array) - obj.boolean_true_arr.each do |b| - expect(b).to eq(true) - end - - expect(obj.boolean_false_arr).to be_instance_of(Array) - obj.boolean_false_arr.each do |b| - expect(b).to eq(false) - end - end - - it 'works for #to_hash' do - obj.build_from_hash(data) - expect_data = data.dup - expect_data[:boolean_true_arr].map! {true} - expect_data[:boolean_false_arr].map! {false} - expect(obj.to_hash).to eq(expect_data) - end - end -end diff --git a/codegen-templates/ruby/configuration.mustache b/codegen-templates/ruby/configuration.mustache deleted file mode 100644 index 48e8766..0000000 --- a/codegen-templates/ruby/configuration.mustache +++ /dev/null @@ -1,231 +0,0 @@ -=begin -{{> api_info}} -=end - -module AmazonSpClients - module {{moduleName}} - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = '{{scheme}}' - @host = '{{host}}' - @base_path = '{{basePath}}' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - {{#authMethods}} - {{#isApiKey}} - '{{name}}' => - { - type: 'api_key', - in: {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, - key: '{{keyParamName}}', - value: api_key_with_prefix('{{keyParamName}}') - }, - {{/isApiKey}} - {{#isBasic}} - '{{name}}' => - { - type: 'basic', - in: 'header', - key: 'Authorization', - value: basic_auth_token - }, - {{/isBasic}} - {{#isBearer}} - '{{name}}' => - { - type: 'bearer', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - {{/isBearer}} - {{#isOAuth}} - '{{name}}' => - { - type: 'oauth2', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - {{/isOAuth}} - {{/authMethods}} - } - end - end - end -end diff --git a/codegen-templates/ruby/configuration_spec.mustache b/codegen-templates/ruby/configuration_spec.mustache deleted file mode 100644 index 18b6800..0000000 --- a/codegen-templates/ruby/configuration_spec.mustache +++ /dev/null @@ -1,36 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'spec_helper' - -module AmazonSpClients - describe {{moduleName}}::Configuration do - let(:config) { {{moduleName}}::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("{{{basePath}}}") - # {{moduleName}}.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("{{{basePath}}}") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("{{{basePath}}}") - end - end - end - end -end diff --git a/codegen-templates/ruby/gem.mustache b/codegen-templates/ruby/gem.mustache deleted file mode 100644 index 2c70830..0000000 --- a/codegen-templates/ruby/gem.mustache +++ /dev/null @@ -1,22 +0,0 @@ -=begin -{{> api_info}} -=end - -# # Common files -# require '{{gemName}}/api_client' -# require '{{gemName}}/api_error' -# require '{{gemName}}/version' -# require '{{gemName}}/configuration' - -# Models -# {{#models}} -# {{#model}} -# require_relative './{{gemName}}/{{modelPackage}}/{{classFilename}}'{{/model}} -# {{/models}} - -# APIs -{{#apiInfo}} -{{#apis}} -require_relative './{{importPath}}' -{{/apis}} -{{/apiInfo}} diff --git a/codegen-templates/ruby/gemspec.mustache b/codegen-templates/ruby/gemspec.mustache deleted file mode 100644 index db76e13..0000000 --- a/codegen-templates/ruby/gemspec.mustache +++ /dev/null @@ -1,36 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -{{> api_info}} -=end - -$:.push File.expand_path("../lib", __FILE__) -require "{{gemName}}/version" - -Gem::Specification.new do |s| - s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}" - s.version = {{moduleName}}::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["{{gemAuthor}}{{^gemAuthor}}Swagger-Codegen{{/gemAuthor}}"] - s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"] - s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://github.com/swagger-api/swagger-codegen{{/gemHomepage}}" - s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}" - s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}}" - {{#gemLicense}} - s.license = '{{{gemLicense}}}' - {{/gemLicense}} - {{^gemLicense}} - s.license = "Unlicense" - {{/gemLicense}} - s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/codegen-templates/ruby/git_push.sh.mustache b/codegen-templates/ruby/git_push.sh.mustache deleted file mode 100755 index 6285565..0000000 --- a/codegen-templates/ruby/git_push.sh.mustache +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/codegen-templates/ruby/gitignore.mustache b/codegen-templates/ruby/gitignore.mustache deleted file mode 100644 index c021594..0000000 --- a/codegen-templates/ruby/gitignore.mustache +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/codegen-templates/ruby/model.mustache b/codegen-templates/ruby/model.mustache deleted file mode 100644 index cc405f2..0000000 --- a/codegen-templates/ruby/model.mustache +++ /dev/null @@ -1,21 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'date' - -module AmazonSpClients - module {{moduleName}} - {{#models}} - {{#model}} - {{#isEnum}} - {{>partial_model_enum_class}} - {{/isEnum}} - {{^isEnum}} - {{>partial_model_generic}} - {{/isEnum}} - {{/model}} - {{/models}} - - end -end diff --git a/codegen-templates/ruby/model_doc.mustache b/codegen-templates/ruby/model_doc.mustache deleted file mode 100644 index 00befad..0000000 --- a/codegen-templates/ruby/model_doc.mustache +++ /dev/null @@ -1,9 +0,0 @@ -{{#models}}{{#model}}# {{moduleName}}::{{classname}} - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} -{{/vars}} - -{{/model}}{{/models}} diff --git a/codegen-templates/ruby/model_test.mustache b/codegen-templates/ruby/model_test.mustache deleted file mode 100644 index 707a30d..0000000 --- a/codegen-templates/ruby/model_test.mustache +++ /dev/null @@ -1,48 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for AmazonSpClients::{{moduleName}}::{{classname}} -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -{{#models}} -{{#model}} -describe '{{classname}}' do - before do - # run before each test - @instance = AmazonSpClients::{{moduleName}}::{{classname}}.new - end - - after do - # run after each test - end - - describe 'test an instance of {{classname}}' do - it 'should create an instance of {{classname}}' do - expect(@instance).to be_instance_of(AmazonSpClients::{{moduleName}}::{{classname}}) - end - end -{{#vars}} - describe 'test attribute "{{{name}}}"' do - it 'should work' do - {{#isEnum}} - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}]) - # validator.allowable_values.each do |value| - # expect { @instance.{{name}} = value }.not_to raise_error - # end - {{/isEnum}} - {{^isEnum}} - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - {{/isEnum}} - end - end - -{{/vars}} -end -{{/model}} -{{/models}} diff --git a/codegen-templates/ruby/partial_model_enum_class.mustache b/codegen-templates/ruby/partial_model_enum_class.mustache deleted file mode 100644 index 1667785..0000000 --- a/codegen-templates/ruby/partial_model_enum_class.mustache +++ /dev/null @@ -1,16 +0,0 @@ - class {{classname}} - {{#allowableValues}} - {{#enumVars}} - {{{name}}} = {{{value}}}.freeze - {{/enumVars}} - {{/allowableValues}} - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = {{classname}}.constants.select { |c| {{classname}}::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #{{{classname}}}" if constantValues.empty? - value - end - end \ No newline at end of file diff --git a/codegen-templates/ruby/partial_model_generic.mustache b/codegen-templates/ruby/partial_model_generic.mustache deleted file mode 100644 index 1e04b52..0000000 --- a/codegen-templates/ruby/partial_model_generic.mustache +++ /dev/null @@ -1,313 +0,0 @@ - {{#description}} - # {{{description}}} - {{/description}} - class {{classname}} - {{#vars}} - {{#description}} - # {{{description}}} - {{/description}} - attr_accessor :{{{name}}} - - {{/vars}} -{{#hasEnums}} - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - -{{/hasEnums}} - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - {{#vars}} - :'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}} - {{/vars}} - } - end - - # Attribute type mapping. - def self.openapi_types - { - {{#vars}} - :'{{{name}}}' => :'{{{dataType}}}'{{#hasMore}},{{/hasMore}} - {{/vars}} - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - {{#vars}} - {{#isNullable}} - :'{{{name}}}'{{#hasMore}},{{/hasMore}} - {{/isNullable}} - {{/vars}} - ]) - end - - {{#discriminator}} - {{#propertyName}} - # discriminator's property name in OpenAPI v3 - def self.openapi_discriminator_name - :'{{{.}}}' - end - - {{/propertyName}} - {{/discriminator}} - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::{{{moduleName}}}::{{{classname}}}` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::{{{moduleName}}}::{{{classname}}}`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - {{#parent}} - - # call parent's initialize - super(attributes) - {{/parent}} - {{#vars}} - - if attributes.key?(:'{{{name}}}') - {{#isListContainer}} - if (value = attributes[:'{{{name}}}']).is_a?(Array) - self.{{{name}}} = value - end - {{/isListContainer}} - {{#isMapContainer}} - if (value = attributes[:'{{{name}}}']).is_a?(Hash) - self.{{{name}}} = value - end - {{/isMapContainer}} - {{^isContainer}} - self.{{{name}}} = attributes[:'{{{name}}}'] - {{/isContainer}} - {{#defaultValue}} - else - self.{{{name}}} = {{{defaultValue}}} - {{/defaultValue}} - end - {{/vars}} - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = {{^parent}}Array.new{{/parent}}{{#parent}}super{{/parent}} - {{#vars}} - {{#required}} - if @{{{name}}}.nil? - invalid_properties.push('invalid value for "{{{name}}}", {{{name}}} cannot be nil.') - end - - {{/required}} - {{#hasValidation}} - {{#maxLength}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}} - invalid_properties.push('invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.') - end - - {{/maxLength}} - {{#minLength}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}} - invalid_properties.push('invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.') - end - - {{/minLength}} - {{#maximum}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}} - invalid_properties.push('invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.') - end - - {{/maximum}} - {{#minimum}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}} - invalid_properties.push('invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.') - end - - {{/minimum}} - {{#pattern}} - pattern = Regexp.new({{{pattern}}}) - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ pattern - invalid_properties.push("invalid value for \"{{{name}}}\", must conform to the pattern #{pattern}.") - end - - {{/pattern}} - {{#maxItems}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}} - invalid_properties.push('invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.' - end - - {{/maxItems}} - {{#minItems}} - if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}} - invalid_properties.push('invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.' - end - - {{/minItems}} - {{/hasValidation}} - {{/vars}} - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - {{#vars}} - {{#required}} - return false if @{{{name}}}.nil? - {{/required}} - {{#isEnum}} - {{^isContainer}} - {{{name}}}_validator = EnumAttributeValidator.new('{{{dataType}}}', [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^@last}}, {{/@last}}{{/enumVars}}{{/allowableValues}}]) - return false unless {{{name}}}_validator.valid?(@{{{name}}}) - {{/isContainer}} - {{/isEnum}} - {{#hasValidation}} - {{#maxLength}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}} - {{/maxLength}} - {{#minLength}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}} - {{/minLength}} - {{#maximum}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}} - {{/maximum}} - {{#minimum}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}} - {{/minimum}} - {{#pattern}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}}) - {{/pattern}} - {{#maxItems}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}} - {{/maxItems}} - {{#minItems}} - return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}} - {{/minItems}} - {{/hasValidation}} - {{/vars}} - true - end - - {{#vars}} - {{#isEnum}} - {{^isContainer}} - # Custom attribute writer method checking allowed values (enum). - # @param [Object] {{{name}}} Object to be assigned - def {{{name}}}=({{{name}}}) - validator = EnumAttributeValidator.new('{{{dataType}}}', [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^@last}}, {{/@last}}{{/enumVars}}{{/allowableValues}}]) - unless validator.valid?({{{name}}}) - fail ArgumentError, "invalid value for \"{{{name}}}\", must be one of #{validator.allowable_values}." - end - @{{{name}}} = {{{name}}} - end - - {{/isContainer}} - {{/isEnum}} - {{^isEnum}} - {{#hasValidation}} - # Custom attribute writer method with validation - # @param [Object] {{{name}}} Value to be assigned - def {{{name}}}=({{{name}}}) - {{#required}} - if {{{name}}}.nil? - fail ArgumentError, '{{{name}}} cannot be nil' - end - - {{/required}} - {{#maxLength}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length > {{{maxLength}}} - fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.' - end - - {{/maxLength}} - {{#minLength}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length < {{{minLength}}} - fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.' - end - - {{/minLength}} - {{#maximum}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}} - fail ArgumentError, 'invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.' - end - - {{/maximum}} - {{#minimum}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}} - fail ArgumentError, 'invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.' - end - - {{/minimum}} - {{#pattern}} - pattern = Regexp.new({{{pattern}}}) - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} !~ pattern - fail ArgumentError, "invalid value for \"{{{name}}}\", must conform to the pattern #{pattern}." - end - - {{/pattern}} - {{#maxItems}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.length > {{{maxItems}}} - fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.' - end - - {{/maxItems}} - {{#minItems}} - if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.length < {{{minItems}}} - fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.' - end - - {{/minItems}} - @{{{name}}} = {{{name}}} - end - - {{/hasValidation}} - {{/isEnum}} - {{/vars}} - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class{{#vars}} && - {{name}} == o.{{name}}{{/vars}}{{#parent}} && super(o){{/parent}} - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [{{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}].hash - end - -{{> base_object}} - end diff --git a/codegen-templates/ruby/rspec.mustache b/codegen-templates/ruby/rspec.mustache deleted file mode 100644 index 83e16f8..0000000 --- a/codegen-templates/ruby/rspec.mustache +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/codegen-templates/ruby/rubocop.mustache b/codegen-templates/ruby/rubocop.mustache deleted file mode 100644 index 19a777e..0000000 --- a/codegen-templates/ruby/rubocop.mustache +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/codegen-templates/ruby/spec_helper.mustache b/codegen-templates/ruby/spec_helper.mustache deleted file mode 100644 index 8f4bb75..0000000 --- a/codegen-templates/ruby/spec_helper.mustache +++ /dev/null @@ -1,103 +0,0 @@ -=begin -{{> api_info}} -=end - -# load the gem -require '{{{gemName}}}' - -# The following was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/codegen-templates/ruby/version.mustache b/codegen-templates/ruby/version.mustache deleted file mode 100644 index 3ed97bc..0000000 --- a/codegen-templates/ruby/version.mustache +++ /dev/null @@ -1,7 +0,0 @@ -=begin -{{> api_info}} -=end - -module {{moduleName}} - VERSION = '{{gemVersion}}' -end diff --git a/lib/generator.rb b/lib/generator.rb new file mode 100644 index 0000000..a51df47 --- /dev/null +++ b/lib/generator.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require 'logger' +require 'yaml' + +# Regenerates the committed API clients under vendor/ from Amazon's +# OpenAPI specs, checked out at the revision pinned in +# selling-partner-api-models.sha. Pure Ruby + ERB; no Java. +# +# Not shipped with the gem. Entry points are the rake tasks: +# `generate`, `generate:setup`, `generate:update`, `generate:verify`. +module Generator + BASE_PATH = File.expand_path('..', __dir__) + CONFIG_FILE = File.join(BASE_PATH, 'codegen-config.yml') + + require_relative 'generator/specs' + require_relative 'generator/api_module' + + class << self + def logger + @logger ||= Logger.new($stdout, level: :info) + end + + def setup + Specs.sync(ref: Specs.pinned_sha) + end + + def generate + setup + api_modules.each(&:generate) + logger.info("Generated #{api_modules.size} API modules") + end + + # Paths the generator owns; `rake generate:verify` checks that + # regeneration leaves them identical to the committed tree. + def generated_paths + api_modules.flat_map(&:owned_paths) + end + + def api_modules + @api_modules ||= config.fetch('list_of_apis').map do |entry| + ApiModule.new(name: entry.fetch('name'), spec_path: entry.fetch('path')) + end + end + + private + + def config + YAML.load_file(CONFIG_FILE) + end + end +end diff --git a/lib/generator/api_module.rb b/lib/generator/api_module.rb new file mode 100644 index 0000000..579bc55 --- /dev/null +++ b/lib/generator/api_module.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +require 'erb' +require 'fileutils' +require 'json' + +require_relative 'naming' +require_relative 'operation' +require_relative 'specs' + +module Generator + # One entry from codegen-config.yml: a vendored API module generated + # from one Amazon OpenAPI spec file. Owns three kinds of files: + # + # vendor//lib/sp_.rb entry file (requires the APIs) + # vendor//lib/sp_/api/*.rb one class per spec tag + # lib/amazon_sp_clients/sp_.rb require shim for the main gem + class ApiModule + attr_reader :name, :spec_path + + def initialize(name:, spec_path:) + @name = name + @spec_path = spec_path + end + + def gem_name = "sp_#{name}" + def module_name = "Sp#{Naming.camelize(name)}" + + def generate + FileUtils.rm_rf(api_dir) + FileUtils.mkdir_p(api_dir) + + classes.each do |class_name, ops| + locals = header_locals.merge( + module_name: module_name, + class_name: class_name, + operations: ops.map(&:render).join + ) + File.write(File.join(api_dir, "#{Naming.underscore(class_name)}.rb"), + render('api_class.erb', locals)) + end + + File.write(entry_path, render('vendor_entry.erb', + header_locals.merge(api_requires: api_requires))) + File.write(shim_path, render('shim.erb', name: name, gem_name: gem_name)) + + Generator.logger.info("Generated #{name} (#{classes.size} classes)") + end + + # Relative paths checked by `rake generate:verify`. + def owned_paths + [entry_path, api_dir, shim_path].map { |p| p.delete_prefix("#{BASE_PATH}/") } + end + + private + + def spec + @spec ||= JSON.parse(File.read(File.join(Specs.models_dir, spec_path))) + end + + # Operations grouped into classes by their first tag (first-seen tag + # order), sorted by method name inside each class - both matching + # what swagger-codegen used to emit. + def classes + @classes ||= begin + seen = {} + grouped = {} + spec.fetch('paths').each do |path, verbs| + verbs.each do |verb, op| + next unless Operation::HTTP_VERBS.include?(verb) + + op_id = op.fetch('operationId') + raise "Duplicate operationId #{op_id} in #{spec_path}" if seen[op_id] + + seen[op_id] = true + class_name = "#{Naming.camelize(op.fetch('tags').fetch(0))}Api" + (grouped[class_name] ||= []) << + Operation.new(class_name: class_name, path: path, verb: verb, spec: op, root: spec) + end + end + grouped.transform_values { |ops| ops.sort_by(&:method_name) } + end + end + + def api_requires + classes.keys.map { |class_name| "#{gem_name}/api/#{Naming.underscore(class_name)}" }.sort + end + + def header_locals + info = spec.fetch('info') + { + title: info.fetch('title'), + description: Naming.flatten(info['description']), + version: info.fetch('version') + } + end + + def render(template_name, locals) + template = File.read(File.join(__dir__, 'templates', template_name)) + ERB.new(template, trim_mode: '-').result_with_hash(locals) + end + + def vendor_lib = File.join(BASE_PATH, 'vendor', name, 'lib') + def api_dir = File.join(vendor_lib, gem_name, 'api') + def entry_path = File.join(vendor_lib, "#{gem_name}.rb") + def shim_path = File.join(BASE_PATH, 'lib', 'amazon_sp_clients', "#{gem_name}.rb") + end +end diff --git a/lib/generator/naming.rb b/lib/generator/naming.rb new file mode 100644 index 0000000..e6118d6 --- /dev/null +++ b/lib/generator/naming.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Generator + # String transforms matching swagger-codegen's, so regenerated files + # stay diffable against the previously committed output. + module Naming + # Handlebars-style HTML escaping; swagger-codegen 3 rendered doc + # comments through handlebars-java, which escapes this exact set. + ESCAPES = { + '&' => '&', '<' => '<', '>' => '>', + '"' => '"', "'" => ''', '`' => '`', '=' => '=' + }.freeze + + module_function + + # 'orders_v0' => 'OrdersV0'; 'vendorShipping' => 'VendorShipping' + def camelize(str) + str.split(/[^a-zA-Z0-9]+/).reject(&:empty?).map { |w| w[0].upcase + w[1..] }.join + end + + # 'OrdersV0Api' => 'orders_v0_api'; 'NextToken' => 'next_token' + def underscore(str) + str.gsub(/[^a-zA-Z0-9]+/, '_') + .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') + .gsub(/([a-z\d])([A-Z])/, '\1_\2') + .downcase + end + + def escape(str) + str.to_s.gsub(/[&<>"'`=]/, ESCAPES) + end + + # Doc text handling copied from swagger-codegen's escapeText: every + # newline becomes a space, and double quotes get a backslash. + def flatten(str) + str.to_s.tr("\n", ' ').gsub('"', '\"') + end + end +end diff --git a/lib/generator/operation.rb b/lib/generator/operation.rb new file mode 100644 index 0000000..55e06dc --- /dev/null +++ b/lib/generator/operation.rb @@ -0,0 +1,250 @@ +# frozen_string_literal: true + +require 'erb' + +require_relative 'naming' +require_relative 'param' + +module Generator + # One API operation. Renders the convenience method plus the + # `_with_http_info` variant through templates/operation.erb, matching + # the layout swagger-codegen used to emit. + class Operation + HTTP_VERBS = %w[get put post delete patch head options].freeze + INDENT = ' ' + + attr_reader :class_name, :method_name, :http_method + + def self.template + @template ||= ERB.new( + File.read(File.join(__dir__, 'templates', 'operation.erb')), trim_mode: '-' + ) + end + + def initialize(class_name:, path:, verb:, spec:, root:) + @class_name = class_name + @path = path + @verb = verb + @spec = spec + @root = root + @method_name = Naming.underscore(spec.fetch('operationId')) + @http_method = verb.upcase + end + + def render + self.class.template.result(binding) + end + + private + + def params + @params ||= (@spec['parameters'] || []).map { |p| Param.new(p) } + end + + def body_param = params.find(&:body?) + + # swagger-codegen keeps spec order for body-less operations, but for + # operations with a body it regroups: body first, then query, path + # and header parameters (spec order inside each group). + def ordered_params + return params unless body_param + + groups = params.group_by(&:location) + [body_param, *groups['query'], *groups['path'], *groups['header']] + end + + # Required parameters before optional ones, order otherwise kept. + def signature_params = ordered_params.select(&:required?) + def optional_params = ordered_params.reject(&:required?) + def all_params = signature_params + optional_params + + def sig_args + signature_params.map { |p| "#{p.name}, " }.join + end + + def summary = presence(Naming.flatten(@spec['summary'])) + def notes = presence(Naming.flatten(@spec['description'])) + def escaped_summary = Naming.escape(summary) + def escaped_notes = Naming.escape(notes) + + # Only scalar params got a "(default to x)" doc suffix; array + # defaults were dropped by swagger-codegen. + def default_suffix(param) + return '' if param.array? || param.default_value.nil? + + " (default to #{param.default_value})" + end + + # -- return type ------------------------------------------------------ + + def response_schema + @spec.fetch('responses').each do |code, resp| + return resp['schema'] if code.match?(/\A2\d\d\z/) && resp['schema'] + end + nil + end + + def return_type? = !response_schema.nil? + + def return_doc + return 'nil' unless return_type? + + ref = response_schema['$ref'] + raise "Unsupported inline response schema in #{class_name}.#{method_name}" unless ref + + ref.split('/').last + end + + # -- request building pieces ----------------------------------------- + + def path_expr + subs = params.select { |p| p.location == 'path' }.map do |p| + ".sub('{' + '#{p.base_name}' + '}', #{p.name}.to_s)" + end + "'#{@path}'#{subs.join}" + end + + def query_assign_lines + req, opt = params.select { |p| p.location == 'query' }.partition(&:required?) + lines = req.map { |p| "#{INDENT}query_params[:'#{p.base_name}'] = #{value_expr(p)}\n" } + lines += opt.map do |p| + "#{INDENT}query_params[:'#{p.base_name}'] = #{value_expr(p)} if !opts[:'#{p.name}'].nil?\n" + end + lines.join + end + + def header_assign_lines + lines = [] + if produces.any? + lines << "#{INDENT}# HTTP header 'Accept' (if needed)\n" + lines << "#{INDENT}header_params['Accept'] = " \ + "@api_client.select_header_accept([#{quoted_list(produces)}])\n" + end + if body_param + lines << "#{INDENT}# HTTP header 'Content-Type'\n" + lines << "#{INDENT}header_params['Content-Type'] = " \ + "@api_client.select_header_content_type([#{quoted_list(consumes)}])\n" + end + req, opt = params.select { |p| p.location == 'header' }.partition(&:required?) + lines += req.map { |p| "#{INDENT}header_params[:'#{p.base_name}'] = #{value_expr(p)}\n" } + lines += opt.map do |p| + "#{INDENT}header_params[:'#{p.base_name}'] = #{value_expr(p)} if !opts[:'#{p.name}'].nil?\n" + end + lines.join + end + + def body_suffix + return '' unless body_param + + arg = body_param.required? ? 'body' : "opts[:'body']" + "|| @api_client.object_to_http_body(#{arg}) " + end + + def return_type_suffix + return_type? ? "|| 'AmazonSpClients::ApiResponse' " : '' + end + + # Accept mirrors the operation's (or spec's) `produces`, plus any + # response `examples` keys: the swagger 2->3 converter treated those + # keys as media types, and the old output kept them (e.g. 'payload'). + # Content-Type is emitted only for operations that take a body. + def produces + base = @spec['produces'] || @root['produces'] || [] + example_keys = @spec.fetch('responses').values.flat_map { |r| (r['examples'] || {}).keys } + base + example_keys.uniq.reject { |k| base.include?(k) } + end + + def consumes = @spec['consumes'] || @root['consumes'] || ['application/json'] + + # -- client-side validation guards ------------------------------------ + + def guard_lines + all_params.map { |p| param_guards(p) }.join + end + + # swagger-codegen 3 never emitted length/bounds/pattern guards for + # these specs, so neither do we - only nil and enum checks. + def param_guards(param) + out = +'' + out << required_guard(param) if param.required? + out << enum_guard(param) + out + end + + def required_guard(param) + n = param.name + indent(<<~RUBY) + # verify the required parameter '#{n}' is set + if @api_client.config.client_side_validation && #{n}.nil? + fail ArgumentError, "Missing the required parameter '#{n}' when calling #{class_name}.#{method_name}" + end + RUBY + end + + def enum_guard(param) + values = param.enum_values + return '' if values.nil? || values.empty? + + if param.required? + # containers get no enum check in the required branch + param.array? ? '' : required_enum_guard(param, values) + elsif param.array? + optional_enum_list_guard(param, values) + else + optional_enum_guard(param, values) + end + end + + def required_enum_guard(param, values) + indent(<<~RUBY) + # verify enum value + if @api_client.config.client_side_validation && !#{quoted_array(values)}.include?(#{param.name}) + fail ArgumentError, "invalid value for '#{param.name}', must be one of #{values.join(', ')}" + end + RUBY + end + + def optional_enum_list_guard(param, values) + n = param.name + indent(<<~RUBY) + if @api_client.config.client_side_validation && opts[:'#{n}'] && !opts[:'#{n}'].all? { |item| #{quoted_array(values)}.include?(item) } + fail ArgumentError, 'invalid value for "#{n}", must include one of #{values.join(', ')}' + end + RUBY + end + + def optional_enum_guard(param, values) + n = param.name + indent(<<~RUBY) + if @api_client.config.client_side_validation && opts[:'#{n}'] && !#{quoted_array(values)}.include?(opts[:'#{n}']) + fail ArgumentError, 'invalid value for "#{n}", must be one of #{values.join(', ')}' + end + RUBY + end + + # -- small helpers ----------------------------------------------------- + + def value_expr(param) + source = param.required? ? param.name : "opts[:'#{param.name}']" + return source unless param.collection_format + + "@api_client.build_collection_param(#{source}, :#{param.collection_format})" + end + + def quoted_list(values) + values.map { |v| "'#{v}'" }.join(', ') + end + + def quoted_array(values) + "[#{quoted_list(values)}]" + end + + def indent(text) + text.gsub(/^(?!$)/, INDENT) + end + + def presence(str) + str && !str.empty? ? str : nil + end + end +end diff --git a/lib/generator/param.rb b/lib/generator/param.rb new file mode 100644 index 0000000..96a8409 --- /dev/null +++ b/lib/generator/param.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require_relative 'naming' + +module Generator + # One operation parameter from a Swagger 2.0 spec, exposed the way the + # templates need it (snake_case name, doc type, enum values, ...). + class Param + COLLECTION_FORMATS = %w[csv ssv tsv pipes multi].freeze + + def initialize(spec) + @spec = spec + validate! + end + + def location = @spec.fetch('in') + def body? = location == 'body' + def required? = @spec['required'] == true + def base_name = @spec.fetch('name') + + # swagger-codegen names every body parameter 'body', whatever the + # spec calls it. + def name + body? ? 'body' : Naming.underscore(base_name) + end + + def description = Naming.flatten(@spec['description']) + def escaped_description = Naming.escape(description) + def default_value = @spec['default'] + + def array? = @spec['type'] == 'array' + + def collection_format + return nil unless array? + + @spec['collectionFormat'] || 'csv' + end + + def enum_values + array? ? @spec.dig('items', 'enum') : @spec['enum'] + end + + def doc_type + return ref_name(@spec['schema']) if body? + return "Array<#{primitive_type(@spec.fetch('items'))}>" if array? + + primitive_type(@spec) + end + + private + + # Fail loudly on spec constructs the generator does not understand, + # instead of silently emitting wrong code. + def validate! + raise "Unsupported $ref parameter: #{@spec.inspect}" if @spec.key?('$ref') + raise "Unsupported formData parameter: #{base_name}" if location == 'formData' + + cf = @spec['collectionFormat'] + return if cf.nil? || COLLECTION_FORMATS.include?(cf) + + raise "Unknown collectionFormat #{cf} for #{base_name}" + end + + def primitive_type(spec) + case spec['type'] + when 'string' + { 'date-time' => 'DateTime', 'date' => 'Date' }.fetch(spec['format'], 'String') + when 'integer' then 'Integer' + when 'boolean' then 'BOOLEAN' + when 'number' then 'Float' + else + raise "Unsupported parameter type #{spec['type'].inspect} for #{base_name}" + end + end + + def ref_name(schema) + ref = schema && schema['$ref'] + raise "Body parameter #{base_name} has no $ref schema" unless ref + + ref.split('/').last + end + end +end diff --git a/lib/generator/specs.rb b/lib/generator/specs.rb new file mode 100644 index 0000000..796572c --- /dev/null +++ b/lib/generator/specs.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require 'fileutils' +require 'open3' + +module Generator + # Manages the local checkout of Amazon's selling-partner-api-models repo. + # + # Generation is reproducible: `sync(ref:)` checks out an exact revision + # (the pinned SHA for `generate`/`verify`). `advance!` is the only path + # that moves the pin forward, used by `rake generate:update`. + class Specs + REPO_URL = 'https://github.com/amzn/selling-partner-api-models.git' + + class << self + # Ensure the local clone exists and is checked out at +ref+. + def sync(ref:) + ensure_clone! + fetch! + checkout!(ref) + Generator.logger.info("Synced API models to #{ref}") + end + + # Pull the latest upstream default branch, point the pin at it, and + # return the resolved SHA. Caller is responsible for regenerating. + def advance! + ensure_clone! + fetch! + checkout!('origin/HEAD') + sha = resolve_head + write_pin(sha) + Generator.logger.info("Advanced API models pin to #{sha}") + sha + end + + def pinned_sha + File.read(pin_file).strip + end + + def pin_file + File.join(BASE_PATH, 'selling-partner-api-models.sha') + end + + def directory + File.join(BASE_PATH, 'amzn-models') + end + + def models_dir + File.join(directory, 'models') + end + + private + + def ensure_clone! + FileUtils.rm_rf(directory) if Dir.exist?(directory) && Dir.empty?(directory) + return if Dir.exist?(directory) + + Generator.logger.info('Cloning Amazon Selling Partner API models') + run!('git', 'clone', '--quiet', '--filter=blob:none', REPO_URL, directory) + end + + def fetch! + run!('git', '-C', directory, 'fetch', '--quiet', 'origin') + end + + def checkout!(ref) + run!('git', '-C', directory, '-c', 'advice.detachedHead=false', + 'checkout', '--quiet', ref) + end + + def resolve_head + stdout, stderr, status = Open3.capture3('git', '-C', directory, 'rev-parse', 'HEAD') + raise "Failed to resolve API models HEAD: #{stderr}" unless status.success? + + stdout.strip + end + + def run!(*argv) + _stdout, stderr, status = Open3.capture3(*argv) + raise "Command failed (#{argv.join(' ')}): #{stderr}" unless status.success? + end + + # Atomic: write to a sibling temp file, then rename into place. + def write_pin(sha) + tmp = "#{pin_file}.tmp" + File.write(tmp, "#{sha}\n") + File.rename(tmp, pin_file) + end + end + end +end diff --git a/lib/generator/templates/api_class.erb b/lib/generator/templates/api_class.erb new file mode 100644 index 0000000..68deee9 --- /dev/null +++ b/lib/generator/templates/api_class.erb @@ -0,0 +1,22 @@ +=begin +#<%= title %> + +#<%= description %> + +OpenAPI spec version: <%= version %> + +Generated by: lib/generator (bundle exec rake generate) +=end + +module AmazonSpClients + module <%= module_name %> + class <%= class_name %> + attr_accessor :api_client + + def initialize(session) + @api_client = AmazonSpClients::ApiClient.new(session) + end +<%= operations -%> + end + end +end diff --git a/lib/generator/templates/operation.erb b/lib/generator/templates/operation.erb new file mode 100644 index 0000000..d3f464d --- /dev/null +++ b/lib/generator/templates/operation.erb @@ -0,0 +1,76 @@ +<%- if summary -%> + # <%= summary %> +<%- end -%> +<%- if notes -%> + # <%= notes %> +<%- end -%> +<%- signature_params.each do |p| -%> + # @param <%= p.name %> <%= p.escaped_description %> +<%- end -%> + # @param [Hash] opts the optional parameters +<%- optional_params.each do |p| -%> + # @option opts [<%= p.doc_type %>] :<%= p.name %> <%= p.escaped_description %><%= default_suffix(p) %> +<%- end -%> + # @return [<%= return_doc %>] + def <%= method_name %>(<%= sig_args %>opts = {}) +<%- if return_type? -%> + data = <%= method_name %>_with_http_info(<%= sig_args %>opts) + return data +<%- else -%> + <%= method_name %>_with_http_info(<%= sig_args %>opts) + return nil +<%- end -%> + end + +<%- if summary -%> + # <%= escaped_summary %> +<%- end -%> +<%- if notes -%> + # <%= escaped_notes %> +<%- end -%> +<%- signature_params.each do |p| -%> + # @param <%= p.name %> <%= p.escaped_description %> +<%- end -%> + # @param [Hash] opts the optional parameters +<%- optional_params.each do |p| -%> + # @option opts [<%= p.doc_type %>] :<%= p.name %> <%= p.escaped_description %> +<%- end -%> + # @return [Array<(<%= return_doc %>)>] <%= return_doc %><%= ' data' if return_type? %>, response status code and response headers + def <%= method_name %>_with_http_info(<%= sig_args %>opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: <%= class_name %>.<%= method_name %> ...' + end +<%= guard_lines -%> + # resource path + local_var_path = <%= path_expr %> + + # query parameters + query_params = opts[:query_params] || {} +<%= query_assign_lines -%> + + # header parameters + header_params = opts[:header_params] || {} +<%= header_assign_lines -%> + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] <%= body_suffix %> + + return_type = opts[:return_type] <%= return_type_suffix %> + + auth_names = opts[:auth_names] || [] + data = @api_client.call_api(:<%= http_method %>, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type) + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: <%= class_name %>#<%= method_name %>\nData: #{data.inspect}" + end + return data + end diff --git a/lib/generator/templates/shim.erb b/lib/generator/templates/shim.erb new file mode 100644 index 0000000..7777a75 --- /dev/null +++ b/lib/generator/templates/shim.erb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# This file was autogenerated, do not edit it + +require_relative "../../vendor/<%= name %>/lib/<%= gem_name %>.rb" + +module AmazonSpClients +end diff --git a/lib/generator/templates/vendor_entry.erb b/lib/generator/templates/vendor_entry.erb new file mode 100644 index 0000000..998d0fb --- /dev/null +++ b/lib/generator/templates/vendor_entry.erb @@ -0,0 +1,14 @@ +=begin +#<%= title %> + +#<%= description %> + +OpenAPI spec version: <%= version %> + +Generated by: lib/generator (bundle exec rake generate) +=end + +# APIs +<%- api_requires.each do |path| -%> +require_relative './<%= path %>' +<%- end -%> diff --git a/selling-partner-api-models.sha b/selling-partner-api-models.sha new file mode 100644 index 0000000..db0c3a2 --- /dev/null +++ b/selling-partner-api-models.sha @@ -0,0 +1 @@ +3822f167b9625e0a12a3f3794a77ede7bb507cac From 74fc3c2e59c5257a8af1a4474db902365b4c83cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 10:02:38 +0200 Subject: [PATCH 09/83] Regenerate vendor clients with the new generator Output of `bundle exec rake generate` at the pinned spec revision (3822f16, 2025-02-26, the newest commit before the previous regeneration date). The API classes are unchanged except the header comment. The vendor entry files lose the commented-out model requires, and the shims lose a trailing space and gain a final newline. --- lib/amazon_sp_clients/sp_fba_inventory.rb | 4 +- lib/amazon_sp_clients/sp_feeds_2021.rb | 4 +- .../sp_fulfillment_outbound_2020.rb | 4 +- .../sp_listings_items_2021.rb | 4 +- lib/amazon_sp_clients/sp_orders_v0.rb | 4 +- lib/amazon_sp_clients/sp_reports_2021.rb | 4 +- lib/amazon_sp_clients/sp_tokens_2021.rb | 4 +- lib/amazon_sp_clients/sp_vdf_inventory_v1.rb | 4 +- lib/amazon_sp_clients/sp_vdf_orders_v1.rb | 4 +- lib/amazon_sp_clients/sp_vdf_shipping_v1.rb | 4 +- lib/amazon_sp_clients/sp_vendor_invoices.rb | 4 +- lib/amazon_sp_clients/sp_vendor_orders.rb | 4 +- .../sp_vendor_transaction_status.rb | 4 +- lib/amazon_sp_clients/sp_vendors_shipments.rb | 4 +- vendor/fba_inventory/lib/sp_fba_inventory.rb | 72 +--- .../sp_fba_inventory/api/fba_inventory_api.rb | 3 +- vendor/feeds_2021/lib/sp_feeds_2021.rb | 45 +-- .../lib/sp_feeds_2021/api/feeds_api.rb | 3 +- .../lib/sp_fulfillment_outbound_2020.rb | 369 +----------------- .../api/fba_outbound_api.rb | 3 +- .../lib/sp_listings_items_2021.rb | 114 +----- .../api/listings_api.rb | 3 +- vendor/orders_v0/lib/sp_orders_v0.rb | 267 +------------ .../lib/sp_orders_v0/api/orders_v0_api.rb | 3 +- .../lib/sp_orders_v0/api/shipment_api.rb | 3 +- vendor/reports_2021/lib/sp_reports_2021.rb | 51 +-- .../lib/sp_reports_2021/api/reports_api.rb | 3 +- vendor/tokens_2021/lib/sp_tokens_2021.rb | 27 +- .../lib/sp_tokens_2021/api/tokens_api.rb | 3 +- .../lib/sp_vdf_inventory_v1.rb | 39 +- .../api/update_inventory_api.rb | 3 +- vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb | 99 +---- .../sp_vdf_orders_v1/api/vendor_orders_api.rb | 3 +- .../vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb | 129 +----- .../api/customer_invoices_api.rb | 3 +- .../api/vendor_shipping_api.rb | 3 +- .../api/vendor_shipping_labels_api.rb | 3 +- .../vendor_invoices/lib/sp_vendor_invoices.rb | 78 +--- .../api/vendor_payments_api.rb | 3 +- vendor/vendor_orders/lib/sp_vendor_orders.rb | 111 +----- .../sp_vendor_orders/api/vendor_orders_api.rb | 3 +- .../lib/sp_vendor_transaction_status.rb | 27 +- .../api/vendor_transaction_api.rb | 3 +- .../lib/sp_vendors_shipments.rb | 180 +-------- .../api/vendor_shipping_api.rb | 3 +- 45 files changed, 59 insertions(+), 1656 deletions(-) diff --git a/lib/amazon_sp_clients/sp_fba_inventory.rb b/lib/amazon_sp_clients/sp_fba_inventory.rb index 2858ecd..31b5307 100644 --- a/lib/amazon_sp_clients/sp_fba_inventory.rb +++ b/lib/amazon_sp_clients/sp_fba_inventory.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/fba_inventory/lib/sp_fba_inventory.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_feeds_2021.rb b/lib/amazon_sp_clients/sp_feeds_2021.rb index e3dc2f6..91f5dc6 100644 --- a/lib/amazon_sp_clients/sp_feeds_2021.rb +++ b/lib/amazon_sp_clients/sp_feeds_2021.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/feeds_2021/lib/sp_feeds_2021.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb b/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb index 4e2fdab..be472c4 100644 --- a/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb +++ b/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_listings_items_2021.rb b/lib/amazon_sp_clients/sp_listings_items_2021.rb index aa29d9b..d67f819 100644 --- a/lib/amazon_sp_clients/sp_listings_items_2021.rb +++ b/lib/amazon_sp_clients/sp_listings_items_2021.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/listings_items_2021/lib/sp_listings_items_2021.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_orders_v0.rb b/lib/amazon_sp_clients/sp_orders_v0.rb index 9d034c3..53ceb9d 100644 --- a/lib/amazon_sp_clients/sp_orders_v0.rb +++ b/lib/amazon_sp_clients/sp_orders_v0.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/orders_v0/lib/sp_orders_v0.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_reports_2021.rb b/lib/amazon_sp_clients/sp_reports_2021.rb index 1e4b625..21d9ca1 100644 --- a/lib/amazon_sp_clients/sp_reports_2021.rb +++ b/lib/amazon_sp_clients/sp_reports_2021.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/reports_2021/lib/sp_reports_2021.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_tokens_2021.rb b/lib/amazon_sp_clients/sp_tokens_2021.rb index a3e781c..312f4f4 100644 --- a/lib/amazon_sp_clients/sp_tokens_2021.rb +++ b/lib/amazon_sp_clients/sp_tokens_2021.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/tokens_2021/lib/sp_tokens_2021.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb b/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb index 5724b73..11bb39a 100644 --- a/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb +++ b/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vdf_orders_v1.rb b/lib/amazon_sp_clients/sp_vdf_orders_v1.rb index fc98f12..361b11a 100644 --- a/lib/amazon_sp_clients/sp_vdf_orders_v1.rb +++ b/lib/amazon_sp_clients/sp_vdf_orders_v1.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb b/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb index 6bf77ed..219234a 100644 --- a/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb +++ b/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vendor_invoices.rb b/lib/amazon_sp_clients/sp_vendor_invoices.rb index 7d5f8ac..928af88 100644 --- a/lib/amazon_sp_clients/sp_vendor_invoices.rb +++ b/lib/amazon_sp_clients/sp_vendor_invoices.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vendor_invoices/lib/sp_vendor_invoices.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vendor_orders.rb b/lib/amazon_sp_clients/sp_vendor_orders.rb index 3bdf346..819c539 100644 --- a/lib/amazon_sp_clients/sp_vendor_orders.rb +++ b/lib/amazon_sp_clients/sp_vendor_orders.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vendor_orders/lib/sp_vendor_orders.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vendor_transaction_status.rb b/lib/amazon_sp_clients/sp_vendor_transaction_status.rb index 4a140d3..a190c1f 100644 --- a/lib/amazon_sp_clients/sp_vendor_transaction_status.rb +++ b/lib/amazon_sp_clients/sp_vendor_transaction_status.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/lib/amazon_sp_clients/sp_vendors_shipments.rb b/lib/amazon_sp_clients/sp_vendors_shipments.rb index d2d6659..35ab3d9 100644 --- a/lib/amazon_sp_clients/sp_vendors_shipments.rb +++ b/lib/amazon_sp_clients/sp_vendors_shipments.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# This file was autogenerated, do not edit it +# This file was autogenerated, do not edit it require_relative "../../vendor/vendors_shipments/lib/sp_vendors_shipments.rb" module AmazonSpClients -end \ No newline at end of file +end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory.rb b/vendor/fba_inventory/lib/sp_fba_inventory.rb index d16f1fb..77f00fd 100644 --- a/vendor/fba_inventory/lib/sp_fba_inventory.rb +++ b/vendor/fba_inventory/lib/sp_fba_inventory.rb @@ -5,78 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_fba_inventory/api_client' -# require 'sp_fba_inventory/api_error' -# require 'sp_fba_inventory/version' -# require 'sp_fba_inventory/configuration' - -# Models -# -# -# require_relative './sp_fba_inventory/models/add_inventory_request' -# -# -# require_relative './sp_fba_inventory/models/add_inventory_response' -# -# -# require_relative './sp_fba_inventory/models/create_inventory_item_request' -# -# -# require_relative './sp_fba_inventory/models/create_inventory_item_response' -# -# -# require_relative './sp_fba_inventory/models/delete_inventory_item_response' -# -# -# require_relative './sp_fba_inventory/models/error' -# -# -# require_relative './sp_fba_inventory/models/error_list' -# -# -# require_relative './sp_fba_inventory/models/get_inventory_summaries_response' -# -# -# require_relative './sp_fba_inventory/models/get_inventory_summaries_result' -# -# -# require_relative './sp_fba_inventory/models/granularity' -# -# -# require_relative './sp_fba_inventory/models/inventory_details' -# -# -# require_relative './sp_fba_inventory/models/inventory_item' -# -# -# require_relative './sp_fba_inventory/models/inventory_items' -# -# -# require_relative './sp_fba_inventory/models/inventory_summaries' -# -# -# require_relative './sp_fba_inventory/models/inventory_summary' -# -# -# require_relative './sp_fba_inventory/models/pagination' -# -# -# require_relative './sp_fba_inventory/models/researching_quantity' -# -# -# require_relative './sp_fba_inventory/models/researching_quantity_entry' -# -# -# require_relative './sp_fba_inventory/models/reserved_quantity' -# -# -# require_relative './sp_fba_inventory/models/unfulfillable_quantity' -# - # APIs require_relative './sp_fba_inventory/api/fba_inventory_api' diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb b/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb index c4cf5a0..80ba498 100644 --- a/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb +++ b/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/feeds_2021/lib/sp_feeds_2021.rb b/vendor/feeds_2021/lib/sp_feeds_2021.rb index 4271ed8..4d35f45 100644 --- a/vendor/feeds_2021/lib/sp_feeds_2021.rb +++ b/vendor/feeds_2021/lib/sp_feeds_2021.rb @@ -5,51 +5,8 @@ OpenAPI spec version: 2021-06-30 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_feeds_2021/api_client' -# require 'sp_feeds_2021/api_error' -# require 'sp_feeds_2021/version' -# require 'sp_feeds_2021/configuration' - -# Models -# -# -# require_relative './sp_feeds_2021/models/create_feed_document_response' -# -# -# require_relative './sp_feeds_2021/models/create_feed_document_specification' -# -# -# require_relative './sp_feeds_2021/models/create_feed_response' -# -# -# require_relative './sp_feeds_2021/models/create_feed_specification' -# -# -# require_relative './sp_feeds_2021/models/error' -# -# -# require_relative './sp_feeds_2021/models/error_list' -# -# -# require_relative './sp_feeds_2021/models/feed' -# -# -# require_relative './sp_feeds_2021/models/feed_document' -# -# -# require_relative './sp_feeds_2021/models/feed_list' -# -# -# require_relative './sp_feeds_2021/models/feed_options' -# -# -# require_relative './sp_feeds_2021/models/get_feeds_response' -# - # APIs require_relative './sp_feeds_2021/api/feeds_api' diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb b/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb index 968354e..ba08cf1 100644 --- a/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb +++ b/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: 2021-06-30 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb index 6a86f6a..b2ddaaf 100644 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb +++ b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb @@ -5,375 +5,8 @@ OpenAPI spec version: 2020-07-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_fulfillment_outbound_2020/api_client' -# require 'sp_fulfillment_outbound_2020/api_error' -# require 'sp_fulfillment_outbound_2020/version' -# require 'sp_fulfillment_outbound_2020/configuration' - -# Models -# -# -# require_relative './sp_fulfillment_outbound_2020/models/additional_location_info' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/address' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/amount' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/cod_settings' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/cancel_fulfillment_order_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_order_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_order_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_order_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_order_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_return_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_return_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_fulfillment_return_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_return_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/create_return_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/current_status' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/date_range' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/decimal' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_document' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_document_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_information' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_message' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_offer' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_offers_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_policy' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_preferences' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_window' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/delivery_window_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/destination' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/drop_off_location' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/error' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/error_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/event_code' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/feature' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/feature_settings' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/feature_sku' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/features' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fee' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fee_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_action' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_order' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_order_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_order_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_order_status' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_policy' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_return_item_status' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment_package' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/fulfillment_shipment_package_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_delivery_offers_product' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_delivery_offers_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_delivery_offers_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_delivery_offers_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_delivery_offers_terms' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_feature_inventory_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_feature_inventory_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_feature_sku_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_feature_sku_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_features_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_features_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_order_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_order_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_preview_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_preview_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_fulfillment_preview_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/get_package_tracking_details_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/invalid_item_reason' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/invalid_item_reason_code' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/invalid_return_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/invalid_return_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/ip_address' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/list_return_reason_codes_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/list_return_reason_codes_result' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/locker_details' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/money' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/notification_email_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/origin' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/package_tracking_details' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/payment_information' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/payment_information_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/product_identifier' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/quantity' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/reason_code_details' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/reason_code_details_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/return_authorization' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/return_authorization_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/return_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/return_item_disposition' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/return_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/scheduled_delivery_info' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/shipping_speed_category' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/shipping_speed_category_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/string_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/timestamp' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/tracking_address' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/tracking_event' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/tracking_event_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/unfulfillable_preview_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/unfulfillable_preview_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/update_fulfillment_order_item' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/update_fulfillment_order_item_list' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/update_fulfillment_order_request' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/update_fulfillment_order_response' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/variable_precision_address' -# -# -# require_relative './sp_fulfillment_outbound_2020/models/weight' -# - # APIs require_relative './sp_fulfillment_outbound_2020/api/fba_outbound_api' diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb index 9ddfd57..e0f6f95 100644 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb +++ b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: 2020-07-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021.rb index 5a21aa3..b477df9 100644 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021.rb +++ b/vendor/listings_items_2021/lib/sp_listings_items_2021.rb @@ -5,120 +5,8 @@ OpenAPI spec version: 2021-08-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_listings_items_2021/api_client' -# require 'sp_listings_items_2021/api_error' -# require 'sp_listings_items_2021/version' -# require 'sp_listings_items_2021/configuration' - -# Models -# -# -# require_relative './sp_listings_items_2021/models/audience' -# -# -# require_relative './sp_listings_items_2021/models/decimal' -# -# -# require_relative './sp_listings_items_2021/models/error' -# -# -# require_relative './sp_listings_items_2021/models/error_list' -# -# -# require_relative './sp_listings_items_2021/models/fulfillment_availability' -# -# -# require_relative './sp_listings_items_2021/models/issue' -# -# -# require_relative './sp_listings_items_2021/models/issue_enforcement_action' -# -# -# require_relative './sp_listings_items_2021/models/issue_enforcements' -# -# -# require_relative './sp_listings_items_2021/models/issue_exemption' -# -# -# require_relative './sp_listings_items_2021/models/item' -# -# -# require_relative './sp_listings_items_2021/models/item_attributes' -# -# -# require_relative './sp_listings_items_2021/models/item_identifiers' -# -# -# require_relative './sp_listings_items_2021/models/item_identifiers_by_marketplace' -# -# -# require_relative './sp_listings_items_2021/models/item_image' -# -# -# require_relative './sp_listings_items_2021/models/item_issues' -# -# -# require_relative './sp_listings_items_2021/models/item_offer_by_marketplace' -# -# -# require_relative './sp_listings_items_2021/models/item_offers' -# -# -# require_relative './sp_listings_items_2021/models/item_procurement' -# -# -# require_relative './sp_listings_items_2021/models/item_product_type_by_marketplace' -# -# -# require_relative './sp_listings_items_2021/models/item_product_types' -# -# -# require_relative './sp_listings_items_2021/models/item_relationship' -# -# -# require_relative './sp_listings_items_2021/models/item_relationships' -# -# -# require_relative './sp_listings_items_2021/models/item_relationships_by_marketplace' -# -# -# require_relative './sp_listings_items_2021/models/item_search_results' -# -# -# require_relative './sp_listings_items_2021/models/item_summaries' -# -# -# require_relative './sp_listings_items_2021/models/item_summary_by_marketplace' -# -# -# require_relative './sp_listings_items_2021/models/item_variation_theme' -# -# -# require_relative './sp_listings_items_2021/models/listings_item_patch_request' -# -# -# require_relative './sp_listings_items_2021/models/listings_item_put_request' -# -# -# require_relative './sp_listings_items_2021/models/listings_item_submission_response' -# -# -# require_relative './sp_listings_items_2021/models/money' -# -# -# require_relative './sp_listings_items_2021/models/pagination' -# -# -# require_relative './sp_listings_items_2021/models/patch_operation' -# -# -# require_relative './sp_listings_items_2021/models/points' -# - # APIs require_relative './sp_listings_items_2021/api/listings_api' diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb index 03bfff2..ed82ac9 100644 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb +++ b/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: 2021-08-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/orders_v0/lib/sp_orders_v0.rb b/vendor/orders_v0/lib/sp_orders_v0.rb index ea4056e..e4b4608 100644 --- a/vendor/orders_v0/lib/sp_orders_v0.rb +++ b/vendor/orders_v0/lib/sp_orders_v0.rb @@ -5,274 +5,9 @@ OpenAPI spec version: v0 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_orders_v0/api_client' -# require 'sp_orders_v0/api_error' -# require 'sp_orders_v0/version' -# require 'sp_orders_v0/configuration' - -# Models -# -# -# require_relative './sp_orders_v0/models/address' -# -# -# require_relative './sp_orders_v0/models/address_extended_fields' -# -# -# require_relative './sp_orders_v0/models/amazon_programs' -# -# -# require_relative './sp_orders_v0/models/associated_item' -# -# -# require_relative './sp_orders_v0/models/association_type' -# -# -# require_relative './sp_orders_v0/models/automated_shipping_settings' -# -# -# require_relative './sp_orders_v0/models/business_hours' -# -# -# require_relative './sp_orders_v0/models/buyer_customized_info_detail' -# -# -# require_relative './sp_orders_v0/models/buyer_info' -# -# -# require_relative './sp_orders_v0/models/buyer_requested_cancel' -# -# -# require_relative './sp_orders_v0/models/buyer_tax_info' -# -# -# require_relative './sp_orders_v0/models/buyer_tax_information' -# -# -# require_relative './sp_orders_v0/models/confirm_shipment_error_response' -# -# -# require_relative './sp_orders_v0/models/confirm_shipment_order_item' -# -# -# require_relative './sp_orders_v0/models/confirm_shipment_order_items_list' -# -# -# require_relative './sp_orders_v0/models/confirm_shipment_request' -# -# -# require_relative './sp_orders_v0/models/constraint_type' -# -# -# require_relative './sp_orders_v0/models/delivery_preferences' -# -# -# require_relative './sp_orders_v0/models/easy_ship_shipment_status' -# -# -# require_relative './sp_orders_v0/models/electronic_invoice_status' -# -# -# require_relative './sp_orders_v0/models/error' -# -# -# require_relative './sp_orders_v0/models/error_list' -# -# -# require_relative './sp_orders_v0/models/exception_dates' -# -# -# require_relative './sp_orders_v0/models/export_info' -# -# -# require_relative './sp_orders_v0/models/fulfillment_instruction' -# -# -# require_relative './sp_orders_v0/models/get_order_address_response' -# -# -# require_relative './sp_orders_v0/models/get_order_buyer_info_response' -# -# -# require_relative './sp_orders_v0/models/get_order_items_buyer_info_response' -# -# -# require_relative './sp_orders_v0/models/get_order_items_response' -# -# -# require_relative './sp_orders_v0/models/get_order_regulated_info_response' -# -# -# require_relative './sp_orders_v0/models/get_order_response' -# -# -# require_relative './sp_orders_v0/models/get_orders_response' -# -# -# require_relative './sp_orders_v0/models/item_buyer_info' -# -# -# require_relative './sp_orders_v0/models/marketplace_id' -# -# -# require_relative './sp_orders_v0/models/marketplace_tax_info' -# -# -# require_relative './sp_orders_v0/models/measurement' -# -# -# require_relative './sp_orders_v0/models/money' -# -# -# require_relative './sp_orders_v0/models/open_interval' -# -# -# require_relative './sp_orders_v0/models/open_time_interval' -# -# -# require_relative './sp_orders_v0/models/order' -# -# -# require_relative './sp_orders_v0/models/order_address' -# -# -# require_relative './sp_orders_v0/models/order_buyer_info' -# -# -# require_relative './sp_orders_v0/models/order_item' -# -# -# require_relative './sp_orders_v0/models/order_item_buyer_info' -# -# -# require_relative './sp_orders_v0/models/order_item_buyer_info_list' -# -# -# require_relative './sp_orders_v0/models/order_item_list' -# -# -# require_relative './sp_orders_v0/models/order_items' -# -# -# require_relative './sp_orders_v0/models/order_items_buyer_info_list' -# -# -# require_relative './sp_orders_v0/models/order_items_inner' -# -# -# require_relative './sp_orders_v0/models/order_items_list' -# -# -# require_relative './sp_orders_v0/models/order_list' -# -# -# require_relative './sp_orders_v0/models/order_regulated_info' -# -# -# require_relative './sp_orders_v0/models/orders_list' -# -# -# require_relative './sp_orders_v0/models/other_delivery_attributes' -# -# -# require_relative './sp_orders_v0/models/package_detail' -# -# -# require_relative './sp_orders_v0/models/package_reference_id' -# -# -# require_relative './sp_orders_v0/models/payment_execution_detail_item' -# -# -# require_relative './sp_orders_v0/models/payment_execution_detail_item_list' -# -# -# require_relative './sp_orders_v0/models/payment_method_detail_item_list' -# -# -# require_relative './sp_orders_v0/models/points_granted_detail' -# -# -# require_relative './sp_orders_v0/models/preferred_delivery_time' -# -# -# require_relative './sp_orders_v0/models/prescription_detail' -# -# -# require_relative './sp_orders_v0/models/product_info_detail' -# -# -# require_relative './sp_orders_v0/models/promotion_id_list' -# -# -# require_relative './sp_orders_v0/models/regulated_information' -# -# -# require_relative './sp_orders_v0/models/regulated_information_field' -# -# -# require_relative './sp_orders_v0/models/regulated_order_verification_status' -# -# -# require_relative './sp_orders_v0/models/rejection_reason' -# -# -# require_relative './sp_orders_v0/models/shipment_status' -# -# -# require_relative './sp_orders_v0/models/shipping_constraints' -# -# -# require_relative './sp_orders_v0/models/substitution_option' -# -# -# require_relative './sp_orders_v0/models/substitution_option_list' -# -# -# require_relative './sp_orders_v0/models/substitution_preferences' -# -# -# require_relative './sp_orders_v0/models/tax_classification' -# -# -# require_relative './sp_orders_v0/models/tax_collection' -# -# -# require_relative './sp_orders_v0/models/transparency_code' -# -# -# require_relative './sp_orders_v0/models/transparency_code_list' -# -# -# require_relative './sp_orders_v0/models/update_shipment_status_error_response' -# -# -# require_relative './sp_orders_v0/models/update_shipment_status_request' -# -# -# require_relative './sp_orders_v0/models/update_verification_status_error_response' -# -# -# require_relative './sp_orders_v0/models/update_verification_status_request' -# -# -# require_relative './sp_orders_v0/models/update_verification_status_request_body' -# -# -# require_relative './sp_orders_v0/models/valid_verification_detail' -# -# -# require_relative './sp_orders_v0/models/verification_details' -# -# -# require_relative './sp_orders_v0/models/verification_status' -# - # APIs require_relative './sp_orders_v0/api/orders_v0_api' require_relative './sp_orders_v0/api/shipment_api' diff --git a/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb b/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb index b49d1eb..55f6c17 100644 --- a/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb +++ b/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v0 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb b/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb index 46550aa..2eb4a70 100644 --- a/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb +++ b/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v0 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/reports_2021/lib/sp_reports_2021.rb b/vendor/reports_2021/lib/sp_reports_2021.rb index d853ade..8de3eae 100644 --- a/vendor/reports_2021/lib/sp_reports_2021.rb +++ b/vendor/reports_2021/lib/sp_reports_2021.rb @@ -5,57 +5,8 @@ OpenAPI spec version: 2021-06-30 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_reports_2021/api_client' -# require 'sp_reports_2021/api_error' -# require 'sp_reports_2021/version' -# require 'sp_reports_2021/configuration' - -# Models -# -# -# require_relative './sp_reports_2021/models/create_report_response' -# -# -# require_relative './sp_reports_2021/models/create_report_schedule_response' -# -# -# require_relative './sp_reports_2021/models/create_report_schedule_specification' -# -# -# require_relative './sp_reports_2021/models/create_report_specification' -# -# -# require_relative './sp_reports_2021/models/error' -# -# -# require_relative './sp_reports_2021/models/error_list' -# -# -# require_relative './sp_reports_2021/models/get_reports_response' -# -# -# require_relative './sp_reports_2021/models/report' -# -# -# require_relative './sp_reports_2021/models/report_document' -# -# -# require_relative './sp_reports_2021/models/report_list' -# -# -# require_relative './sp_reports_2021/models/report_options' -# -# -# require_relative './sp_reports_2021/models/report_schedule' -# -# -# require_relative './sp_reports_2021/models/report_schedule_list' -# - # APIs require_relative './sp_reports_2021/api/reports_api' diff --git a/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb b/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb index b0acdce..c1fca0d 100644 --- a/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb +++ b/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: 2021-06-30 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/tokens_2021/lib/sp_tokens_2021.rb b/vendor/tokens_2021/lib/sp_tokens_2021.rb index 1ced780..8ab278b 100644 --- a/vendor/tokens_2021/lib/sp_tokens_2021.rb +++ b/vendor/tokens_2021/lib/sp_tokens_2021.rb @@ -5,33 +5,8 @@ OpenAPI spec version: 2021-03-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_tokens_2021/api_client' -# require 'sp_tokens_2021/api_error' -# require 'sp_tokens_2021/version' -# require 'sp_tokens_2021/configuration' - -# Models -# -# -# require_relative './sp_tokens_2021/models/create_restricted_data_token_request' -# -# -# require_relative './sp_tokens_2021/models/create_restricted_data_token_response' -# -# -# require_relative './sp_tokens_2021/models/error' -# -# -# require_relative './sp_tokens_2021/models/error_list' -# -# -# require_relative './sp_tokens_2021/models/restricted_resource' -# - # APIs require_relative './sp_tokens_2021/api/tokens_api' diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb b/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb index 07b88f4..1bad535 100644 --- a/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb +++ b/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: 2021-03-01 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb index dcba6db..8d97a9f 100644 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb +++ b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb @@ -5,45 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vdf_inventory_v1/api_client' -# require 'sp_vdf_inventory_v1/api_error' -# require 'sp_vdf_inventory_v1/version' -# require 'sp_vdf_inventory_v1/configuration' - -# Models -# -# -# require_relative './sp_vdf_inventory_v1/models/error' -# -# -# require_relative './sp_vdf_inventory_v1/models/error_list' -# -# -# require_relative './sp_vdf_inventory_v1/models/inventory_update' -# -# -# require_relative './sp_vdf_inventory_v1/models/item_details' -# -# -# require_relative './sp_vdf_inventory_v1/models/item_quantity' -# -# -# require_relative './sp_vdf_inventory_v1/models/party_identification' -# -# -# require_relative './sp_vdf_inventory_v1/models/submit_inventory_update_request' -# -# -# require_relative './sp_vdf_inventory_v1/models/submit_inventory_update_response' -# -# -# require_relative './sp_vdf_inventory_v1/models/transaction_reference' -# - # APIs require_relative './sp_vdf_inventory_v1/api/update_inventory_api' diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb index 38004de..cdc434e 100644 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb +++ b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb index 6d822b9..7987468 100644 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb +++ b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb @@ -5,105 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vdf_orders_v1/api_client' -# require 'sp_vdf_orders_v1/api_error' -# require 'sp_vdf_orders_v1/version' -# require 'sp_vdf_orders_v1/configuration' - -# Models -# -# -# require_relative './sp_vdf_orders_v1/models/acknowledgement_status' -# -# -# require_relative './sp_vdf_orders_v1/models/address' -# -# -# require_relative './sp_vdf_orders_v1/models/decimal' -# -# -# require_relative './sp_vdf_orders_v1/models/error' -# -# -# require_relative './sp_vdf_orders_v1/models/error_list' -# -# -# require_relative './sp_vdf_orders_v1/models/get_order_response' -# -# -# require_relative './sp_vdf_orders_v1/models/get_orders_response' -# -# -# require_relative './sp_vdf_orders_v1/models/gift_details' -# -# -# require_relative './sp_vdf_orders_v1/models/item_quantity' -# -# -# require_relative './sp_vdf_orders_v1/models/money' -# -# -# require_relative './sp_vdf_orders_v1/models/order' -# -# -# require_relative './sp_vdf_orders_v1/models/order_acknowledgement_item' -# -# -# require_relative './sp_vdf_orders_v1/models/order_details' -# -# -# require_relative './sp_vdf_orders_v1/models/order_details_tax_total' -# -# -# require_relative './sp_vdf_orders_v1/models/order_item' -# -# -# require_relative './sp_vdf_orders_v1/models/order_item_acknowledgement' -# -# -# require_relative './sp_vdf_orders_v1/models/order_item_tax_details' -# -# -# require_relative './sp_vdf_orders_v1/models/order_list' -# -# -# require_relative './sp_vdf_orders_v1/models/pagination' -# -# -# require_relative './sp_vdf_orders_v1/models/party_identification' -# -# -# require_relative './sp_vdf_orders_v1/models/scheduled_delivery_shipment' -# -# -# require_relative './sp_vdf_orders_v1/models/shipment_dates' -# -# -# require_relative './sp_vdf_orders_v1/models/shipment_details' -# -# -# require_relative './sp_vdf_orders_v1/models/submit_acknowledgement_request' -# -# -# require_relative './sp_vdf_orders_v1/models/submit_acknowledgement_response' -# -# -# require_relative './sp_vdf_orders_v1/models/tax_details' -# -# -# require_relative './sp_vdf_orders_v1/models/tax_line_item' -# -# -# require_relative './sp_vdf_orders_v1/models/tax_registration_details' -# -# -# require_relative './sp_vdf_orders_v1/models/transaction_id' -# - # APIs require_relative './sp_vdf_orders_v1/api/vendor_orders_api' diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb index cc2278d..95dff2a 100644 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb +++ b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb index faa9353..37d8533 100644 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb +++ b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb @@ -5,136 +5,9 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vdf_shipping_v1/api_client' -# require 'sp_vdf_shipping_v1/api_error' -# require 'sp_vdf_shipping_v1/version' -# require 'sp_vdf_shipping_v1/configuration' - -# Models -# -# -# require_relative './sp_vdf_shipping_v1/models/address' -# -# -# require_relative './sp_vdf_shipping_v1/models/container' -# -# -# require_relative './sp_vdf_shipping_v1/models/customer_invoice' -# -# -# require_relative './sp_vdf_shipping_v1/models/customer_invoice_list' -# -# -# require_relative './sp_vdf_shipping_v1/models/decimal' -# -# -# require_relative './sp_vdf_shipping_v1/models/dimensions' -# -# -# require_relative './sp_vdf_shipping_v1/models/error' -# -# -# require_relative './sp_vdf_shipping_v1/models/error_list' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_customer_invoice_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_customer_invoices_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_packing_slip_list_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_packing_slip_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_shipping_label_list_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/get_shipping_label_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/item' -# -# -# require_relative './sp_vdf_shipping_v1/models/item_quantity' -# -# -# require_relative './sp_vdf_shipping_v1/models/label_data' -# -# -# require_relative './sp_vdf_shipping_v1/models/packed_item' -# -# -# require_relative './sp_vdf_shipping_v1/models/packing_slip' -# -# -# require_relative './sp_vdf_shipping_v1/models/packing_slip_list' -# -# -# require_relative './sp_vdf_shipping_v1/models/pagination' -# -# -# require_relative './sp_vdf_shipping_v1/models/party_identification' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipment_confirmation' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipment_details' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipment_status_update' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipping_label' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipping_label_list' -# -# -# require_relative './sp_vdf_shipping_v1/models/shipping_label_request' -# -# -# require_relative './sp_vdf_shipping_v1/models/status_update_details' -# -# -# require_relative './sp_vdf_shipping_v1/models/status_update_details_shipment_schedule' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipment_confirmations_request' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipment_confirmations_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipment_status_updates_request' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipment_status_updates_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipping_labels_request' -# -# -# require_relative './sp_vdf_shipping_v1/models/submit_shipping_labels_response' -# -# -# require_relative './sp_vdf_shipping_v1/models/tax_registration_details' -# -# -# require_relative './sp_vdf_shipping_v1/models/transaction_reference' -# -# -# require_relative './sp_vdf_shipping_v1/models/weight' -# - # APIs require_relative './sp_vdf_shipping_v1/api/customer_invoices_api' require_relative './sp_vdf_shipping_v1/api/vendor_shipping_api' diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb index 227ab76..8acdb7b 100644 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb +++ b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb index d782e4d..ebc87c2 100644 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb +++ b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb index 050d322..c316038 100644 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb +++ b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices.rb index 60fb615..b434598 100644 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices.rb +++ b/vendor/vendor_invoices/lib/sp_vendor_invoices.rb @@ -5,84 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vendor_invoices/api_client' -# require 'sp_vendor_invoices/api_error' -# require 'sp_vendor_invoices/version' -# require 'sp_vendor_invoices/configuration' - -# Models -# -# -# require_relative './sp_vendor_invoices/models/additional_details' -# -# -# require_relative './sp_vendor_invoices/models/address' -# -# -# require_relative './sp_vendor_invoices/models/allowance_details' -# -# -# require_relative './sp_vendor_invoices/models/charge_details' -# -# -# require_relative './sp_vendor_invoices/models/credit_note_details' -# -# -# require_relative './sp_vendor_invoices/models/date_time' -# -# -# require_relative './sp_vendor_invoices/models/decimal' -# -# -# require_relative './sp_vendor_invoices/models/error' -# -# -# require_relative './sp_vendor_invoices/models/error_list' -# -# -# require_relative './sp_vendor_invoices/models/invoice' -# -# -# require_relative './sp_vendor_invoices/models/invoice_item' -# -# -# require_relative './sp_vendor_invoices/models/item_quantity' -# -# -# require_relative './sp_vendor_invoices/models/money' -# -# -# require_relative './sp_vendor_invoices/models/net_cost_unit_of_measure' -# -# -# require_relative './sp_vendor_invoices/models/party_identification' -# -# -# require_relative './sp_vendor_invoices/models/payment_terms' -# -# -# require_relative './sp_vendor_invoices/models/submit_invoices_request' -# -# -# require_relative './sp_vendor_invoices/models/submit_invoices_response' -# -# -# require_relative './sp_vendor_invoices/models/tax_details' -# -# -# require_relative './sp_vendor_invoices/models/tax_registration_details' -# -# -# require_relative './sp_vendor_invoices/models/total_weight' -# -# -# require_relative './sp_vendor_invoices/models/transaction_id' -# - # APIs require_relative './sp_vendor_invoices/api/vendor_payments_api' diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb index 2e635d9..3f0a875 100644 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb +++ b/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vendor_orders/lib/sp_vendor_orders.rb b/vendor/vendor_orders/lib/sp_vendor_orders.rb index 8067b61..d1348a3 100644 --- a/vendor/vendor_orders/lib/sp_vendor_orders.rb +++ b/vendor/vendor_orders/lib/sp_vendor_orders.rb @@ -5,117 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vendor_orders/api_client' -# require 'sp_vendor_orders/api_error' -# require 'sp_vendor_orders/version' -# require 'sp_vendor_orders/configuration' - -# Models -# -# -# require_relative './sp_vendor_orders/models/acknowledgement_status_details' -# -# -# require_relative './sp_vendor_orders/models/address' -# -# -# require_relative './sp_vendor_orders/models/date_time_interval' -# -# -# require_relative './sp_vendor_orders/models/decimal' -# -# -# require_relative './sp_vendor_orders/models/error' -# -# -# require_relative './sp_vendor_orders/models/error_list' -# -# -# require_relative './sp_vendor_orders/models/get_purchase_order_response' -# -# -# require_relative './sp_vendor_orders/models/get_purchase_orders_response' -# -# -# require_relative './sp_vendor_orders/models/get_purchase_orders_status_response' -# -# -# require_relative './sp_vendor_orders/models/import_details' -# -# -# require_relative './sp_vendor_orders/models/item_quantity' -# -# -# require_relative './sp_vendor_orders/models/item_status' -# -# -# require_relative './sp_vendor_orders/models/money' -# -# -# require_relative './sp_vendor_orders/models/order' -# -# -# require_relative './sp_vendor_orders/models/order_acknowledgement' -# -# -# require_relative './sp_vendor_orders/models/order_acknowledgement_item' -# -# -# require_relative './sp_vendor_orders/models/order_details' -# -# -# require_relative './sp_vendor_orders/models/order_item' -# -# -# require_relative './sp_vendor_orders/models/order_item_acknowledgement' -# -# -# require_relative './sp_vendor_orders/models/order_item_status' -# -# -# require_relative './sp_vendor_orders/models/order_item_status_acknowledgement_status' -# -# -# require_relative './sp_vendor_orders/models/order_item_status_ordered_quantity' -# -# -# require_relative './sp_vendor_orders/models/order_item_status_receiving_status' -# -# -# require_relative './sp_vendor_orders/models/order_list' -# -# -# require_relative './sp_vendor_orders/models/order_list_status' -# -# -# require_relative './sp_vendor_orders/models/order_status' -# -# -# require_relative './sp_vendor_orders/models/ordered_quantity_details' -# -# -# require_relative './sp_vendor_orders/models/pagination' -# -# -# require_relative './sp_vendor_orders/models/party_identification' -# -# -# require_relative './sp_vendor_orders/models/submit_acknowledgement_request' -# -# -# require_relative './sp_vendor_orders/models/submit_acknowledgement_response' -# -# -# require_relative './sp_vendor_orders/models/tax_registration_details' -# -# -# require_relative './sp_vendor_orders/models/transaction_id' -# - # APIs require_relative './sp_vendor_orders/api/vendor_orders_api' diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb b/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb index b97f361..cbabeb5 100644 --- a/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb +++ b/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb index 7ea3749..c5c754c 100644 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb +++ b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb @@ -5,33 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vendor_transaction_status/api_client' -# require 'sp_vendor_transaction_status/api_error' -# require 'sp_vendor_transaction_status/version' -# require 'sp_vendor_transaction_status/configuration' - -# Models -# -# -# require_relative './sp_vendor_transaction_status/models/error' -# -# -# require_relative './sp_vendor_transaction_status/models/error_list' -# -# -# require_relative './sp_vendor_transaction_status/models/get_transaction_response' -# -# -# require_relative './sp_vendor_transaction_status/models/transaction' -# -# -# require_relative './sp_vendor_transaction_status/models/transaction_status' -# - # APIs require_relative './sp_vendor_transaction_status/api/vendor_transaction_api' diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb index 5b9ddf3..e468cef 100644 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb +++ b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments.rb index 4000cc4..981abfe 100644 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments.rb +++ b/vendor/vendors_shipments/lib/sp_vendors_shipments.rb @@ -5,186 +5,8 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end -# # Common files -# require 'sp_vendors_shipments/api_client' -# require 'sp_vendors_shipments/api_error' -# require 'sp_vendors_shipments/version' -# require 'sp_vendors_shipments/configuration' - -# Models -# -# -# require_relative './sp_vendors_shipments/models/address' -# -# -# require_relative './sp_vendors_shipments/models/carrier_details' -# -# -# require_relative './sp_vendors_shipments/models/carton' -# -# -# require_relative './sp_vendors_shipments/models/carton_reference_details' -# -# -# require_relative './sp_vendors_shipments/models/collect_freight_pickup_details' -# -# -# require_relative './sp_vendors_shipments/models/container_identification' -# -# -# require_relative './sp_vendors_shipments/models/container_item' -# -# -# require_relative './sp_vendors_shipments/models/container_sequence_numbers' -# -# -# require_relative './sp_vendors_shipments/models/containers' -# -# -# require_relative './sp_vendors_shipments/models/decimal' -# -# -# require_relative './sp_vendors_shipments/models/dimensions' -# -# -# require_relative './sp_vendors_shipments/models/duration' -# -# -# require_relative './sp_vendors_shipments/models/error' -# -# -# require_relative './sp_vendors_shipments/models/error_list' -# -# -# require_relative './sp_vendors_shipments/models/expiry' -# -# -# require_relative './sp_vendors_shipments/models/get_shipment_details_response' -# -# -# require_relative './sp_vendors_shipments/models/get_shipment_labels' -# -# -# require_relative './sp_vendors_shipments/models/import_details' -# -# -# require_relative './sp_vendors_shipments/models/inner_containers_details' -# -# -# require_relative './sp_vendors_shipments/models/item' -# -# -# require_relative './sp_vendors_shipments/models/item_details' -# -# -# require_relative './sp_vendors_shipments/models/item_quantity' -# -# -# require_relative './sp_vendors_shipments/models/label_data' -# -# -# require_relative './sp_vendors_shipments/models/location' -# -# -# require_relative './sp_vendors_shipments/models/money' -# -# -# require_relative './sp_vendors_shipments/models/package_item_details' -# -# -# require_relative './sp_vendors_shipments/models/packed_items' -# -# -# require_relative './sp_vendors_shipments/models/packed_quantity' -# -# -# require_relative './sp_vendors_shipments/models/pagination' -# -# -# require_relative './sp_vendors_shipments/models/pallet' -# -# -# require_relative './sp_vendors_shipments/models/party_identification' -# -# -# require_relative './sp_vendors_shipments/models/purchase_order_item_details' -# -# -# require_relative './sp_vendors_shipments/models/purchase_order_items' -# -# -# require_relative './sp_vendors_shipments/models/purchase_orders' -# -# -# require_relative './sp_vendors_shipments/models/route' -# -# -# require_relative './sp_vendors_shipments/models/shipment' -# -# -# require_relative './sp_vendors_shipments/models/shipment_confirmation' -# -# -# require_relative './sp_vendors_shipments/models/shipment_details' -# -# -# require_relative './sp_vendors_shipments/models/shipment_information' -# -# -# require_relative './sp_vendors_shipments/models/shipment_measurements' -# -# -# require_relative './sp_vendors_shipments/models/shipment_status_details' -# -# -# require_relative './sp_vendors_shipments/models/stop' -# -# -# require_relative './sp_vendors_shipments/models/submit_shipment_confirmations_request' -# -# -# require_relative './sp_vendors_shipments/models/submit_shipment_confirmations_response' -# -# -# require_relative './sp_vendors_shipments/models/submit_shipments' -# -# -# require_relative './sp_vendors_shipments/models/tax_registration_details' -# -# -# require_relative './sp_vendors_shipments/models/total_weight' -# -# -# require_relative './sp_vendors_shipments/models/transaction_reference' -# -# -# require_relative './sp_vendors_shipments/models/transport_label' -# -# -# require_relative './sp_vendors_shipments/models/transport_shipment_measurements' -# -# -# require_relative './sp_vendors_shipments/models/transportation_details' -# -# -# require_relative './sp_vendors_shipments/models/transportation_details_for_shipment_confirmation' -# -# -# require_relative './sp_vendors_shipments/models/transportation_labels' -# -# -# require_relative './sp_vendors_shipments/models/vendor_details' -# -# -# require_relative './sp_vendors_shipments/models/volume' -# -# -# require_relative './sp_vendors_shipments/models/weight' -# - # APIs require_relative './sp_vendors_shipments/api/vendor_shipping_api' diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb index 7dff582..5227a4a 100644 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb +++ b/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb @@ -5,8 +5,7 @@ OpenAPI spec version: v1 -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 +Generated by: lib/generator (bundle exec rake generate) =end module AmazonSpClients From c378629b09c4c5545dcfb3011909758d8398b21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 10:02:38 +0200 Subject: [PATCH 10/83] Add generator verify job and nightly model update CI now runs `rake generate:verify`: it regenerates at the pinned spec revision and fails when the committed files drift from the generator output. A nightly workflow runs `rake generate:update` and opens a PR (via a machine-user PAT, so the PR triggers CI) whenever Amazon changes the specs. --- .github/workflows/ci.yml | 12 +++++ .github/workflows/update-models.yml | 75 +++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/update-models.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0603040..6ea20e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,15 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: bundle exec rspec + + # Regenerates vendor/ at the pinned Amazon spec revision and fails + # if the committed files drift from what the generator produces. + verify-generated: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + - run: bundle exec rake generate:verify diff --git a/.github/workflows/update-models.yml b/.github/workflows/update-models.yml new file mode 100644 index 0000000..4bed14d --- /dev/null +++ b/.github/workflows/update-models.yml @@ -0,0 +1,75 @@ +name: Update models + +on: + schedule: + # Daily at 2:00 UTC + - cron: "0 2 * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + update-models: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Pull latest Amazon specs and regenerate + run: bundle exec rake generate:update + + # Uses a machine-user PAT (not GITHUB_TOKEN) so the PR triggers CI. + - name: Create pull request + uses: actions/github-script@v8 + env: + MACHINE_USER_NAME: ${{ secrets.MACHINE_USER_NAME }} + MACHINE_USER_EMAIL: ${{ secrets.MACHINE_USER_EMAIL }} + with: + github-token: ${{ secrets.MACHINE_USER_PAT }} + script: | + const { execSync } = require('child_process'); + + const status = execSync('git status --porcelain', { encoding: 'utf8' }); + if (!status.trim()) { + console.log('No changes'); + return; + } + + execSync(`git config user.name "${process.env.MACHINE_USER_NAME}"`); + execSync(`git config user.email "${process.env.MACHINE_USER_EMAIL}"`); + + // One fixed branch; recreate it on every run. + const branchName = 'update-api-models'; + try { + execSync(`git push origin --delete ${branchName}`, { stdio: 'ignore' }); + } catch (e) { /* branch did not exist */ } + try { + execSync(`git branch -D ${branchName}`, { stdio: 'ignore' }); + } catch (e) { /* branch did not exist */ } + + execSync(`git checkout -b ${branchName}`); + execSync('git add -A'); + execSync('git commit -m "Update Amazon models"'); + execSync(`git push --set-upstream origin ${branchName}`); + + const { data: pr } = await github.rest.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: 'Update Amazon models', + body: 'Nightly regeneration against the latest Amazon SP-API specs. ' + + 'Review the pin change in selling-partner-api-models.sha and the regenerated files.', + head: branchName, + base: 'master' + }); + + console.log(`Created PR #${pr.number}: ${pr.html_url}`); From 44c6b3dcc278d0fae40a704a2187c0fca0566950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 10:11:48 +0200 Subject: [PATCH 11/83] Run model updates monthly instead of nightly --- .github/workflows/update-models.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-models.yml b/.github/workflows/update-models.yml index 4bed14d..61c7f94 100644 --- a/.github/workflows/update-models.yml +++ b/.github/workflows/update-models.yml @@ -2,8 +2,9 @@ name: Update models on: schedule: - # Daily at 2:00 UTC - - cron: "0 2 * * *" + # First day of every month at 2:00 UTC. Run manually via + # workflow_dispatch when needed. + - cron: "0 2 1 * *" workflow_dispatch: permissions: From b0a8e2a4db2c0fdd1b43fb4f50ad551b74afb4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:53:16 +0200 Subject: [PATCH 12/83] Delete 17 unused vendor API modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No consumer requires these modules. A sweep of every Dropstream repo found only active_cart and active_fulfillment using the gem in code, and together they use 14 modules — the ones in codegen-config.yml. Removes the vendor/ directories and their sp_*.rb require shims for: catalog_items_2020, catalog_items_v0, fba_inbound, fulfillment_inbound_v0, merchant_fulfillment_v0, messaging, notifications, product_fees_v0, product_pricing_v0, sales, sellers, services, shipping, solicitations, uploads_2020, vdf_payments_v1, vdf_transactions_v1. --- .../sp_catalog_items_2020.rb | 8 - lib/amazon_sp_clients/sp_catalog_items_v0.rb | 8 - lib/amazon_sp_clients/sp_fba_inbound.rb | 8 - .../sp_fulfillment_inbound_v0.rb | 8 - .../sp_merchant_fulfillment_v0.rb | 8 - lib/amazon_sp_clients/sp_messaging.rb | 8 - lib/amazon_sp_clients/sp_notifications.rb | 8 - lib/amazon_sp_clients/sp_product_fees_v0.rb | 8 - .../sp_product_pricing_v0.rb | 8 - lib/amazon_sp_clients/sp_sales.rb | 8 - lib/amazon_sp_clients/sp_sellers.rb | 8 - lib/amazon_sp_clients/sp_services.rb | 8 - lib/amazon_sp_clients/sp_shipping.rb | 8 - lib/amazon_sp_clients/sp_solicitations.rb | 8 - lib/amazon_sp_clients/sp_uploads_2020.rb | 8 - lib/amazon_sp_clients/sp_vdf_payments_v1.rb | 8 - .../sp_vdf_transactions_v1.rb | 8 - vendor/catalog_items_2020/.gitignore | 39 - vendor/catalog_items_2020/.rspec | 2 - vendor/catalog_items_2020/.rubocop.yml | 154 --- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/catalog_items_2020/Gemfile | 9 - vendor/catalog_items_2020/README.md | 136 -- vendor/catalog_items_2020/Rakefile | 8 - vendor/catalog_items_2020/git_push.sh | 55 - .../lib/sp_catalog_items_2020.rb | 103 -- .../sp_catalog_items_2020/api/catalog_api.rb | 178 --- .../lib/sp_catalog_items_2020/api_client.rb | 389 ------ .../lib/sp_catalog_items_2020/api_error.rb | 59 - .../sp_catalog_items_2020/configuration.rb | 200 --- .../models/brand_refinement.rb | 232 ---- .../models/classification_refinement.rb | 247 ---- .../lib/sp_catalog_items_2020/models/error.rb | 242 ---- .../models/error_list.rb | 218 --- .../lib/sp_catalog_items_2020/models/item.rb | 288 ---- .../sp_catalog_items_2020/models/item_asin.rb | 202 --- .../models/item_attributes.rb | 206 --- .../models/item_identifier.rb | 232 ---- .../models/item_identifiers.rb | 206 --- .../models/item_identifiers_by_marketplace.rb | 234 ---- .../models/item_image.rb | 296 ----- .../models/item_images.rb | 206 --- .../models/item_images_by_marketplace.rb | 234 ---- .../item_product_type_by_marketplace.rb | 222 ---- .../models/item_product_types.rb | 206 --- .../models/item_sales_rank.rb | 242 ---- .../models/item_sales_ranks.rb | 206 --- .../models/item_sales_ranks_by_marketplace.rb | 234 ---- .../models/item_search_results.rb | 262 ---- .../models/item_summaries.rb | 206 --- .../models/item_summary_by_marketplace.rb | 297 ----- .../models/item_variations.rb | 206 --- .../models/item_variations_by_marketplace.rb | 283 ---- .../models/item_vendor_details.rb | 206 --- .../item_vendor_details_by_marketplace.rb | 321 ----- .../models/pagination.rb | 222 ---- .../models/refinements.rb | 236 ---- .../lib/sp_catalog_items_2020/version.rb | 14 - .../sp_catalog_items_2020.gemspec | 38 - vendor/catalog_items_v0/.gitignore | 39 - vendor/catalog_items_v0/.rspec | 2 - vendor/catalog_items_v0/.rubocop.yml | 154 --- .../catalog_items_v0/.swagger-codegen-ignore | 23 - .../catalog_items_v0/.swagger-codegen/VERSION | 1 - vendor/catalog_items_v0/Gemfile | 9 - vendor/catalog_items_v0/README.md | 145 -- vendor/catalog_items_v0/Rakefile | 8 - vendor/catalog_items_v0/git_push.sh | 55 - .../lib/sp_catalog_items_v0.rb | 97 -- .../sp_catalog_items_v0/api/catalog_api.rb | 220 ---- .../lib/sp_catalog_items_v0/api_client.rb | 389 ------ .../lib/sp_catalog_items_v0/api_error.rb | 59 - .../lib/sp_catalog_items_v0/configuration.rb | 200 --- .../models/asin_identifier.rb | 231 ---- .../models/attribute_set_list.rb | 206 --- .../models/attribute_set_list_type.rb | 1170 ----------------- .../sp_catalog_items_v0/models/categories.rb | 231 ---- .../models/creator_type.rb | 222 ---- .../models/decimal_with_units.rb | 222 ---- .../models/dimension_type.rb | 238 ---- .../lib/sp_catalog_items_v0/models/error.rb | 242 ---- .../sp_catalog_items_v0/models/error_list.rb | 206 --- .../models/get_catalog_item_response.rb | 219 --- .../models/identifier_type.rb | 219 --- .../lib/sp_catalog_items_v0/models/image.rb | 230 ---- .../lib/sp_catalog_items_v0/models/item.rb | 243 ---- .../sp_catalog_items_v0/models/item_list.rb | 206 --- .../models/language_type.rb | 232 ---- .../list_catalog_categories_response.rb | 219 --- .../models/list_catalog_items_response.rb | 219 --- .../models/list_matching_items_response.rb | 210 --- .../models/list_of_categories.rb | 205 --- .../lib/sp_catalog_items_v0/models/price.rb | 222 ---- .../models/relationship_list.rb | 206 --- .../models/relationship_type.rb | 433 ------ .../models/sales_rank_list.rb | 206 --- .../models/sales_rank_type.rb | 231 ---- .../models/seller_sku_identifier.rb | 246 ---- .../lib/sp_catalog_items_v0/version.rb | 14 - .../sp_catalog_items_v0.gemspec | 38 - vendor/fba_inbound/.gitignore | 39 - vendor/fba_inbound/.rspec | 2 - vendor/fba_inbound/.rubocop.yml | 154 --- vendor/fba_inbound/.swagger-codegen-ignore | 23 - vendor/fba_inbound/.swagger-codegen/VERSION | 1 - vendor/fba_inbound/Gemfile | 9 - vendor/fba_inbound/README.md | 91 -- vendor/fba_inbound/Rakefile | 8 - vendor/fba_inbound/git_push.sh | 55 - vendor/fba_inbound/lib/sp_fba_inbound.rb | 34 - .../lib/sp_fba_inbound/api/fba_inbound_api.rb | 91 -- .../lib/sp_fba_inbound/api_client.rb | 389 ------ .../lib/sp_fba_inbound/api_error.rb | 59 - .../lib/sp_fba_inbound/configuration.rb | 200 --- .../lib/sp_fba_inbound/models/error.rb | 237 ---- .../lib/sp_fba_inbound/models/error_list.rb | 206 --- .../get_item_eligibility_preview_response.rb | 220 ---- .../models/item_eligibility_preview.rb | 303 ----- .../fba_inbound/lib/sp_fba_inbound/version.rb | 14 - vendor/fba_inbound/sp_fba_inbound.gemspec | 38 - vendor/fulfillment_inbound_v0/.gitignore | 39 - vendor/fulfillment_inbound_v0/.rspec | 2 - vendor/fulfillment_inbound_v0/.rubocop.yml | 154 --- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/fulfillment_inbound_v0/Gemfile | 9 - vendor/fulfillment_inbound_v0/README.md | 213 --- vendor/fulfillment_inbound_v0/Rakefile | 8 - vendor/fulfillment_inbound_v0/git_push.sh | 55 - .../lib/sp_fulfillment_inbound_v0.rb | 154 --- .../api/fba_inbound_api.rb | 444 ------- .../sp_fulfillment_inbound_v0/api_client.rb | 389 ------ .../sp_fulfillment_inbound_v0/api_error.rb | 59 - .../configuration.rb | 200 --- .../models/address.rb | 312 ----- .../models/amazon_prep_fees_details.rb | 220 ---- .../models/amazon_prep_fees_details_list.rb | 206 --- .../models/amount.rb | 230 ---- .../models/asin_prep_instructions.rb | 239 ---- .../models/asin_prep_instructions_list.rb | 206 --- .../models/barcode_instruction.rb | 31 - .../models/big_decimal_type.rb | 202 --- .../models/bill_of_lading_download_url.rb | 212 --- .../models/box_contents_fee_details.rb | 229 ---- .../models/box_contents_source.rb | 32 - .../models/currency_code.rb | 30 - .../models/date_string_type.rb | 202 --- .../sp_fulfillment_inbound_v0/models/error.rb | 242 ---- .../models/error_list.rb | 206 --- .../models/error_reason.rb | 30 - .../models/get_bill_of_lading_response.rb | 220 ---- .../models/get_labels_response.rb | 220 ---- .../models/get_prep_instructions_response.rb | 220 ---- .../models/get_prep_instructions_result.rb | 238 ---- .../models/get_shipment_items_response.rb | 220 ---- .../models/get_shipment_items_result.rb | 221 ---- .../models/get_shipments_response.rb | 220 ---- .../models/get_shipments_result.rb | 221 ---- .../models/inbound_shipment_info.rb | 306 ----- .../models/inbound_shipment_item.rb | 287 ---- .../models/inbound_shipment_item_list.rb | 206 --- .../models/inbound_shipment_list.rb | 206 --- .../models/invalid_asin.rb | 221 ---- .../models/invalid_asin_list.rb | 206 --- .../models/invalid_sku.rb | 221 ---- .../models/invalid_sku_list.rb | 206 --- .../models/label_download_url.rb | 212 --- .../models/label_prep_type.rb | 31 - .../models/prep_details.rb | 230 ---- .../models/prep_details_list.rb | 206 --- .../models/prep_guidance.rb | 31 - .../models/prep_instruction.rb | 44 - .../models/prep_instruction_list.rb | 206 --- .../models/prep_owner.rb | 30 - .../models/quantity.rb | 202 --- .../models/shipment_status.rb | 38 - .../models/sku_prep_instructions.rb | 258 ---- .../models/sku_prep_instructions_list.rb | 206 --- .../lib/sp_fulfillment_inbound_v0/version.rb | 14 - .../sp_fulfillment_inbound_v0.gemspec | 38 - vendor/merchant_fulfillment_v0/.gitignore | 39 - vendor/merchant_fulfillment_v0/.rspec | 2 - vendor/merchant_fulfillment_v0/.rubocop.yml | 154 --- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/merchant_fulfillment_v0/Gemfile | 9 - vendor/merchant_fulfillment_v0/README.md | 233 ---- vendor/merchant_fulfillment_v0/Rakefile | 8 - vendor/merchant_fulfillment_v0/git_push.sh | 55 - .../lib/sp_merchant_fulfillment_v0.rb | 325 ----- .../api/merchant_fulfillment_api.rb | 298 ----- .../sp_merchant_fulfillment_v0/api_client.rb | 389 ------ .../sp_merchant_fulfillment_v0/api_error.rb | 59 - .../configuration.rb | 200 --- .../models/additional_inputs.rb | 221 ---- .../models/additional_inputs_list.rb | 206 --- .../models/additional_seller_input.rb | 287 ---- .../models/additional_seller_inputs.rb | 231 ---- .../models/additional_seller_inputs_list.rb | 206 --- .../models/address.rb | 336 ----- .../models/address_line1.rb | 202 --- .../models/address_line2.rb | 202 --- .../models/address_line3.rb | 202 --- .../models/address_name.rb | 202 --- .../models/amazon_order_id.rb | 202 --- .../available_carrier_will_pick_up_option.rb | 230 ---- ...lable_carrier_will_pick_up_options_list.rb | 206 --- .../available_delivery_experience_option.rb | 230 ---- ...ilable_delivery_experience_options_list.rb | 206 --- .../available_format_options_for_label.rb | 206 --- ...available_format_options_for_label_list.rb | 206 --- .../available_shipping_service_options.rb | 230 ---- .../models/benefits.rb | 220 ---- .../models/cancel_shipment_response.rb | 220 ---- .../models/carrier_will_pick_up_option.rb | 31 - .../sp_merchant_fulfillment_v0/models/city.rb | 202 --- .../models/constraint.rb | 227 ---- .../models/constraints.rb | 206 --- .../models/country_code.rb | 202 --- .../models/create_shipment_request.rb | 267 ---- .../models/create_shipment_response.rb | 220 ---- .../models/currency_amount.rb | 232 ---- .../models/custom_text_for_label.rb | 202 --- .../models/dangerous_goods_details.rb | 288 ---- .../models/delivery_experience_option.rb | 33 - .../models/delivery_experience_type.rb | 32 - .../models/district_or_county.rb | 202 --- .../models/email_address.rb | 202 --- .../models/error.rb | 242 ---- .../models/error_list.rb | 206 --- .../models/excluded_benefit.rb | 221 ---- .../models/excluded_benefit_reason_codes.rb | 206 --- .../models/excluded_benefits.rb | 206 --- .../models/file_contents.rb | 246 ---- .../models/file_type.rb | 31 - .../get_additional_seller_inputs_request.rb | 244 ---- .../get_additional_seller_inputs_response.rb | 220 ---- .../get_additional_seller_inputs_result.rb | 220 ---- .../get_eligible_shipment_services_request.rb | 225 ---- ...get_eligible_shipment_services_response.rb | 220 ---- .../get_eligible_shipment_services_result.rb | 243 ---- .../models/get_shipment_response.rb | 220 ---- .../models/hazmat_type.rb | 30 - .../models/included_benefits.rb | 206 --- .../models/input_target_type.rb | 30 - .../sp_merchant_fulfillment_v0/models/item.rb | 294 ----- .../models/item_description.rb | 202 --- .../models/item_level_fields.rb | 231 ---- .../models/item_level_fields_list.rb | 206 --- .../models/item_list.rb | 206 --- .../models/item_quantity.rb | 202 --- .../models/label.rb | 257 ---- .../models/label_customization.rb | 220 ---- .../models/label_dimension.rb | 202 --- .../models/label_dimensions.rb | 244 ---- .../models/label_format.rb | 33 - .../models/label_format_list.rb | 206 --- .../models/label_format_option.rb | 221 ---- .../models/label_format_option_request.rb | 212 --- .../models/length.rb | 221 ---- .../models/liquid_volume.rb | 266 ---- .../models/order_item_id.rb | 202 --- .../models/package_dimension.rb | 202 --- .../models/package_dimensions.rb | 247 ---- .../models/phone_number.rb | 202 --- .../models/postal_code.rb | 202 --- .../models/predefined_package_dimensions.rb | 78 -- .../models/rejected_shipping_service.rb | 271 ---- .../models/rejected_shipping_service_list.rb | 206 --- .../models/restricted_set_values.rb | 206 --- .../models/seller_input_definition.rb | 293 ----- .../models/seller_order_id.rb | 202 --- .../models/shipment.rb | 397 ------ .../models/shipment_id.rb | 202 --- .../models/shipment_request_details.rb | 322 ----- .../models/shipment_status.rb | 32 - .../models/shipping_offering_filter.rb | 240 ---- .../models/shipping_service.rb | 372 ------ .../models/shipping_service_identifier.rb | 202 --- .../models/shipping_service_list.rb | 206 --- .../models/shipping_service_options.rb | 258 ---- .../models/standard_id_for_label.rb | 29 - .../models/state_or_province_code.rb | 202 --- .../models/temporarily_unavailable_carrier.rb | 217 --- .../temporarily_unavailable_carrier_list.rb | 206 --- ...rms_and_conditions_not_accepted_carrier.rb | 217 --- ...nd_conditions_not_accepted_carrier_list.rb | 206 --- .../models/timestamp.rb | 202 --- .../models/tracking_id.rb | 202 --- .../models/transparency_code.rb | 202 --- .../models/transparency_code_list.rb | 206 --- .../models/unit_of_length.rb | 30 - .../models/unit_of_weight.rb | 30 - .../models/weight.rb | 230 ---- .../models/weight_value.rb | 202 --- .../lib/sp_merchant_fulfillment_v0/version.rb | 14 - .../sp_merchant_fulfillment_v0.gemspec | 38 - vendor/messaging/.gitignore | 39 - vendor/messaging/.rspec | 2 - vendor/messaging/.rubocop.yml | 154 --- vendor/messaging/.swagger-codegen-ignore | 23 - vendor/messaging/.swagger-codegen/VERSION | 1 - vendor/messaging/Gemfile | 9 - vendor/messaging/README.md | 288 ---- vendor/messaging/Rakefile | 8 - vendor/messaging/git_push.sh | 55 - vendor/messaging/lib/sp_messaging.rb | 133 -- .../lib/sp_messaging/api/messaging_api.rb | 895 ------------- .../messaging/lib/sp_messaging/api_client.rb | 389 ------ .../messaging/lib/sp_messaging/api_error.rb | 59 - .../lib/sp_messaging/configuration.rb | 200 --- .../lib/sp_messaging/models/attachment.rb | 232 ---- .../models/create_amazon_motors_request.rb | 214 --- .../models/create_amazon_motors_response.rb | 211 --- ...e_confirm_customization_details_request.rb | 224 ---- ..._confirm_customization_details_response.rb | 211 --- ...create_confirm_delivery_details_request.rb | 212 --- ...reate_confirm_delivery_details_response.rb | 211 --- .../create_confirm_order_details_request.rb | 212 --- .../create_confirm_order_details_response.rb | 211 --- .../create_confirm_service_details_request.rb | 212 --- ...create_confirm_service_details_response.rb | 211 --- .../create_digital_access_key_request.rb | 224 ---- .../create_digital_access_key_response.rb | 211 --- .../models/create_legal_disclosure_request.rb | 214 --- .../create_legal_disclosure_response.rb | 211 --- ...eate_negative_feedback_removal_response.rb | 211 --- .../create_unexpected_problem_request.rb | 212 --- .../create_unexpected_problem_response.rb | 211 --- .../models/create_warranty_request.rb | 234 ---- .../models/create_warranty_response.rb | 211 --- .../lib/sp_messaging/models/error.rb | 242 ---- .../lib/sp_messaging/models/error_list.rb | 206 --- .../models/get_attributes_response.rb | 220 ---- .../models/get_attributes_response_buyer.rb | 212 --- .../models/get_messaging_action_response.rb | 238 ---- ...get_messaging_action_response__embedded.rb | 211 --- .../get_messaging_action_response__links.rb | 230 ---- ...et_messaging_actions_for_order_response.rb | 229 ---- ...ng_actions_for_order_response__embedded.rb | 218 --- ...aging_actions_for_order_response__links.rb | 233 ---- .../models/get_schema_response.rb | 229 ---- .../models/get_schema_response__links.rb | 216 --- .../sp_messaging/models/invoice_request.rb | 214 --- .../sp_messaging/models/invoice_response.rb | 211 --- .../lib/sp_messaging/models/link_object.rb | 227 ---- .../sp_messaging/models/messaging_action.rb | 217 --- .../lib/sp_messaging/models/schema.rb | 206 --- vendor/messaging/lib/sp_messaging/version.rb | 14 - vendor/messaging/sp_messaging.gemspec | 38 - vendor/notifications/.gitignore | 39 - vendor/notifications/.rspec | 2 - vendor/notifications/.rubocop.yml | 154 --- vendor/notifications/.swagger-codegen-ignore | 23 - vendor/notifications/.swagger-codegen/VERSION | 1 - vendor/notifications/Gemfile | 9 - vendor/notifications/README.md | 201 --- vendor/notifications/Rakefile | 8 - vendor/notifications/git_push.sh | 55 - vendor/notifications/lib/sp_notifications.rb | 112 -- .../sp_notifications/api/notifications_api.rb | 473 ------- .../lib/sp_notifications/api_client.rb | 389 ------ .../lib/sp_notifications/api_error.rb | 59 - .../lib/sp_notifications/configuration.rb | 200 --- .../models/aggregation_filter.rb | 211 --- .../models/aggregation_settings.rb | 216 --- .../models/aggregation_time_period.rb | 30 - .../models/create_destination_request.rb | 231 ---- .../models/create_destination_response.rb | 220 ---- .../models/create_subscription_request.rb | 241 ---- .../models/create_subscription_response.rb | 220 ---- .../models/delete_destination_response.rb | 211 --- .../delete_subscription_by_id_response.rb | 211 --- .../sp_notifications/models/destination.rb | 246 ---- .../models/destination_list.rb | 206 --- .../models/destination_resource.rb | 220 ---- .../destination_resource_specification.rb | 220 ---- .../lib/sp_notifications/models/error.rb | 242 ---- .../lib/sp_notifications/models/error_list.rb | 206 --- .../models/event_bridge_resource.rb | 247 ---- .../event_bridge_resource_specification.rb | 232 ---- .../sp_notifications/models/event_filter.rb | 282 ---- .../models/get_destination_response.rb | 220 ---- .../models/get_destinations_response.rb | 220 ---- .../models/get_subscription_by_id_response.rb | 220 ---- .../models/get_subscription_response.rb | 220 ---- .../models/marketplace_filter.rb | 211 --- .../models/marketplace_ids.rb | 206 --- .../models/order_change_type_enum.rb | 30 - .../models/order_change_type_filter.rb | 211 --- .../models/order_change_types.rb | 206 --- .../models/processing_directive.rb | 211 --- .../sp_notifications/models/sqs_resource.rb | 217 --- .../sp_notifications/models/subscription.rb | 256 ---- .../lib/sp_notifications/version.rb | 14 - vendor/notifications/sp_notifications.gemspec | 38 - vendor/product_fees_v0/.gitignore | 39 - vendor/product_fees_v0/.rspec | 2 - vendor/product_fees_v0/.rubocop.yml | 154 --- .../product_fees_v0/.swagger-codegen-ignore | 23 - .../product_fees_v0/.swagger-codegen/VERSION | 1 - vendor/product_fees_v0/Gemfile | 9 - vendor/product_fees_v0/README.md | 134 -- vendor/product_fees_v0/Rakefile | 8 - vendor/product_fees_v0/git_push.sh | 55 - .../product_fees_v0/lib/sp_product_fees_v0.rb | 94 -- .../lib/sp_product_fees_v0/api/fees_api.rb | 202 --- .../lib/sp_product_fees_v0/api_client.rb | 389 ------ .../lib/sp_product_fees_v0/api_error.rb | 59 - .../lib/sp_product_fees_v0/configuration.rb | 200 --- .../lib/sp_product_fees_v0/models/error.rb | 241 ---- .../sp_product_fees_v0/models/error_list.rb | 206 --- .../sp_product_fees_v0/models/fee_detail.rb | 272 ---- .../models/fee_detail_list.rb | 206 --- .../models/fees_estimate.rb | 235 ---- .../models/fees_estimate_by_id_request.rb | 240 ---- .../models/fees_estimate_error.rb | 261 ---- .../models/fees_estimate_error_detail.rb | 206 --- .../models/fees_estimate_identifier.rb | 279 ---- .../models/fees_estimate_request.rb | 265 ---- .../models/fees_estimate_result.rb | 239 ---- .../models/get_my_fees_estimate_request.rb | 211 --- .../models/get_my_fees_estimate_response.rb | 219 --- .../models/get_my_fees_estimate_result.rb | 211 --- .../get_my_fees_estimates_error_list.rb | 218 --- .../models/get_my_fees_estimates_request.rb | 206 --- .../models/get_my_fees_estimates_response.rb | 206 --- .../lib/sp_product_fees_v0/models/id_type.rb | 30 - .../models/included_fee_detail.rb | 263 ---- .../models/included_fee_detail_list.rb | 206 --- .../sp_product_fees_v0/models/money_type.rb | 221 ---- .../models/optional_fulfillment_program.rb | 31 - .../lib/sp_product_fees_v0/models/points.rb | 219 --- .../models/price_to_estimate_fees.rb | 234 ---- .../lib/sp_product_fees_v0/version.rb | 14 - .../sp_product_fees_v0.gemspec | 38 - vendor/product_pricing_v0/.gitignore | 39 - vendor/product_pricing_v0/.rspec | 2 - vendor/product_pricing_v0/.rubocop.yml | 154 --- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/product_pricing_v0/Gemfile | 9 - vendor/product_pricing_v0/README.md | 234 ---- vendor/product_pricing_v0/Rakefile | 8 - vendor/product_pricing_v0/git_push.sh | 55 - .../lib/sp_product_pricing_v0.rb | 235 ---- .../api/product_pricing_api.rb | 452 ------- .../lib/sp_product_pricing_v0/api_client.rb | 389 ------ .../lib/sp_product_pricing_v0/api_error.rb | 59 - .../sp_product_pricing_v0/configuration.rb | 200 --- .../lib/sp_product_pricing_v0/models/asin.rb | 202 --- .../models/asin_identifier.rb | 232 ---- .../models/attribute_set_list.rb | 206 --- .../models/batch_offers_request_params.rb | 239 ---- .../models/batch_offers_response.rb | 234 ---- .../models/batch_request.rb | 240 ---- .../models/buy_box_eligible_offers.rb | 206 --- .../models/buy_box_price_type.rb | 306 ----- .../models/buy_box_prices.rb | 206 --- .../models/competitive_price_list.rb | 206 --- .../models/competitive_price_type.rb | 299 ----- .../models/competitive_pricing_type.rb | 239 ---- .../models/condition_type.rb | 33 - .../models/customer_type.rb | 30 - .../models/detailed_shipping_time_type.rb | 276 ---- .../lib/sp_product_pricing_v0/models/error.rb | 242 ---- .../models/error_list.rb | 206 --- .../sp_product_pricing_v0/models/errors.rb | 216 --- .../models/fulfillment_channel_type.rb | 30 - .../models/get_item_offers_batch_request.rb | 211 --- .../models/get_item_offers_batch_response.rb | 211 --- .../get_listing_offers_batch_request.rb | 211 --- .../get_listing_offers_batch_response.rb | 211 --- .../models/get_offers_http_status_line.rb | 222 ---- .../models/get_offers_response.rb | 220 ---- .../models/get_offers_result.rb | 308 ----- .../models/get_pricing_response.rb | 220 ---- .../models/http_method.rb | 33 - .../models/http_request_headers.rb | 206 --- .../models/http_response_headers.rb | 206 --- .../models/identifier_type.rb | 225 ---- .../models/item_condition.rb | 33 - .../models/item_identifier.rb | 251 ---- .../models/item_offers_request.rb | 281 ---- .../models/item_offers_request_list.rb | 206 --- .../models/item_offers_request_params.rb | 253 ---- .../models/item_offers_response.rb | 252 ---- .../models/item_offers_response_list.rb | 206 --- .../models/listing_offers_request.rb | 281 ---- .../models/listing_offers_request_list.rb | 206 --- .../models/listing_offers_request_params.rb | 258 ---- .../models/listing_offers_response.rb | 247 ---- .../models/listing_offers_response_list.rb | 206 --- .../models/lowest_price_type.rb | 301 ----- .../models/lowest_prices.rb | 206 --- .../models/marketplace_id.rb | 202 --- .../models/money_type.rb | 222 ---- .../models/number_of_offer_listings_list.rb | 206 --- .../models/number_of_offers.rb | 206 --- .../models/offer_count_type.rb | 231 ---- .../models/offer_customer_type.rb | 30 - .../models/offer_detail.rb | 381 ------ .../models/offer_detail_list.rb | 206 --- .../models/offer_listing_count_type.rb | 232 ---- .../models/offer_type.rb | 320 ----- .../models/offers_list.rb | 206 --- .../sp_product_pricing_v0/models/points.rb | 221 ---- .../lib/sp_product_pricing_v0/models/price.rb | 246 ---- .../models/price_list.rb | 206 --- .../models/price_type.rb | 243 ---- .../models/prime_information_type.rb | 232 ---- .../sp_product_pricing_v0/models/product.rb | 261 ---- .../models/quantity_discount_price_type.rb | 245 ---- .../models/quantity_discount_type.rb | 29 - .../models/relationship_list.rb | 206 --- .../models/sales_rank_list.rb | 206 --- .../models/sales_rank_type.rb | 232 ---- .../models/seller_feedback_type.rb | 227 ---- .../models/seller_sku_identifier.rb | 247 ---- .../models/ships_from_type.rb | 222 ---- .../sp_product_pricing_v0/models/summary.rb | 299 ----- .../lib/sp_product_pricing_v0/version.rb | 14 - .../sp_product_pricing_v0.gemspec | 38 - vendor/sales/.gitignore | 39 - vendor/sales/.rspec | 2 - vendor/sales/.rubocop.yml | 154 --- vendor/sales/.swagger-codegen-ignore | 23 - vendor/sales/.swagger-codegen/VERSION | 1 - vendor/sales/Gemfile | 9 - vendor/sales/README.md | 100 -- vendor/sales/Rakefile | 8 - vendor/sales/git_push.sh | 55 - vendor/sales/lib/sp_sales.rb | 43 - vendor/sales/lib/sp_sales/api/sales_api.rb | 119 -- vendor/sales/lib/sp_sales/api_client.rb | 389 ------ vendor/sales/lib/sp_sales/api_error.rb | 59 - vendor/sales/lib/sp_sales/configuration.rb | 200 --- vendor/sales/lib/sp_sales/models/decimal.rb | 202 --- vendor/sales/lib/sp_sales/models/error.rb | 242 ---- .../sales/lib/sp_sales/models/error_list.rb | 206 --- .../models/get_order_metrics_response.rb | 220 ---- vendor/sales/lib/sp_sales/models/money.rb | 231 ---- .../sp_sales/models/order_metrics_interval.rb | 290 ---- .../lib/sp_sales/models/order_metrics_list.rb | 206 --- vendor/sales/lib/sp_sales/version.rb | 14 - vendor/sales/sp_sales.gemspec | 38 - vendor/sellers/.gitignore | 39 - vendor/sellers/.rspec | 2 - vendor/sellers/.rubocop.yml | 154 --- vendor/sellers/.swagger-codegen-ignore | 23 - vendor/sellers/.swagger-codegen/VERSION | 1 - vendor/sellers/Gemfile | 9 - vendor/sellers/README.md | 104 -- vendor/sellers/Rakefile | 8 - vendor/sellers/git_push.sh | 55 - vendor/sellers/lib/sp_sellers.rb | 58 - .../sellers/lib/sp_sellers/api/sellers_api.rb | 118 -- vendor/sellers/lib/sp_sellers/api_client.rb | 389 ------ vendor/sellers/lib/sp_sellers/api_error.rb | 59 - .../sellers/lib/sp_sellers/configuration.rb | 200 --- .../sellers/lib/sp_sellers/models/account.rb | 310 ----- .../sellers/lib/sp_sellers/models/address.rb | 272 ---- .../sellers/lib/sp_sellers/models/business.rb | 261 ---- vendor/sellers/lib/sp_sellers/models/error.rb | 242 ---- .../lib/sp_sellers/models/error_list.rb | 206 --- .../sp_sellers/models/get_account_response.rb | 220 ---- ...get_marketplace_participations_response.rb | 220 ---- .../lib/sp_sellers/models/marketplace.rb | 292 ---- .../models/marketplace_participation.rb | 244 ---- .../models/marketplace_participation_list.rb | 206 --- .../lib/sp_sellers/models/participation.rb | 232 ---- .../lib/sp_sellers/models/primary_contact.rb | 241 ---- vendor/sellers/lib/sp_sellers/version.rb | 14 - vendor/sellers/sp_sellers.gemspec | 38 - vendor/services/.gitignore | 39 - vendor/services/.rspec | 2 - vendor/services/.rubocop.yml | 154 --- vendor/services/.swagger-codegen-ignore | 23 - vendor/services/.swagger-codegen/VERSION | 1 - vendor/services/Gemfile | 9 - vendor/services/README.md | 395 ------ vendor/services/Rakefile | 8 - vendor/services/git_push.sh | 55 - vendor/services/lib/sp_services.rb | 238 ---- .../lib/sp_services/api/service_api.rb | 1170 ----------------- vendor/services/lib/sp_services/api_client.rb | 389 ------ vendor/services/lib/sp_services/api_error.rb | 59 - .../services/lib/sp_services/configuration.rb | 200 --- .../models/add_appointment_request.rb | 216 --- .../lib/sp_services/models/address.rb | 322 ----- .../lib/sp_services/models/appointment.rb | 294 ----- .../lib/sp_services/models/appointment_id.rb | 202 --- .../models/appointment_resource.rb | 212 --- .../models/appointment_resources.rb | 206 --- .../sp_services/models/appointment_slot.rb | 232 ---- .../models/appointment_slot_report.rb | 278 ---- .../sp_services/models/appointment_time.rb | 232 ---- .../models/appointment_time_input.rb | 227 ---- .../assign_appointment_resources_request.rb | 216 --- .../assign_appointment_resources_response.rb | 220 ---- ..._appointment_resources_response_payload.rb | 211 --- .../lib/sp_services/models/associated_item.rb | 304 ----- .../sp_services/models/availability_record.rb | 251 ---- .../models/availability_records.rb | 206 --- .../services/lib/sp_services/models/buyer.rb | 242 ---- .../models/cancel_reservation_response.rb | 211 --- ..._service_job_by_service_job_id_response.rb | 211 --- .../lib/sp_services/models/capacity_type.rb | 32 - ..._service_job_by_service_job_id_response.rb | 211 --- .../models/create_reservation_record.rb | 229 ---- .../models/create_reservation_request.rb | 231 ---- .../models/create_reservation_response.rb | 220 ---- ...ate_service_document_upload_destination.rb | 220 ---- .../lib/sp_services/models/day_of_week.rb | 35 - .../sp_services/models/encryption_details.rb | 281 ---- .../services/lib/sp_services/models/error.rb | 286 ---- .../lib/sp_services/models/error_list.rb | 206 --- .../lib/sp_services/models/fixed_slot.rb | 252 ---- .../sp_services/models/fixed_slot_capacity.rb | 244 ---- .../models/fixed_slot_capacity_errors.rb | 211 --- .../models/fixed_slot_capacity_query.rb | 254 ---- .../models/fulfillment_document.rb | 222 ---- .../models/fulfillment_documents.rb | 206 --- .../sp_services/models/fulfillment_time.rb | 222 ---- .../models/get_appointment_slots_response.rb | 220 ---- ..._service_job_by_service_job_id_response.rb | 220 ---- .../models/get_service_jobs_response.rb | 220 ---- .../lib/sp_services/models/item_delivery.rb | 221 ---- .../models/item_delivery_promise.rb | 222 ---- .../lib/sp_services/models/job_listing.rb | 244 ---- .../lib/sp_services/models/order_id.rb | 202 --- vendor/services/lib/sp_services/models/poa.rb | 287 ---- .../lib/sp_services/models/range_capacity.rb | 223 ---- .../lib/sp_services/models/range_slot.rb | 232 ---- .../sp_services/models/range_slot_capacity.rb | 234 ---- .../models/range_slot_capacity_errors.rb | 211 --- .../models/range_slot_capacity_query.rb | 244 ---- .../lib/sp_services/models/recurrence.rb | 241 ---- .../models/reschedule_appointment_request.rb | 230 ---- .../models/reschedule_reason_code.rb | 202 --- .../lib/sp_services/models/reservation.rb | 275 ---- .../lib/sp_services/models/scope_of_work.rb | 244 ---- .../services/lib/sp_services/models/seller.rb | 212 --- .../service_document_upload_destination.rb | 256 ---- .../lib/sp_services/models/service_job.rb | 375 ------ .../lib/sp_services/models/service_job_id.rb | 202 --- .../models/service_job_provider.rb | 212 --- .../sp_services/models/service_location.rb | 255 ---- .../models/service_upload_document.rb | 276 ---- ...et_appointment_fulfillment_data_request.rb | 229 ---- .../models/set_appointment_response.rb | 229 ---- .../lib/sp_services/models/technician.rb | 222 ---- .../models/update_reservation_record.rb | 229 ---- .../models/update_reservation_request.rb | 231 ---- .../models/update_reservation_response.rb | 220 ---- .../models/update_schedule_record.rb | 229 ---- .../models/update_schedule_request.rb | 216 --- .../models/update_schedule_response.rb | 223 ---- .../lib/sp_services/models/warning.rb | 242 ---- .../lib/sp_services/models/warning_list.rb | 206 --- vendor/services/lib/sp_services/version.rb | 14 - vendor/services/sp_services.gemspec | 38 - vendor/shipping/.gitignore | 39 - vendor/shipping/.rspec | 2 - vendor/shipping/.rubocop.yml | 154 --- vendor/shipping/.swagger-codegen-ignore | 23 - vendor/shipping/.swagger-codegen/VERSION | 1 - vendor/shipping/Gemfile | 9 - vendor/shipping/README.md | 245 ---- vendor/shipping/Rakefile | 8 - vendor/shipping/git_push.sh | 55 - vendor/shipping/lib/sp_shipping.rb | 214 --- .../lib/sp_shipping/api/shipping_api.rb | 530 -------- vendor/shipping/lib/sp_shipping/api_client.rb | 389 ------ vendor/shipping/lib/sp_shipping/api_error.rb | 59 - .../shipping/lib/sp_shipping/configuration.rb | 200 --- .../lib/sp_shipping/models/accepted_rate.rb | 238 ---- .../lib/sp_shipping/models/account.rb | 216 --- .../lib/sp_shipping/models/account_id.rb | 202 --- .../lib/sp_shipping/models/address.rb | 340 ----- .../models/cancel_shipment_response.rb | 211 --- .../shipping/lib/sp_shipping/models/city.rb | 202 --- .../sp_shipping/models/client_reference_id.rb | 202 --- .../lib/sp_shipping/models/container.rb | 319 ----- .../lib/sp_shipping/models/container_item.rb | 260 ---- .../lib/sp_shipping/models/container_list.rb | 206 --- .../models/container_reference_id.rb | 202 --- .../models/container_specification.rb | 230 ---- .../models/container_specification_list.rb | 206 --- .../lib/sp_shipping/models/country_code.rb | 202 --- .../models/create_shipment_request.rb | 258 ---- .../models/create_shipment_response.rb | 220 ---- .../models/create_shipment_result.rb | 230 ---- .../lib/sp_shipping/models/currency.rb | 232 ---- .../lib/sp_shipping/models/dimensions.rb | 296 ----- .../shipping/lib/sp_shipping/models/error.rb | 242 ---- .../lib/sp_shipping/models/error_list.rb | 206 --- .../shipping/lib/sp_shipping/models/event.rb | 240 ---- .../lib/sp_shipping/models/event_code.rb | 202 --- .../lib/sp_shipping/models/event_list.rb | 206 --- .../models/get_account_response.rb | 220 ---- .../sp_shipping/models/get_rates_request.rb | 268 ---- .../sp_shipping/models/get_rates_response.rb | 220 ---- .../sp_shipping/models/get_rates_result.rb | 216 --- .../models/get_shipment_response.rb | 220 ---- .../get_tracking_information_response.rb | 220 ---- .../shipping/lib/sp_shipping/models/label.rb | 220 ---- .../lib/sp_shipping/models/label_result.rb | 230 ---- .../sp_shipping/models/label_result_list.rb | 206 --- .../sp_shipping/models/label_specification.rb | 278 ---- .../lib/sp_shipping/models/label_stream.rb | 202 --- .../lib/sp_shipping/models/location.rb | 238 ---- .../shipping/lib/sp_shipping/models/party.rb | 211 --- .../lib/sp_shipping/models/postal_code.rb | 202 --- .../models/promised_delivery_date.rb | 202 --- .../models/purchase_labels_request.rb | 230 ---- .../models/purchase_labels_response.rb | 220 ---- .../models/purchase_labels_result.rb | 253 ---- .../models/purchase_shipment_request.rb | 296 ----- .../models/purchase_shipment_response.rb | 220 ---- .../models/purchase_shipment_result.rb | 244 ---- .../shipping/lib/sp_shipping/models/rate.rb | 258 ---- .../lib/sp_shipping/models/rate_id.rb | 202 --- .../lib/sp_shipping/models/rate_list.rb | 206 --- .../models/retrieve_shipping_label_request.rb | 216 --- .../retrieve_shipping_label_response.rb | 220 ---- .../models/retrieve_shipping_label_result.rb | 230 ---- .../lib/sp_shipping/models/service_rate.rb | 258 ---- .../sp_shipping/models/service_rate_list.rb | 206 --- .../lib/sp_shipping/models/service_type.rb | 31 - .../sp_shipping/models/service_type_list.rb | 206 --- .../lib/sp_shipping/models/shipment.rb | 290 ---- .../lib/sp_shipping/models/shipment_id.rb | 202 --- .../models/shipping_promise_set.rb | 220 ---- .../lib/sp_shipping/models/state_or_region.rb | 202 --- .../lib/sp_shipping/models/time_range.rb | 222 ---- .../lib/sp_shipping/models/tracking_id.rb | 202 --- .../models/tracking_information.rb | 258 ---- .../sp_shipping/models/tracking_summary.rb | 212 --- .../shipping/lib/sp_shipping/models/weight.rb | 266 ---- vendor/shipping/lib/sp_shipping/version.rb | 14 - vendor/shipping/sp_shipping.gemspec | 38 - vendor/solicitations/.gitignore | 39 - vendor/solicitations/.rspec | 2 - vendor/solicitations/.rubocop.yml | 154 --- vendor/solicitations/.swagger-codegen-ignore | 23 - vendor/solicitations/.swagger-codegen/VERSION | 1 - vendor/solicitations/Gemfile | 9 - vendor/solicitations/README.md | 112 -- vendor/solicitations/Rakefile | 8 - vendor/solicitations/git_push.sh | 55 - vendor/solicitations/lib/sp_solicitations.rb | 64 - .../sp_solicitations/api/solicitations_api.rb | 144 -- .../lib/sp_solicitations/api_client.rb | 389 ------ .../lib/sp_solicitations/api_error.rb | 59 - .../lib/sp_solicitations/configuration.rb | 200 --- ...d_seller_feedback_solicitation_response.rb | 211 --- .../lib/sp_solicitations/models/error.rb | 242 ---- .../lib/sp_solicitations/models/error_list.rb | 206 --- .../models/get_schema_response.rb | 228 ---- .../models/get_schema_response__links.rb | 215 --- .../get_solicitation_action_response.rb | 238 ---- ..._solicitation_action_response__embedded.rb | 210 --- ...get_solicitation_action_response__links.rb | 229 ---- ...solicitation_actions_for_order_response.rb | 229 ---- ...on_actions_for_order_response__embedded.rb | 217 --- ...ation_actions_for_order_response__links.rb | 232 ---- .../sp_solicitations/models/link_object.rb | 227 ---- .../lib/sp_solicitations/models/schema.rb | 206 --- .../models/solicitations_action.rb | 216 --- .../lib/sp_solicitations/version.rb | 14 - vendor/solicitations/sp_solicitations.gemspec | 38 - vendor/uploads_2020/.gitignore | 39 - vendor/uploads_2020/.rspec | 2 - vendor/uploads_2020/.rubocop.yml | 154 --- vendor/uploads_2020/.swagger-codegen-ignore | 23 - vendor/uploads_2020/.swagger-codegen/VERSION | 1 - vendor/uploads_2020/Gemfile | 9 - vendor/uploads_2020/README.md | 92 -- vendor/uploads_2020/Rakefile | 8 - vendor/uploads_2020/git_push.sh | 55 - vendor/uploads_2020/lib/sp_uploads_2020.rb | 34 - .../lib/sp_uploads_2020/api/uploads_api.rb | 93 -- .../lib/sp_uploads_2020/api_client.rb | 389 ------ .../lib/sp_uploads_2020/api_error.rb | 59 - .../lib/sp_uploads_2020/configuration.rb | 200 --- .../create_upload_destination_response.rb | 220 ---- .../lib/sp_uploads_2020/models/error.rb | 242 ---- .../lib/sp_uploads_2020/models/error_list.rb | 206 --- .../models/upload_destination.rb | 232 ---- .../lib/sp_uploads_2020/version.rb | 14 - vendor/uploads_2020/sp_uploads_2020.gemspec | 38 - vendor/vdf_payments_v1/.gitignore | 39 - vendor/vdf_payments_v1/.rspec | 2 - vendor/vdf_payments_v1/.rubocop.yml | 154 --- .../vdf_payments_v1/.swagger-codegen-ignore | 23 - .../vdf_payments_v1/.swagger-codegen/VERSION | 1 - vendor/vdf_payments_v1/Gemfile | 9 - vendor/vdf_payments_v1/README.md | 100 -- vendor/vdf_payments_v1/Rakefile | 8 - vendor/vdf_payments_v1/git_push.sh | 55 - .../vdf_payments_v1/lib/sp_vdf_payments_v1.rb | 70 - .../api/vendor_invoice_api.rb | 78 -- .../lib/sp_vdf_payments_v1/api_client.rb | 389 ------ .../lib/sp_vdf_payments_v1/api_error.rb | 59 - .../lib/sp_vdf_payments_v1/configuration.rb | 200 --- .../models/additional_details.rb | 276 ---- .../lib/sp_vdf_payments_v1/models/address.rb | 342 ----- .../models/charge_details.rb | 277 ---- .../lib/sp_vdf_payments_v1/models/decimal.rb | 202 --- .../lib/sp_vdf_payments_v1/models/error.rb | 242 ---- .../sp_vdf_payments_v1/models/error_list.rb | 206 --- .../models/invoice_detail.rb | 366 ------ .../sp_vdf_payments_v1/models/invoice_item.rb | 324 ----- .../models/item_quantity.rb | 232 ---- .../lib/sp_vdf_payments_v1/models/money.rb | 231 ---- .../models/party_identification.rb | 238 ---- .../models/submit_invoice_request.rb | 214 --- .../models/submit_invoice_response.rb | 220 ---- .../sp_vdf_payments_v1/models/tax_detail.rb | 283 ---- .../models/tax_registration_detail.rb | 280 ---- .../models/transaction_reference.rb | 212 --- .../lib/sp_vdf_payments_v1/version.rb | 14 - .../sp_vdf_payments_v1.gemspec | 38 - vendor/vdf_transactions_v1/.gitignore | 39 - vendor/vdf_transactions_v1/.rspec | 2 - vendor/vdf_transactions_v1/.rubocop.yml | 154 --- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/vdf_transactions_v1/Gemfile | 9 - vendor/vdf_transactions_v1/README.md | 89 -- vendor/vdf_transactions_v1/Rakefile | 8 - vendor/vdf_transactions_v1/git_push.sh | 55 - .../lib/sp_vdf_transactions_v1.rb | 37 - .../api/vendor_transaction_api.rb | 76 -- .../lib/sp_vdf_transactions_v1/api_client.rb | 389 ------ .../lib/sp_vdf_transactions_v1/api_error.rb | 59 - .../sp_vdf_transactions_v1/configuration.rb | 200 --- .../sp_vdf_transactions_v1/models/error.rb | 242 ---- .../models/error_list.rb | 206 --- .../models/get_transaction_response.rb | 220 ---- .../models/transaction.rb | 275 ---- .../models/transaction_status.rb | 211 --- .../lib/sp_vdf_transactions_v1/version.rb | 14 - .../sp_vdf_transactions_v1.gemspec | 38 - 846 files changed, 149931 deletions(-) delete mode 100644 lib/amazon_sp_clients/sp_catalog_items_2020.rb delete mode 100644 lib/amazon_sp_clients/sp_catalog_items_v0.rb delete mode 100644 lib/amazon_sp_clients/sp_fba_inbound.rb delete mode 100644 lib/amazon_sp_clients/sp_fulfillment_inbound_v0.rb delete mode 100644 lib/amazon_sp_clients/sp_merchant_fulfillment_v0.rb delete mode 100644 lib/amazon_sp_clients/sp_messaging.rb delete mode 100644 lib/amazon_sp_clients/sp_notifications.rb delete mode 100644 lib/amazon_sp_clients/sp_product_fees_v0.rb delete mode 100644 lib/amazon_sp_clients/sp_product_pricing_v0.rb delete mode 100644 lib/amazon_sp_clients/sp_sales.rb delete mode 100644 lib/amazon_sp_clients/sp_sellers.rb delete mode 100644 lib/amazon_sp_clients/sp_services.rb delete mode 100644 lib/amazon_sp_clients/sp_shipping.rb delete mode 100644 lib/amazon_sp_clients/sp_solicitations.rb delete mode 100644 lib/amazon_sp_clients/sp_uploads_2020.rb delete mode 100644 lib/amazon_sp_clients/sp_vdf_payments_v1.rb delete mode 100644 lib/amazon_sp_clients/sp_vdf_transactions_v1.rb delete mode 100644 vendor/catalog_items_2020/.gitignore delete mode 100644 vendor/catalog_items_2020/.rspec delete mode 100644 vendor/catalog_items_2020/.rubocop.yml delete mode 100644 vendor/catalog_items_2020/.swagger-codegen-ignore delete mode 100644 vendor/catalog_items_2020/.swagger-codegen/VERSION delete mode 100644 vendor/catalog_items_2020/Gemfile delete mode 100644 vendor/catalog_items_2020/README.md delete mode 100644 vendor/catalog_items_2020/Rakefile delete mode 100644 vendor/catalog_items_2020/git_push.sh delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/api/catalog_api.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_client.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_error.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/configuration.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/brand_refinement.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/classification_refinement.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error_list.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_asin.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_attributes.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifier.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_image.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_type_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_types.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_rank.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_search_results.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summaries.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summary_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details_by_marketplace.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/pagination.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/refinements.rb delete mode 100644 vendor/catalog_items_2020/lib/sp_catalog_items_2020/version.rb delete mode 100644 vendor/catalog_items_2020/sp_catalog_items_2020.gemspec delete mode 100644 vendor/catalog_items_v0/.gitignore delete mode 100644 vendor/catalog_items_v0/.rspec delete mode 100644 vendor/catalog_items_v0/.rubocop.yml delete mode 100644 vendor/catalog_items_v0/.swagger-codegen-ignore delete mode 100644 vendor/catalog_items_v0/.swagger-codegen/VERSION delete mode 100644 vendor/catalog_items_v0/Gemfile delete mode 100644 vendor/catalog_items_v0/README.md delete mode 100644 vendor/catalog_items_v0/Rakefile delete mode 100644 vendor/catalog_items_v0/git_push.sh delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/api/catalog_api.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_client.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_error.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/configuration.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/asin_identifier.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/categories.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/creator_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/decimal_with_units.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/dimension_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error_list.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/get_catalog_item_response.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/identifier_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/image.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item_list.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/language_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_categories_response.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_items_response.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_matching_items_response.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_of_categories.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/price.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_list.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_list.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_type.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/seller_sku_identifier.rb delete mode 100644 vendor/catalog_items_v0/lib/sp_catalog_items_v0/version.rb delete mode 100644 vendor/catalog_items_v0/sp_catalog_items_v0.gemspec delete mode 100644 vendor/fba_inbound/.gitignore delete mode 100644 vendor/fba_inbound/.rspec delete mode 100644 vendor/fba_inbound/.rubocop.yml delete mode 100644 vendor/fba_inbound/.swagger-codegen-ignore delete mode 100644 vendor/fba_inbound/.swagger-codegen/VERSION delete mode 100644 vendor/fba_inbound/Gemfile delete mode 100644 vendor/fba_inbound/README.md delete mode 100644 vendor/fba_inbound/Rakefile delete mode 100644 vendor/fba_inbound/git_push.sh delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/api/fba_inbound_api.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/api_client.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/api_error.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/configuration.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/models/error.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/models/error_list.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/models/get_item_eligibility_preview_response.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/models/item_eligibility_preview.rb delete mode 100644 vendor/fba_inbound/lib/sp_fba_inbound/version.rb delete mode 100644 vendor/fba_inbound/sp_fba_inbound.gemspec delete mode 100644 vendor/fulfillment_inbound_v0/.gitignore delete mode 100644 vendor/fulfillment_inbound_v0/.rspec delete mode 100644 vendor/fulfillment_inbound_v0/.rubocop.yml delete mode 100644 vendor/fulfillment_inbound_v0/.swagger-codegen-ignore delete mode 100644 vendor/fulfillment_inbound_v0/.swagger-codegen/VERSION delete mode 100644 vendor/fulfillment_inbound_v0/Gemfile delete mode 100644 vendor/fulfillment_inbound_v0/README.md delete mode 100644 vendor/fulfillment_inbound_v0/Rakefile delete mode 100644 vendor/fulfillment_inbound_v0/git_push.sh delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api/fba_inbound_api.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_client.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_error.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/configuration.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/address.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amount.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/barcode_instruction.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/big_decimal_type.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/bill_of_lading_download_url.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_fee_details.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_source.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/currency_code.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/date_string_type.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_reason.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_bill_of_lading_response.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_labels_response.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_response.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_result.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_response.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_result.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_response.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_result.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_info.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_download_url.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_prep_type.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_guidance.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_owner.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/quantity.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/shipment_status.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions_list.rb delete mode 100644 vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/version.rb delete mode 100644 vendor/fulfillment_inbound_v0/sp_fulfillment_inbound_v0.gemspec delete mode 100644 vendor/merchant_fulfillment_v0/.gitignore delete mode 100644 vendor/merchant_fulfillment_v0/.rspec delete mode 100644 vendor/merchant_fulfillment_v0/.rubocop.yml delete mode 100644 vendor/merchant_fulfillment_v0/.swagger-codegen-ignore delete mode 100644 vendor/merchant_fulfillment_v0/.swagger-codegen/VERSION delete mode 100644 vendor/merchant_fulfillment_v0/Gemfile delete mode 100644 vendor/merchant_fulfillment_v0/README.md delete mode 100644 vendor/merchant_fulfillment_v0/Rakefile delete mode 100644 vendor/merchant_fulfillment_v0/git_push.sh delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api/merchant_fulfillment_api.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_client.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_error.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/configuration.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_input.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line1.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line2.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line3.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_name.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/amazon_order_id.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_option.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_options_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_option.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_options_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_shipping_service_options.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/benefits.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/cancel_shipment_response.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/carrier_will_pick_up_option.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/city.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraint.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraints.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/country_code.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_request.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_response.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/currency_amount.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/custom_text_for_label.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/dangerous_goods_details.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_option.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_type.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/district_or_county.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/email_address.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit_reason_codes.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefits.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_contents.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_type.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_request.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_response.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_result.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_request.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_response.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_result.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_shipment_response.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/hazmat_type.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/included_benefits.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/input_target_type.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_description.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_quantity.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_customization.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimension.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimensions.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option_request.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/length.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/liquid_volume.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/order_item_id.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimension.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimensions.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/phone_number.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/postal_code.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/predefined_package_dimensions.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/restricted_set_values.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_input_definition.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_order_id.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_id.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_request_details.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_status.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_offering_filter.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_identifier.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_options.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/standard_id_for_label.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/state_or_province_code.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/timestamp.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/tracking_id.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code_list.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_length.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_weight.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight_value.rb delete mode 100644 vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/version.rb delete mode 100644 vendor/merchant_fulfillment_v0/sp_merchant_fulfillment_v0.gemspec delete mode 100644 vendor/messaging/.gitignore delete mode 100644 vendor/messaging/.rspec delete mode 100644 vendor/messaging/.rubocop.yml delete mode 100644 vendor/messaging/.swagger-codegen-ignore delete mode 100644 vendor/messaging/.swagger-codegen/VERSION delete mode 100644 vendor/messaging/Gemfile delete mode 100644 vendor/messaging/README.md delete mode 100644 vendor/messaging/Rakefile delete mode 100644 vendor/messaging/git_push.sh delete mode 100644 vendor/messaging/lib/sp_messaging.rb delete mode 100644 vendor/messaging/lib/sp_messaging/api/messaging_api.rb delete mode 100644 vendor/messaging/lib/sp_messaging/api_client.rb delete mode 100644 vendor/messaging/lib/sp_messaging/api_error.rb delete mode 100644 vendor/messaging/lib/sp_messaging/configuration.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/attachment.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_amazon_motors_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_amazon_motors_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_digital_access_key_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_digital_access_key_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_negative_feedback_removal_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_warranty_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/create_warranty_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/error.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/error_list.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_attributes_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_attributes_response_buyer.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_action_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__embedded.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__links.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__embedded.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__links.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_schema_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/get_schema_response__links.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/invoice_request.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/invoice_response.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/link_object.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/messaging_action.rb delete mode 100644 vendor/messaging/lib/sp_messaging/models/schema.rb delete mode 100644 vendor/messaging/lib/sp_messaging/version.rb delete mode 100644 vendor/messaging/sp_messaging.gemspec delete mode 100644 vendor/notifications/.gitignore delete mode 100644 vendor/notifications/.rspec delete mode 100644 vendor/notifications/.rubocop.yml delete mode 100644 vendor/notifications/.swagger-codegen-ignore delete mode 100644 vendor/notifications/.swagger-codegen/VERSION delete mode 100644 vendor/notifications/Gemfile delete mode 100644 vendor/notifications/README.md delete mode 100644 vendor/notifications/Rakefile delete mode 100644 vendor/notifications/git_push.sh delete mode 100644 vendor/notifications/lib/sp_notifications.rb delete mode 100644 vendor/notifications/lib/sp_notifications/api/notifications_api.rb delete mode 100644 vendor/notifications/lib/sp_notifications/api_client.rb delete mode 100644 vendor/notifications/lib/sp_notifications/api_error.rb delete mode 100644 vendor/notifications/lib/sp_notifications/configuration.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/aggregation_filter.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/aggregation_settings.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/aggregation_time_period.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/create_destination_request.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/create_destination_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/create_subscription_request.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/create_subscription_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/delete_destination_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/delete_subscription_by_id_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/destination.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/destination_list.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/destination_resource.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/destination_resource_specification.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/error.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/error_list.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/event_bridge_resource.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/event_bridge_resource_specification.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/event_filter.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/get_destination_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/get_destinations_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/get_subscription_by_id_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/get_subscription_response.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/marketplace_filter.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/marketplace_ids.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/order_change_type_enum.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/order_change_type_filter.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/order_change_types.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/processing_directive.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/sqs_resource.rb delete mode 100644 vendor/notifications/lib/sp_notifications/models/subscription.rb delete mode 100644 vendor/notifications/lib/sp_notifications/version.rb delete mode 100644 vendor/notifications/sp_notifications.gemspec delete mode 100644 vendor/product_fees_v0/.gitignore delete mode 100644 vendor/product_fees_v0/.rspec delete mode 100644 vendor/product_fees_v0/.rubocop.yml delete mode 100644 vendor/product_fees_v0/.swagger-codegen-ignore delete mode 100644 vendor/product_fees_v0/.swagger-codegen/VERSION delete mode 100644 vendor/product_fees_v0/Gemfile delete mode 100644 vendor/product_fees_v0/README.md delete mode 100644 vendor/product_fees_v0/Rakefile delete mode 100644 vendor/product_fees_v0/git_push.sh delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/api/fees_api.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/api_client.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/api_error.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/configuration.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/error.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/error_list.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail_list.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_by_id_request.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error_detail.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_identifier.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_request.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_result.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_request.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_response.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_result.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_error_list.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_request.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_response.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/id_type.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail_list.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/money_type.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/optional_fulfillment_program.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/points.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/models/price_to_estimate_fees.rb delete mode 100644 vendor/product_fees_v0/lib/sp_product_fees_v0/version.rb delete mode 100644 vendor/product_fees_v0/sp_product_fees_v0.gemspec delete mode 100644 vendor/product_pricing_v0/.gitignore delete mode 100644 vendor/product_pricing_v0/.rspec delete mode 100644 vendor/product_pricing_v0/.rubocop.yml delete mode 100644 vendor/product_pricing_v0/.swagger-codegen-ignore delete mode 100644 vendor/product_pricing_v0/.swagger-codegen/VERSION delete mode 100644 vendor/product_pricing_v0/Gemfile delete mode 100644 vendor/product_pricing_v0/README.md delete mode 100644 vendor/product_pricing_v0/Rakefile delete mode 100644 vendor/product_pricing_v0/git_push.sh delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/api/product_pricing_api.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_client.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_error.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/configuration.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin_identifier.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/attribute_set_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_request_params.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_request.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_eligible_offers.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_price_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_prices.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_pricing_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/condition_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/customer_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/detailed_shipping_time_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/errors.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/fulfillment_channel_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_request.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_request.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_http_status_line.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_result.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_pricing_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_method.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_request_headers.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_response_headers.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/identifier_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_condition.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_identifier.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_params.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_params.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_price_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_prices.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/marketplace_id.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/money_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offer_listings_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offers.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_count_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_customer_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_listing_count_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offers_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/points.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/prime_information_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/product.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_price_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/relationship_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_list.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_feedback_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_sku_identifier.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/ships_from_type.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/summary.rb delete mode 100644 vendor/product_pricing_v0/lib/sp_product_pricing_v0/version.rb delete mode 100644 vendor/product_pricing_v0/sp_product_pricing_v0.gemspec delete mode 100644 vendor/sales/.gitignore delete mode 100644 vendor/sales/.rspec delete mode 100644 vendor/sales/.rubocop.yml delete mode 100644 vendor/sales/.swagger-codegen-ignore delete mode 100644 vendor/sales/.swagger-codegen/VERSION delete mode 100644 vendor/sales/Gemfile delete mode 100644 vendor/sales/README.md delete mode 100644 vendor/sales/Rakefile delete mode 100644 vendor/sales/git_push.sh delete mode 100644 vendor/sales/lib/sp_sales.rb delete mode 100644 vendor/sales/lib/sp_sales/api/sales_api.rb delete mode 100644 vendor/sales/lib/sp_sales/api_client.rb delete mode 100644 vendor/sales/lib/sp_sales/api_error.rb delete mode 100644 vendor/sales/lib/sp_sales/configuration.rb delete mode 100644 vendor/sales/lib/sp_sales/models/decimal.rb delete mode 100644 vendor/sales/lib/sp_sales/models/error.rb delete mode 100644 vendor/sales/lib/sp_sales/models/error_list.rb delete mode 100644 vendor/sales/lib/sp_sales/models/get_order_metrics_response.rb delete mode 100644 vendor/sales/lib/sp_sales/models/money.rb delete mode 100644 vendor/sales/lib/sp_sales/models/order_metrics_interval.rb delete mode 100644 vendor/sales/lib/sp_sales/models/order_metrics_list.rb delete mode 100644 vendor/sales/lib/sp_sales/version.rb delete mode 100644 vendor/sales/sp_sales.gemspec delete mode 100644 vendor/sellers/.gitignore delete mode 100644 vendor/sellers/.rspec delete mode 100644 vendor/sellers/.rubocop.yml delete mode 100644 vendor/sellers/.swagger-codegen-ignore delete mode 100644 vendor/sellers/.swagger-codegen/VERSION delete mode 100644 vendor/sellers/Gemfile delete mode 100644 vendor/sellers/README.md delete mode 100644 vendor/sellers/Rakefile delete mode 100644 vendor/sellers/git_push.sh delete mode 100644 vendor/sellers/lib/sp_sellers.rb delete mode 100644 vendor/sellers/lib/sp_sellers/api/sellers_api.rb delete mode 100644 vendor/sellers/lib/sp_sellers/api_client.rb delete mode 100644 vendor/sellers/lib/sp_sellers/api_error.rb delete mode 100644 vendor/sellers/lib/sp_sellers/configuration.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/account.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/address.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/business.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/error.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/error_list.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/get_account_response.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/get_marketplace_participations_response.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/marketplace.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/marketplace_participation.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/marketplace_participation_list.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/participation.rb delete mode 100644 vendor/sellers/lib/sp_sellers/models/primary_contact.rb delete mode 100644 vendor/sellers/lib/sp_sellers/version.rb delete mode 100644 vendor/sellers/sp_sellers.gemspec delete mode 100644 vendor/services/.gitignore delete mode 100644 vendor/services/.rspec delete mode 100644 vendor/services/.rubocop.yml delete mode 100644 vendor/services/.swagger-codegen-ignore delete mode 100644 vendor/services/.swagger-codegen/VERSION delete mode 100644 vendor/services/Gemfile delete mode 100644 vendor/services/README.md delete mode 100644 vendor/services/Rakefile delete mode 100644 vendor/services/git_push.sh delete mode 100644 vendor/services/lib/sp_services.rb delete mode 100644 vendor/services/lib/sp_services/api/service_api.rb delete mode 100644 vendor/services/lib/sp_services/api_client.rb delete mode 100644 vendor/services/lib/sp_services/api_error.rb delete mode 100644 vendor/services/lib/sp_services/configuration.rb delete mode 100644 vendor/services/lib/sp_services/models/add_appointment_request.rb delete mode 100644 vendor/services/lib/sp_services/models/address.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_id.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_resource.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_resources.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_slot.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_slot_report.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_time.rb delete mode 100644 vendor/services/lib/sp_services/models/appointment_time_input.rb delete mode 100644 vendor/services/lib/sp_services/models/assign_appointment_resources_request.rb delete mode 100644 vendor/services/lib/sp_services/models/assign_appointment_resources_response.rb delete mode 100644 vendor/services/lib/sp_services/models/assign_appointment_resources_response_payload.rb delete mode 100644 vendor/services/lib/sp_services/models/associated_item.rb delete mode 100644 vendor/services/lib/sp_services/models/availability_record.rb delete mode 100644 vendor/services/lib/sp_services/models/availability_records.rb delete mode 100644 vendor/services/lib/sp_services/models/buyer.rb delete mode 100644 vendor/services/lib/sp_services/models/cancel_reservation_response.rb delete mode 100644 vendor/services/lib/sp_services/models/cancel_service_job_by_service_job_id_response.rb delete mode 100644 vendor/services/lib/sp_services/models/capacity_type.rb delete mode 100644 vendor/services/lib/sp_services/models/complete_service_job_by_service_job_id_response.rb delete mode 100644 vendor/services/lib/sp_services/models/create_reservation_record.rb delete mode 100644 vendor/services/lib/sp_services/models/create_reservation_request.rb delete mode 100644 vendor/services/lib/sp_services/models/create_reservation_response.rb delete mode 100644 vendor/services/lib/sp_services/models/create_service_document_upload_destination.rb delete mode 100644 vendor/services/lib/sp_services/models/day_of_week.rb delete mode 100644 vendor/services/lib/sp_services/models/encryption_details.rb delete mode 100644 vendor/services/lib/sp_services/models/error.rb delete mode 100644 vendor/services/lib/sp_services/models/error_list.rb delete mode 100644 vendor/services/lib/sp_services/models/fixed_slot.rb delete mode 100644 vendor/services/lib/sp_services/models/fixed_slot_capacity.rb delete mode 100644 vendor/services/lib/sp_services/models/fixed_slot_capacity_errors.rb delete mode 100644 vendor/services/lib/sp_services/models/fixed_slot_capacity_query.rb delete mode 100644 vendor/services/lib/sp_services/models/fulfillment_document.rb delete mode 100644 vendor/services/lib/sp_services/models/fulfillment_documents.rb delete mode 100644 vendor/services/lib/sp_services/models/fulfillment_time.rb delete mode 100644 vendor/services/lib/sp_services/models/get_appointment_slots_response.rb delete mode 100644 vendor/services/lib/sp_services/models/get_service_job_by_service_job_id_response.rb delete mode 100644 vendor/services/lib/sp_services/models/get_service_jobs_response.rb delete mode 100644 vendor/services/lib/sp_services/models/item_delivery.rb delete mode 100644 vendor/services/lib/sp_services/models/item_delivery_promise.rb delete mode 100644 vendor/services/lib/sp_services/models/job_listing.rb delete mode 100644 vendor/services/lib/sp_services/models/order_id.rb delete mode 100644 vendor/services/lib/sp_services/models/poa.rb delete mode 100644 vendor/services/lib/sp_services/models/range_capacity.rb delete mode 100644 vendor/services/lib/sp_services/models/range_slot.rb delete mode 100644 vendor/services/lib/sp_services/models/range_slot_capacity.rb delete mode 100644 vendor/services/lib/sp_services/models/range_slot_capacity_errors.rb delete mode 100644 vendor/services/lib/sp_services/models/range_slot_capacity_query.rb delete mode 100644 vendor/services/lib/sp_services/models/recurrence.rb delete mode 100644 vendor/services/lib/sp_services/models/reschedule_appointment_request.rb delete mode 100644 vendor/services/lib/sp_services/models/reschedule_reason_code.rb delete mode 100644 vendor/services/lib/sp_services/models/reservation.rb delete mode 100644 vendor/services/lib/sp_services/models/scope_of_work.rb delete mode 100644 vendor/services/lib/sp_services/models/seller.rb delete mode 100644 vendor/services/lib/sp_services/models/service_document_upload_destination.rb delete mode 100644 vendor/services/lib/sp_services/models/service_job.rb delete mode 100644 vendor/services/lib/sp_services/models/service_job_id.rb delete mode 100644 vendor/services/lib/sp_services/models/service_job_provider.rb delete mode 100644 vendor/services/lib/sp_services/models/service_location.rb delete mode 100644 vendor/services/lib/sp_services/models/service_upload_document.rb delete mode 100644 vendor/services/lib/sp_services/models/set_appointment_fulfillment_data_request.rb delete mode 100644 vendor/services/lib/sp_services/models/set_appointment_response.rb delete mode 100644 vendor/services/lib/sp_services/models/technician.rb delete mode 100644 vendor/services/lib/sp_services/models/update_reservation_record.rb delete mode 100644 vendor/services/lib/sp_services/models/update_reservation_request.rb delete mode 100644 vendor/services/lib/sp_services/models/update_reservation_response.rb delete mode 100644 vendor/services/lib/sp_services/models/update_schedule_record.rb delete mode 100644 vendor/services/lib/sp_services/models/update_schedule_request.rb delete mode 100644 vendor/services/lib/sp_services/models/update_schedule_response.rb delete mode 100644 vendor/services/lib/sp_services/models/warning.rb delete mode 100644 vendor/services/lib/sp_services/models/warning_list.rb delete mode 100644 vendor/services/lib/sp_services/version.rb delete mode 100644 vendor/services/sp_services.gemspec delete mode 100644 vendor/shipping/.gitignore delete mode 100644 vendor/shipping/.rspec delete mode 100644 vendor/shipping/.rubocop.yml delete mode 100644 vendor/shipping/.swagger-codegen-ignore delete mode 100644 vendor/shipping/.swagger-codegen/VERSION delete mode 100644 vendor/shipping/Gemfile delete mode 100644 vendor/shipping/README.md delete mode 100644 vendor/shipping/Rakefile delete mode 100644 vendor/shipping/git_push.sh delete mode 100644 vendor/shipping/lib/sp_shipping.rb delete mode 100644 vendor/shipping/lib/sp_shipping/api/shipping_api.rb delete mode 100644 vendor/shipping/lib/sp_shipping/api_client.rb delete mode 100644 vendor/shipping/lib/sp_shipping/api_error.rb delete mode 100644 vendor/shipping/lib/sp_shipping/configuration.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/accepted_rate.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/account.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/account_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/address.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/cancel_shipment_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/city.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/client_reference_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container_item.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container_reference_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container_specification.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/container_specification_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/country_code.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/create_shipment_request.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/create_shipment_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/create_shipment_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/currency.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/dimensions.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/error.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/error_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/event.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/event_code.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/event_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_account_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_rates_request.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_rates_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_rates_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_shipment_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/get_tracking_information_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/label.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/label_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/label_result_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/label_specification.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/label_stream.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/location.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/party.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/postal_code.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/promised_delivery_date.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_labels_request.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_labels_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_labels_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_shipment_request.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_shipment_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/purchase_shipment_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/rate.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/rate_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/rate_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_request.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_response.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_result.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/service_rate.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/service_rate_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/service_type.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/service_type_list.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/shipment.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/shipment_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/shipping_promise_set.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/state_or_region.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/time_range.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/tracking_id.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/tracking_information.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/tracking_summary.rb delete mode 100644 vendor/shipping/lib/sp_shipping/models/weight.rb delete mode 100644 vendor/shipping/lib/sp_shipping/version.rb delete mode 100644 vendor/shipping/sp_shipping.gemspec delete mode 100644 vendor/solicitations/.gitignore delete mode 100644 vendor/solicitations/.rspec delete mode 100644 vendor/solicitations/.rubocop.yml delete mode 100644 vendor/solicitations/.swagger-codegen-ignore delete mode 100644 vendor/solicitations/.swagger-codegen/VERSION delete mode 100644 vendor/solicitations/Gemfile delete mode 100644 vendor/solicitations/README.md delete mode 100644 vendor/solicitations/Rakefile delete mode 100644 vendor/solicitations/git_push.sh delete mode 100644 vendor/solicitations/lib/sp_solicitations.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/api/solicitations_api.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/api_client.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/api_error.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/configuration.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/create_product_review_and_seller_feedback_solicitation_response.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/error.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/error_list.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_schema_response.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_schema_response__links.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__embedded.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__links.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__embedded.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__links.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/link_object.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/schema.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/models/solicitations_action.rb delete mode 100644 vendor/solicitations/lib/sp_solicitations/version.rb delete mode 100644 vendor/solicitations/sp_solicitations.gemspec delete mode 100644 vendor/uploads_2020/.gitignore delete mode 100644 vendor/uploads_2020/.rspec delete mode 100644 vendor/uploads_2020/.rubocop.yml delete mode 100644 vendor/uploads_2020/.swagger-codegen-ignore delete mode 100644 vendor/uploads_2020/.swagger-codegen/VERSION delete mode 100644 vendor/uploads_2020/Gemfile delete mode 100644 vendor/uploads_2020/README.md delete mode 100644 vendor/uploads_2020/Rakefile delete mode 100644 vendor/uploads_2020/git_push.sh delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/api/uploads_api.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/api_client.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/api_error.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/configuration.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/models/create_upload_destination_response.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/models/error.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/models/error_list.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/models/upload_destination.rb delete mode 100644 vendor/uploads_2020/lib/sp_uploads_2020/version.rb delete mode 100644 vendor/uploads_2020/sp_uploads_2020.gemspec delete mode 100644 vendor/vdf_payments_v1/.gitignore delete mode 100644 vendor/vdf_payments_v1/.rspec delete mode 100644 vendor/vdf_payments_v1/.rubocop.yml delete mode 100644 vendor/vdf_payments_v1/.swagger-codegen-ignore delete mode 100644 vendor/vdf_payments_v1/.swagger-codegen/VERSION delete mode 100644 vendor/vdf_payments_v1/Gemfile delete mode 100644 vendor/vdf_payments_v1/README.md delete mode 100644 vendor/vdf_payments_v1/Rakefile delete mode 100644 vendor/vdf_payments_v1/git_push.sh delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api/vendor_invoice_api.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_client.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_error.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/configuration.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/additional_details.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/address.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/charge_details.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/decimal.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error_list.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_detail.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_item.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/item_quantity.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/money.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/party_identification.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_request.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_response.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_detail.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_registration_detail.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/transaction_reference.rb delete mode 100644 vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/version.rb delete mode 100644 vendor/vdf_payments_v1/sp_vdf_payments_v1.gemspec delete mode 100644 vendor/vdf_transactions_v1/.gitignore delete mode 100644 vendor/vdf_transactions_v1/.rspec delete mode 100644 vendor/vdf_transactions_v1/.rubocop.yml delete mode 100644 vendor/vdf_transactions_v1/.swagger-codegen-ignore delete mode 100644 vendor/vdf_transactions_v1/.swagger-codegen/VERSION delete mode 100644 vendor/vdf_transactions_v1/Gemfile delete mode 100644 vendor/vdf_transactions_v1/README.md delete mode 100644 vendor/vdf_transactions_v1/Rakefile delete mode 100644 vendor/vdf_transactions_v1/git_push.sh delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api/vendor_transaction_api.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_client.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_error.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/configuration.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error_list.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/get_transaction_response.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction_status.rb delete mode 100644 vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/version.rb delete mode 100644 vendor/vdf_transactions_v1/sp_vdf_transactions_v1.gemspec diff --git a/lib/amazon_sp_clients/sp_catalog_items_2020.rb b/lib/amazon_sp_clients/sp_catalog_items_2020.rb deleted file mode 100644 index 5ab4b84..0000000 --- a/lib/amazon_sp_clients/sp_catalog_items_2020.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/catalog_items_2020/lib/sp_catalog_items_2020.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_catalog_items_v0.rb b/lib/amazon_sp_clients/sp_catalog_items_v0.rb deleted file mode 100644 index 7b88bda..0000000 --- a/lib/amazon_sp_clients/sp_catalog_items_v0.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/catalog_items_v0/lib/sp_catalog_items_v0.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_fba_inbound.rb b/lib/amazon_sp_clients/sp_fba_inbound.rb deleted file mode 100644 index c2798ce..0000000 --- a/lib/amazon_sp_clients/sp_fba_inbound.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/fba_inbound/lib/sp_fba_inbound.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_fulfillment_inbound_v0.rb b/lib/amazon_sp_clients/sp_fulfillment_inbound_v0.rb deleted file mode 100644 index cef1e1b..0000000 --- a/lib/amazon_sp_clients/sp_fulfillment_inbound_v0.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_merchant_fulfillment_v0.rb b/lib/amazon_sp_clients/sp_merchant_fulfillment_v0.rb deleted file mode 100644 index 4dc20c4..0000000 --- a/lib/amazon_sp_clients/sp_merchant_fulfillment_v0.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_messaging.rb b/lib/amazon_sp_clients/sp_messaging.rb deleted file mode 100644 index 43e332b..0000000 --- a/lib/amazon_sp_clients/sp_messaging.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/messaging/lib/sp_messaging.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_notifications.rb b/lib/amazon_sp_clients/sp_notifications.rb deleted file mode 100644 index ded1c9f..0000000 --- a/lib/amazon_sp_clients/sp_notifications.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/notifications/lib/sp_notifications.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_product_fees_v0.rb b/lib/amazon_sp_clients/sp_product_fees_v0.rb deleted file mode 100644 index 9401ba5..0000000 --- a/lib/amazon_sp_clients/sp_product_fees_v0.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/product_fees_v0/lib/sp_product_fees_v0.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_product_pricing_v0.rb b/lib/amazon_sp_clients/sp_product_pricing_v0.rb deleted file mode 100644 index 6f41e85..0000000 --- a/lib/amazon_sp_clients/sp_product_pricing_v0.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/product_pricing_v0/lib/sp_product_pricing_v0.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_sales.rb b/lib/amazon_sp_clients/sp_sales.rb deleted file mode 100644 index 71bf3af..0000000 --- a/lib/amazon_sp_clients/sp_sales.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/sales/lib/sp_sales.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_sellers.rb b/lib/amazon_sp_clients/sp_sellers.rb deleted file mode 100644 index d517882..0000000 --- a/lib/amazon_sp_clients/sp_sellers.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/sellers/lib/sp_sellers.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_services.rb b/lib/amazon_sp_clients/sp_services.rb deleted file mode 100644 index 3ef32f8..0000000 --- a/lib/amazon_sp_clients/sp_services.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/services/lib/sp_services.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_shipping.rb b/lib/amazon_sp_clients/sp_shipping.rb deleted file mode 100644 index 4dca02b..0000000 --- a/lib/amazon_sp_clients/sp_shipping.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/shipping/lib/sp_shipping.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_solicitations.rb b/lib/amazon_sp_clients/sp_solicitations.rb deleted file mode 100644 index ecbfd7d..0000000 --- a/lib/amazon_sp_clients/sp_solicitations.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/solicitations/lib/sp_solicitations.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_uploads_2020.rb b/lib/amazon_sp_clients/sp_uploads_2020.rb deleted file mode 100644 index 2d1892b..0000000 --- a/lib/amazon_sp_clients/sp_uploads_2020.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/uploads_2020/lib/sp_uploads_2020.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_vdf_payments_v1.rb b/lib/amazon_sp_clients/sp_vdf_payments_v1.rb deleted file mode 100644 index d53a215..0000000 --- a/lib/amazon_sp_clients/sp_vdf_payments_v1.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/vdf_payments_v1/lib/sp_vdf_payments_v1.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/lib/amazon_sp_clients/sp_vdf_transactions_v1.rb b/lib/amazon_sp_clients/sp_vdf_transactions_v1.rb deleted file mode 100644 index 602da8f..0000000 --- a/lib/amazon_sp_clients/sp_vdf_transactions_v1.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# This file was autogenerated, do not edit it - -require_relative "../../vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1.rb" - -module AmazonSpClients -end \ No newline at end of file diff --git a/vendor/catalog_items_2020/.gitignore b/vendor/catalog_items_2020/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/catalog_items_2020/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/catalog_items_2020/.rspec b/vendor/catalog_items_2020/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/catalog_items_2020/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/catalog_items_2020/.rubocop.yml b/vendor/catalog_items_2020/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/catalog_items_2020/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/catalog_items_2020/.swagger-codegen-ignore b/vendor/catalog_items_2020/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/catalog_items_2020/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/catalog_items_2020/.swagger-codegen/VERSION b/vendor/catalog_items_2020/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/catalog_items_2020/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/catalog_items_2020/Gemfile b/vendor/catalog_items_2020/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/catalog_items_2020/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/catalog_items_2020/README.md b/vendor/catalog_items_2020/README.md deleted file mode 100644 index 557cef1..0000000 --- a/vendor/catalog_items_2020/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# sp_catalog_items_2020 - -SpCatalogItems2020 - the Ruby gem for the Selling Partner API for Catalog Items - -The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2020-12-01 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_catalog_items_2020.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_catalog_items_2020-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_catalog_items_2020-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_catalog_items_2020', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_catalog_items_2020', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_catalog_items_2020' - -api_instance = SpCatalogItems2020::CatalogApi.new -asin = 'asin_example' # String | The Amazon Standard Identification Number (ASIN) of the item. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces. -opts = { - included_data: ['included_data_example'], # Array | A comma-delimited list of data sets to include in the response. Default: summaries. - locale: 'locale_example' # String | Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. -} - -begin - result = api_instance.get_catalog_item(asin, marketplace_ids, opts) - p result -rescue SpCatalogItems2020::ApiError => e - puts "Exception when calling CatalogApi->get_catalog_item: #{e}" -end - -api_instance = SpCatalogItems2020::CatalogApi.new -keywords = ['keywords_example'] # Array | A comma-delimited list of words or item identifiers to search the Amazon catalog for. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - included_data: ['included_data_example'], # Array | A comma-delimited list of data sets to include in the response. Default: summaries. - brand_names: ['brand_names_example'], # Array | A comma-delimited list of brand names to limit the search to. - classification_ids: ['classification_ids_example'], # Array | A comma-delimited list of classification identifiers to limit the search to. - page_size: 10, # Integer | Number of results to be returned per page. - page_token: 'page_token_example', # String | A token to fetch a certain page when there are multiple pages worth of results. - keywords_locale: 'keywords_locale_example', # String | The language the keywords are provided in. Defaults to the primary locale of the marketplace. - locale: 'locale_example' # String | Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. -} - -begin - result = api_instance.search_catalog_items(keywords, marketplace_ids, opts) - p result -rescue SpCatalogItems2020::ApiError => e - puts "Exception when calling CatalogApi->search_catalog_items: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpCatalogItems2020::CatalogApi* | [**get_catalog_item**](docs/CatalogApi.md#get_catalog_item) | **GET** /catalog/2020-12-01/items/{asin} | -*SpCatalogItems2020::CatalogApi* | [**search_catalog_items**](docs/CatalogApi.md#search_catalog_items) | **GET** /catalog/2020-12-01/items | - -## Documentation for Models - - - [SpCatalogItems2020::BrandRefinement](docs/BrandRefinement.md) - - [SpCatalogItems2020::ClassificationRefinement](docs/ClassificationRefinement.md) - - [SpCatalogItems2020::Error](docs/Error.md) - - [SpCatalogItems2020::ErrorList](docs/ErrorList.md) - - [SpCatalogItems2020::Item](docs/Item.md) - - [SpCatalogItems2020::ItemAsin](docs/ItemAsin.md) - - [SpCatalogItems2020::ItemAttributes](docs/ItemAttributes.md) - - [SpCatalogItems2020::ItemIdentifier](docs/ItemIdentifier.md) - - [SpCatalogItems2020::ItemIdentifiers](docs/ItemIdentifiers.md) - - [SpCatalogItems2020::ItemIdentifiersByMarketplace](docs/ItemIdentifiersByMarketplace.md) - - [SpCatalogItems2020::ItemImage](docs/ItemImage.md) - - [SpCatalogItems2020::ItemImages](docs/ItemImages.md) - - [SpCatalogItems2020::ItemImagesByMarketplace](docs/ItemImagesByMarketplace.md) - - [SpCatalogItems2020::ItemProductTypeByMarketplace](docs/ItemProductTypeByMarketplace.md) - - [SpCatalogItems2020::ItemProductTypes](docs/ItemProductTypes.md) - - [SpCatalogItems2020::ItemSalesRank](docs/ItemSalesRank.md) - - [SpCatalogItems2020::ItemSalesRanks](docs/ItemSalesRanks.md) - - [SpCatalogItems2020::ItemSalesRanksByMarketplace](docs/ItemSalesRanksByMarketplace.md) - - [SpCatalogItems2020::ItemSearchResults](docs/ItemSearchResults.md) - - [SpCatalogItems2020::ItemSummaries](docs/ItemSummaries.md) - - [SpCatalogItems2020::ItemSummaryByMarketplace](docs/ItemSummaryByMarketplace.md) - - [SpCatalogItems2020::ItemVariations](docs/ItemVariations.md) - - [SpCatalogItems2020::ItemVariationsByMarketplace](docs/ItemVariationsByMarketplace.md) - - [SpCatalogItems2020::ItemVendorDetails](docs/ItemVendorDetails.md) - - [SpCatalogItems2020::ItemVendorDetailsByMarketplace](docs/ItemVendorDetailsByMarketplace.md) - - [SpCatalogItems2020::Pagination](docs/Pagination.md) - - [SpCatalogItems2020::Refinements](docs/Refinements.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/catalog_items_2020/Rakefile b/vendor/catalog_items_2020/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/catalog_items_2020/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/catalog_items_2020/git_push.sh b/vendor/catalog_items_2020/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/catalog_items_2020/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020.rb deleted file mode 100644 index 83fd2ee..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020.rb +++ /dev/null @@ -1,103 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_catalog_items_2020/api_client' -# require 'sp_catalog_items_2020/api_error' -# require 'sp_catalog_items_2020/version' -# require 'sp_catalog_items_2020/configuration' - -# Models -# -# -# require_relative './sp_catalog_items_2020/models/brand_refinement' -# -# -# require_relative './sp_catalog_items_2020/models/classification_refinement' -# -# -# require_relative './sp_catalog_items_2020/models/error' -# -# -# require_relative './sp_catalog_items_2020/models/error_list' -# -# -# require_relative './sp_catalog_items_2020/models/item' -# -# -# require_relative './sp_catalog_items_2020/models/item_asin' -# -# -# require_relative './sp_catalog_items_2020/models/item_attributes' -# -# -# require_relative './sp_catalog_items_2020/models/item_identifier' -# -# -# require_relative './sp_catalog_items_2020/models/item_identifiers' -# -# -# require_relative './sp_catalog_items_2020/models/item_identifiers_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_image' -# -# -# require_relative './sp_catalog_items_2020/models/item_images' -# -# -# require_relative './sp_catalog_items_2020/models/item_images_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_product_type_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_product_types' -# -# -# require_relative './sp_catalog_items_2020/models/item_sales_rank' -# -# -# require_relative './sp_catalog_items_2020/models/item_sales_ranks' -# -# -# require_relative './sp_catalog_items_2020/models/item_sales_ranks_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_search_results' -# -# -# require_relative './sp_catalog_items_2020/models/item_summaries' -# -# -# require_relative './sp_catalog_items_2020/models/item_summary_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_variations' -# -# -# require_relative './sp_catalog_items_2020/models/item_variations_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/item_vendor_details' -# -# -# require_relative './sp_catalog_items_2020/models/item_vendor_details_by_marketplace' -# -# -# require_relative './sp_catalog_items_2020/models/pagination' -# -# -# require_relative './sp_catalog_items_2020/models/refinements' -# - -# APIs -require_relative './sp_catalog_items_2020/api/catalog_api' diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api/catalog_api.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api/catalog_api.rb deleted file mode 100644 index f2f89db..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api/catalog_api.rb +++ /dev/null @@ -1,178 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItems2020 - class CatalogApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces. - # @param [Hash] opts the optional parameters - # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: summaries. - # @option opts [String] :locale Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. - # @return [Item] - def get_catalog_item(asin, marketplace_ids, opts = {}) - data = get_catalog_item_with_http_info(asin, marketplace_ids, opts) - return data - end - - # Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces. - # @param [Hash] opts the optional parameters - # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: summaries. - # @option opts [String] :locale Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. - # @return [Array<(Item)>] Item data, response status code and response headers - def get_catalog_item_with_http_info(asin, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogApi.get_catalog_item ...' - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling CatalogApi.get_catalog_item" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling CatalogApi.get_catalog_item" - end - if @api_client.config.client_side_validation && opts[:'included_data'] && !opts[:'included_data'].all? { |item| ['attributes', 'identifiers', 'images', 'productTypes', 'salesRanks', 'summaries', 'variations', 'vendorDetails'].include?(item) } - fail ArgumentError, 'invalid value for "included_data", must include one of attributes, identifiers, images, productTypes, salesRanks, summaries, variations, vendorDetails' - end - # resource path - local_var_path = '/catalog/2020-12-01/items/{asin}'.sub('{' + 'asin' + '}', asin.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'includedData'] = @api_client.build_collection_param(opts[:'included_data'], :csv) if !opts[:'included_data'].nil? - query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogApi#get_catalog_item\nData: #{data.inspect}" - end - return data - end - # Search for and return a list of Amazon catalog items and associated information. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param keywords A comma-delimited list of words or item identifiers to search the Amazon catalog for. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. - # @param [Hash] opts the optional parameters - # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: summaries. - # @option opts [Array] :brand_names A comma-delimited list of brand names to limit the search to. - # @option opts [Array] :classification_ids A comma-delimited list of classification identifiers to limit the search to. - # @option opts [Integer] :page_size Number of results to be returned per page. (default to 10) - # @option opts [String] :page_token A token to fetch a certain page when there are multiple pages worth of results. - # @option opts [String] :keywords_locale The language the keywords are provided in. Defaults to the primary locale of the marketplace. - # @option opts [String] :locale Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. - # @return [ItemSearchResults] - def search_catalog_items(keywords, marketplace_ids, opts = {}) - data = search_catalog_items_with_http_info(keywords, marketplace_ids, opts) - return data - end - - # Search for and return a list of Amazon catalog items and associated information. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param keywords A comma-delimited list of words or item identifiers to search the Amazon catalog for. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. - # @param [Hash] opts the optional parameters - # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: summaries. - # @option opts [Array] :brand_names A comma-delimited list of brand names to limit the search to. - # @option opts [Array] :classification_ids A comma-delimited list of classification identifiers to limit the search to. - # @option opts [Integer] :page_size Number of results to be returned per page. - # @option opts [String] :page_token A token to fetch a certain page when there are multiple pages worth of results. - # @option opts [String] :keywords_locale The language the keywords are provided in. Defaults to the primary locale of the marketplace. - # @option opts [String] :locale Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace. - # @return [Array<(ItemSearchResults)>] ItemSearchResults data, response status code and response headers - def search_catalog_items_with_http_info(keywords, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogApi.search_catalog_items ...' - end - # verify the required parameter 'keywords' is set - if @api_client.config.client_side_validation && keywords.nil? - fail ArgumentError, "Missing the required parameter 'keywords' when calling CatalogApi.search_catalog_items" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling CatalogApi.search_catalog_items" - end - if @api_client.config.client_side_validation && opts[:'included_data'] && !opts[:'included_data'].all? { |item| ['identifiers', 'images', 'productTypes', 'salesRanks', 'summaries', 'variations', 'vendorDetails'].include?(item) } - fail ArgumentError, 'invalid value for "included_data", must include one of identifiers, images, productTypes, salesRanks, summaries, variations, vendorDetails' - end - # resource path - local_var_path = '/catalog/2020-12-01/items' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'keywords'] = @api_client.build_collection_param(keywords, :csv) - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'includedData'] = @api_client.build_collection_param(opts[:'included_data'], :csv) if !opts[:'included_data'].nil? - query_params[:'brandNames'] = @api_client.build_collection_param(opts[:'brand_names'], :csv) if !opts[:'brand_names'].nil? - query_params[:'classificationIds'] = @api_client.build_collection_param(opts[:'classification_ids'], :csv) if !opts[:'classification_ids'].nil? - query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? - query_params[:'keywordsLocale'] = opts[:'keywords_locale'] if !opts[:'keywords_locale'].nil? - query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogApi#search_catalog_items\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_client.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_client.rb deleted file mode 100644 index fdd37ee..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpCatalogItems2020 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpCatalogItems2020.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_error.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_error.rb deleted file mode 100644 index b2b203c..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItems2020 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/configuration.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/configuration.rb deleted file mode 100644 index 460d889..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItems2020 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/brand_refinement.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/brand_refinement.rb deleted file mode 100644 index 2e8f2c6..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/brand_refinement.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Description of a brand that can be used to get more fine-grained search results. - class BrandRefinement - # The estimated number of results that would still be returned if refinement key applied. - attr_accessor :number_of_results - - # Brand name. For display and can be used as a search refinement. - attr_accessor :brand_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number_of_results' => :'numberOfResults', - :'brand_name' => :'brandName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'number_of_results' => :'Object', - :'brand_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::BrandRefinement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::BrandRefinement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number_of_results') - self.number_of_results = attributes[:'number_of_results'] - end - - if attributes.key?(:'brand_name') - self.brand_name = attributes[:'brand_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @number_of_results.nil? - invalid_properties.push('invalid value for "number_of_results", number_of_results cannot be nil.') - end - - if @brand_name.nil? - invalid_properties.push('invalid value for "brand_name", brand_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @number_of_results.nil? - return false if @brand_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number_of_results == o.number_of_results && - brand_name == o.brand_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number_of_results, brand_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/classification_refinement.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/classification_refinement.rb deleted file mode 100644 index e97d88b..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/classification_refinement.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Description of a classification that can be used to get more fine-grained search results. - class ClassificationRefinement - # The estimated number of results that would still be returned if refinement key applied. - attr_accessor :number_of_results - - # Display name for the classification. - attr_accessor :display_name - - # Identifier for the classification that can be used for search refinement purposes. - attr_accessor :classification_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number_of_results' => :'numberOfResults', - :'display_name' => :'displayName', - :'classification_id' => :'classificationId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'number_of_results' => :'Object', - :'display_name' => :'Object', - :'classification_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ClassificationRefinement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ClassificationRefinement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number_of_results') - self.number_of_results = attributes[:'number_of_results'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'classification_id') - self.classification_id = attributes[:'classification_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @number_of_results.nil? - invalid_properties.push('invalid value for "number_of_results", number_of_results cannot be nil.') - end - - if @display_name.nil? - invalid_properties.push('invalid value for "display_name", display_name cannot be nil.') - end - - if @classification_id.nil? - invalid_properties.push('invalid value for "classification_id", classification_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @number_of_results.nil? - return false if @display_name.nil? - return false if @classification_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number_of_results == o.number_of_results && - display_name == o.display_name && - classification_id == o.classification_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number_of_results, display_name, classification_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error.rb deleted file mode 100644 index 037d277..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error_list.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error_list.rb deleted file mode 100644 index e04f495..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/error_list.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item.rb deleted file mode 100644 index 9edf46f..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # An item in the Amazon catalog. - class Item - attr_accessor :asin - - attr_accessor :attributes - - attr_accessor :identifiers - - attr_accessor :images - - attr_accessor :product_types - - attr_accessor :sales_ranks - - attr_accessor :summaries - - attr_accessor :variations - - attr_accessor :vendor_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'asin', - :'attributes' => :'attributes', - :'identifiers' => :'identifiers', - :'images' => :'images', - :'product_types' => :'productTypes', - :'sales_ranks' => :'salesRanks', - :'summaries' => :'summaries', - :'variations' => :'variations', - :'vendor_details' => :'vendorDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'attributes' => :'Object', - :'identifiers' => :'Object', - :'images' => :'Object', - :'product_types' => :'Object', - :'sales_ranks' => :'Object', - :'summaries' => :'Object', - :'variations' => :'Object', - :'vendor_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'identifiers') - self.identifiers = attributes[:'identifiers'] - end - - if attributes.key?(:'images') - self.images = attributes[:'images'] - end - - if attributes.key?(:'product_types') - self.product_types = attributes[:'product_types'] - end - - if attributes.key?(:'sales_ranks') - self.sales_ranks = attributes[:'sales_ranks'] - end - - if attributes.key?(:'summaries') - self.summaries = attributes[:'summaries'] - end - - if attributes.key?(:'variations') - self.variations = attributes[:'variations'] - end - - if attributes.key?(:'vendor_details') - self.vendor_details = attributes[:'vendor_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asin.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - attributes == o.attributes && - identifiers == o.identifiers && - images == o.images && - product_types == o.product_types && - sales_ranks == o.sales_ranks && - summaries == o.summaries && - variations == o.variations && - vendor_details == o.vendor_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, attributes, identifiers, images, product_types, sales_ranks, summaries, variations, vendor_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_asin.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_asin.rb deleted file mode 100644 index a2e1758..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_asin.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Amazon Standard Identification Number (ASIN) is the unique identifier for an item in the Amazon catalog. - class ItemAsin - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemAsin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemAsin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_attributes.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_attributes.rb deleted file mode 100644 index 3c5b60a..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_attributes.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # A JSON object that contains structured item attribute data keyed by attribute name. Catalog item attributes are available only to brand owners and conform to the related product type definitions available in the Selling Partner API for Product Type Definitions. - class ItemAttributes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifier.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifier.rb deleted file mode 100644 index 697c759..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifier.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Identifier associated with the item in the Amazon catalog, such as a UPC or EAN identifier. - class ItemIdentifier - # Type of identifier, such as UPC, EAN, or ISBN. - attr_accessor :identifier_type - - # Identifier. - attr_accessor :identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identifier_type' => :'identifierType', - :'identifier' => :'identifier' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'identifier_type' => :'Object', - :'identifier' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identifier_type') - self.identifier_type = attributes[:'identifier_type'] - end - - if attributes.key?(:'identifier') - self.identifier = attributes[:'identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identifier_type.nil? - invalid_properties.push('invalid value for "identifier_type", identifier_type cannot be nil.') - end - - if @identifier.nil? - invalid_properties.push('invalid value for "identifier", identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identifier_type.nil? - return false if @identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identifier_type == o.identifier_type && - identifier == o.identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identifier_type, identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers.rb deleted file mode 100644 index f986aac..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Identifiers associated with the item in the Amazon catalog, such as UPC and EAN identifiers. - class ItemIdentifiers - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemIdentifiers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemIdentifiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers_by_marketplace.rb deleted file mode 100644 index 34c6d9b..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_identifiers_by_marketplace.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Identifiers associated with the item in the Amazon catalog for the indicated Amazon marketplace. - class ItemIdentifiersByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Identifiers associated with the item in the Amazon catalog for the indicated Amazon marketplace. - attr_accessor :identifiers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'identifiers' => :'identifiers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'identifiers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemIdentifiersByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemIdentifiersByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'identifiers') - if (value = attributes[:'identifiers']).is_a?(Array) - self.identifiers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @identifiers.nil? - invalid_properties.push('invalid value for "identifiers", identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - identifiers == o.identifiers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, identifiers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_image.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_image.rb deleted file mode 100644 index 0b9774c..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_image.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Image for an item in the Amazon catalog. - class ItemImage - # Variant of the image, such as MAIN or PT01. - attr_accessor :variant - - # Link, or URL, for the image. - attr_accessor :link - - # Height of the image in pixels. - attr_accessor :height - - # Width of the image in pixels. - attr_accessor :width - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'variant' => :'variant', - :'link' => :'link', - :'height' => :'height', - :'width' => :'width' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'variant' => :'Object', - :'link' => :'Object', - :'height' => :'Object', - :'width' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemImage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemImage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'variant') - self.variant = attributes[:'variant'] - end - - if attributes.key?(:'link') - self.link = attributes[:'link'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @variant.nil? - invalid_properties.push('invalid value for "variant", variant cannot be nil.') - end - - if @link.nil? - invalid_properties.push('invalid value for "link", link cannot be nil.') - end - - if @height.nil? - invalid_properties.push('invalid value for "height", height cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @variant.nil? - variant_validator = EnumAttributeValidator.new('Object', ['MAIN', 'PT01', 'PT02', 'PT03', 'PT04', 'PT05', 'PT06', 'PT07', 'PT08', 'SWCH']) - return false unless variant_validator.valid?(@variant) - return false if @link.nil? - return false if @height.nil? - return false if @width.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] variant Object to be assigned - def variant=(variant) - validator = EnumAttributeValidator.new('Object', ['MAIN', 'PT01', 'PT02', 'PT03', 'PT04', 'PT05', 'PT06', 'PT07', 'PT08', 'SWCH']) - unless validator.valid?(variant) - fail ArgumentError, "invalid value for \"variant\", must be one of #{validator.allowable_values}." - end - @variant = variant - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - variant == o.variant && - link == o.link && - height == o.height && - width == o.width - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [variant, link, height, width].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images.rb deleted file mode 100644 index 4383503..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Images for an item in the Amazon catalog. All image variants are provided to brand owners. Otherwise, a thumbnail of the \"MAIN\" image variant is provided. - class ItemImages - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemImages` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemImages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images_by_marketplace.rb deleted file mode 100644 index 96fc751..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_images_by_marketplace.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Images for an item in the Amazon catalog for the indicated Amazon marketplace. - class ItemImagesByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Images for an item in the Amazon catalog for the indicated Amazon marketplace. - attr_accessor :images - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'images' => :'images' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'images' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemImagesByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemImagesByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'images') - if (value = attributes[:'images']).is_a?(Array) - self.images = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @images.nil? - invalid_properties.push('invalid value for "images", images cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @images.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - images == o.images - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, images].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_type_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_type_by_marketplace.rb deleted file mode 100644 index c104205..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_type_by_marketplace.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Product type associated with the Amazon catalog item for the indicated Amazon marketplace. - class ItemProductTypeByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Name of the product type associated with the Amazon catalog item. - attr_accessor :product_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'product_type' => :'productType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'product_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemProductTypeByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemProductTypeByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'product_type') - self.product_type = attributes[:'product_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - product_type == o.product_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, product_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_types.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_types.rb deleted file mode 100644 index dc4430f..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_product_types.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Product types associated with the Amazon catalog item. - class ItemProductTypes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemProductTypes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemProductTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_rank.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_rank.rb deleted file mode 100644 index 55e2c42..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_rank.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Sales rank of an Amazon catalog item. - class ItemSalesRank - # Title, or name, of the sales rank. - attr_accessor :title - - # Corresponding Amazon retail website link, or URL, for the sales rank. - attr_accessor :link - - # Sales rank value. - attr_accessor :rank - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'title' => :'title', - :'link' => :'link', - :'rank' => :'rank' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'title' => :'Object', - :'link' => :'Object', - :'rank' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSalesRank` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSalesRank`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'link') - self.link = attributes[:'link'] - end - - if attributes.key?(:'rank') - self.rank = attributes[:'rank'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - if @rank.nil? - invalid_properties.push('invalid value for "rank", rank cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @title.nil? - return false if @rank.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - title == o.title && - link == o.link && - rank == o.rank - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [title, link, rank].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks.rb deleted file mode 100644 index d2a780a..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Sales ranks of an Amazon catalog item. - class ItemSalesRanks - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSalesRanks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSalesRanks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks_by_marketplace.rb deleted file mode 100644 index b8660df..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_sales_ranks_by_marketplace.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Sales ranks of an Amazon catalog item for the indicated Amazon marketplace. - class ItemSalesRanksByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Sales ranks of an Amazon catalog item for an Amazon marketplace. - attr_accessor :ranks - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'ranks' => :'ranks' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'ranks' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSalesRanksByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSalesRanksByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'ranks') - if (value = attributes[:'ranks']).is_a?(Array) - self.ranks = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @ranks.nil? - invalid_properties.push('invalid value for "ranks", ranks cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @ranks.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - ranks == o.ranks - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, ranks].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_search_results.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_search_results.rb deleted file mode 100644 index 9c34b1f..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_search_results.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Items in the Amazon catalog and search related metadata. - class ItemSearchResults - # The estimated total number of products matched by the search query (only results up to the page count limit will be returned per request regardless of the number found). Note: The maximum number of items (ASINs) that can be returned and paged through is 1000. - attr_accessor :number_of_results - - attr_accessor :pagination - - attr_accessor :refinements - - # A list of items from the Amazon catalog. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number_of_results' => :'numberOfResults', - :'pagination' => :'pagination', - :'refinements' => :'refinements', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'number_of_results' => :'Object', - :'pagination' => :'Object', - :'refinements' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSearchResults` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSearchResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number_of_results') - self.number_of_results = attributes[:'number_of_results'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'refinements') - self.refinements = attributes[:'refinements'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @number_of_results.nil? - invalid_properties.push('invalid value for "number_of_results", number_of_results cannot be nil.') - end - - if @pagination.nil? - invalid_properties.push('invalid value for "pagination", pagination cannot be nil.') - end - - if @refinements.nil? - invalid_properties.push('invalid value for "refinements", refinements cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @number_of_results.nil? - return false if @pagination.nil? - return false if @refinements.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number_of_results == o.number_of_results && - pagination == o.pagination && - refinements == o.refinements && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number_of_results, pagination, refinements, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summaries.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summaries.rb deleted file mode 100644 index 61577fe..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summaries.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Summary details of an Amazon catalog item. - class ItemSummaries - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSummaries` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSummaries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summary_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summary_by_marketplace.rb deleted file mode 100644 index 20b064b..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_summary_by_marketplace.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Summary details of an Amazon catalog item for the indicated Amazon marketplace. - class ItemSummaryByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Name of the brand associated with an Amazon catalog item. - attr_accessor :brand_name - - # Identifier of the browse node associated with an Amazon catalog item. - attr_accessor :browse_node - - # Name of the color associated with an Amazon catalog item. - attr_accessor :color_name - - # Name, or title, associated with an Amazon catalog item. - attr_accessor :item_name - - # Name of the manufacturer associated with an Amazon catalog item. - attr_accessor :manufacturer - - # Model number associated with an Amazon catalog item. - attr_accessor :model_number - - # Name of the size associated with an Amazon catalog item. - attr_accessor :size_name - - # Name of the style associated with an Amazon catalog item. - attr_accessor :style_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'brand_name' => :'brandName', - :'browse_node' => :'browseNode', - :'color_name' => :'colorName', - :'item_name' => :'itemName', - :'manufacturer' => :'manufacturer', - :'model_number' => :'modelNumber', - :'size_name' => :'sizeName', - :'style_name' => :'styleName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'brand_name' => :'Object', - :'browse_node' => :'Object', - :'color_name' => :'Object', - :'item_name' => :'Object', - :'manufacturer' => :'Object', - :'model_number' => :'Object', - :'size_name' => :'Object', - :'style_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemSummaryByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemSummaryByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'brand_name') - self.brand_name = attributes[:'brand_name'] - end - - if attributes.key?(:'browse_node') - self.browse_node = attributes[:'browse_node'] - end - - if attributes.key?(:'color_name') - self.color_name = attributes[:'color_name'] - end - - if attributes.key?(:'item_name') - self.item_name = attributes[:'item_name'] - end - - if attributes.key?(:'manufacturer') - self.manufacturer = attributes[:'manufacturer'] - end - - if attributes.key?(:'model_number') - self.model_number = attributes[:'model_number'] - end - - if attributes.key?(:'size_name') - self.size_name = attributes[:'size_name'] - end - - if attributes.key?(:'style_name') - self.style_name = attributes[:'style_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - brand_name == o.brand_name && - browse_node == o.browse_node && - color_name == o.color_name && - item_name == o.item_name && - manufacturer == o.manufacturer && - model_number == o.model_number && - size_name == o.size_name && - style_name == o.style_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, brand_name, browse_node, color_name, item_name, manufacturer, model_number, size_name, style_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations.rb deleted file mode 100644 index 0c80ad2..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Variation details by marketplace for an Amazon catalog item (variation relationships). - class ItemVariations - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemVariations` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemVariations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations_by_marketplace.rb deleted file mode 100644 index a439811..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_variations_by_marketplace.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Variation details for the Amazon catalog item for the indicated Amazon marketplace. - class ItemVariationsByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Identifiers (ASINs) of the related items. - attr_accessor :asins - - # Type of variation relationship of the Amazon catalog item in the request to the related item(s): \"PARENT\" or \"CHILD\". - attr_accessor :variation_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'asins' => :'asins', - :'variation_type' => :'variationType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asins' => :'Object', - :'variation_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemVariationsByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemVariationsByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asins') - if (value = attributes[:'asins']).is_a?(Array) - self.asins = value - end - end - - if attributes.key?(:'variation_type') - self.variation_type = attributes[:'variation_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @asins.nil? - invalid_properties.push('invalid value for "asins", asins cannot be nil.') - end - - if @variation_type.nil? - invalid_properties.push('invalid value for "variation_type", variation_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @asins.nil? - return false if @variation_type.nil? - variation_type_validator = EnumAttributeValidator.new('Object', ['PARENT', 'CHILD']) - return false unless variation_type_validator.valid?(@variation_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] variation_type Object to be assigned - def variation_type=(variation_type) - validator = EnumAttributeValidator.new('Object', ['PARENT', 'CHILD']) - unless validator.valid?(variation_type) - fail ArgumentError, "invalid value for \"variation_type\", must be one of #{validator.allowable_values}." - end - @variation_type = variation_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asins == o.asins && - variation_type == o.variation_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asins, variation_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details.rb deleted file mode 100644 index 81b52fb..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Vendor details associated with an Amazon catalog item. Vendor details are available to vendors only. - class ItemVendorDetails - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemVendorDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemVendorDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details_by_marketplace.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details_by_marketplace.rb deleted file mode 100644 index 5edceb7..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/item_vendor_details_by_marketplace.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Vendor details associated with an Amazon catalog item for the indicated Amazon marketplace. - class ItemVendorDetailsByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Brand code associated with an Amazon catalog item. - attr_accessor :brand_code - - # Product category associated with an Amazon catalog item. - attr_accessor :category_code - - # Manufacturer code associated with an Amazon catalog item. - attr_accessor :manufacturer_code - - # Parent vendor code of the manufacturer code. - attr_accessor :manufacturer_code_parent - - # Product group associated with an Amazon catalog item. - attr_accessor :product_group - - # Replenishment category associated with an Amazon catalog item. - attr_accessor :replenishment_category - - # Product subcategory associated with an Amazon catalog item. - attr_accessor :subcategory_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'brand_code' => :'brandCode', - :'category_code' => :'categoryCode', - :'manufacturer_code' => :'manufacturerCode', - :'manufacturer_code_parent' => :'manufacturerCodeParent', - :'product_group' => :'productGroup', - :'replenishment_category' => :'replenishmentCategory', - :'subcategory_code' => :'subcategoryCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'brand_code' => :'Object', - :'category_code' => :'Object', - :'manufacturer_code' => :'Object', - :'manufacturer_code_parent' => :'Object', - :'product_group' => :'Object', - :'replenishment_category' => :'Object', - :'subcategory_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::ItemVendorDetailsByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::ItemVendorDetailsByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'brand_code') - self.brand_code = attributes[:'brand_code'] - end - - if attributes.key?(:'category_code') - self.category_code = attributes[:'category_code'] - end - - if attributes.key?(:'manufacturer_code') - self.manufacturer_code = attributes[:'manufacturer_code'] - end - - if attributes.key?(:'manufacturer_code_parent') - self.manufacturer_code_parent = attributes[:'manufacturer_code_parent'] - end - - if attributes.key?(:'product_group') - self.product_group = attributes[:'product_group'] - end - - if attributes.key?(:'replenishment_category') - self.replenishment_category = attributes[:'replenishment_category'] - end - - if attributes.key?(:'subcategory_code') - self.subcategory_code = attributes[:'subcategory_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - replenishment_category_validator = EnumAttributeValidator.new('Object', ['ALLOCATED', 'BASIC_REPLENISHMENT', 'IN_SEASON', 'LIMITED_REPLENISHMENT', 'MANUFACTURER_OUT_OF_STOCK', 'NEW_PRODUCT', 'NON_REPLENISHABLE', 'NON_STOCKUPABLE', 'OBSOLETE', 'PLANNED_REPLENISHMENT']) - return false unless replenishment_category_validator.valid?(@replenishment_category) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] replenishment_category Object to be assigned - def replenishment_category=(replenishment_category) - validator = EnumAttributeValidator.new('Object', ['ALLOCATED', 'BASIC_REPLENISHMENT', 'IN_SEASON', 'LIMITED_REPLENISHMENT', 'MANUFACTURER_OUT_OF_STOCK', 'NEW_PRODUCT', 'NON_REPLENISHABLE', 'NON_STOCKUPABLE', 'OBSOLETE', 'PLANNED_REPLENISHMENT']) - unless validator.valid?(replenishment_category) - fail ArgumentError, "invalid value for \"replenishment_category\", must be one of #{validator.allowable_values}." - end - @replenishment_category = replenishment_category - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - brand_code == o.brand_code && - category_code == o.category_code && - manufacturer_code == o.manufacturer_code && - manufacturer_code_parent == o.manufacturer_code_parent && - product_group == o.product_group && - replenishment_category == o.replenishment_category && - subcategory_code == o.subcategory_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, brand_code, category_code, manufacturer_code, manufacturer_code_parent, product_group, replenishment_category, subcategory_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/pagination.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/pagination.rb deleted file mode 100644 index 60fe356..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/pagination.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # When a request produces a response that exceeds the pageSize, pagination occurs. This means the response is divided into individual pages. To retrieve the next page or the previous page, you must pass the nextToken value or the previousToken value as the pageToken parameter in the next request. When you receive the last page, there will be no nextToken key in the pagination object. - class Pagination - # A token that can be used to fetch the next page. - attr_accessor :next_token - - # A token that can be used to fetch the previous page. - attr_accessor :previous_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken', - :'previous_token' => :'previousToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object', - :'previous_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'previous_token') - self.previous_token = attributes[:'previous_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token && - previous_token == o.previous_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token, previous_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/refinements.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/refinements.rb deleted file mode 100644 index 056e42d..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/models/refinements.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItems2020 - # Search refinements. - class Refinements - # Brand search refinements. - attr_accessor :brands - - # Classification search refinements. - attr_accessor :classifications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'brands' => :'brands', - :'classifications' => :'classifications' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'brands' => :'Object', - :'classifications' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItems2020::Refinements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItems2020::Refinements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'brands') - if (value = attributes[:'brands']).is_a?(Array) - self.brands = value - end - end - - if attributes.key?(:'classifications') - if (value = attributes[:'classifications']).is_a?(Array) - self.classifications = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @brands.nil? - invalid_properties.push('invalid value for "brands", brands cannot be nil.') - end - - if @classifications.nil? - invalid_properties.push('invalid value for "classifications", classifications cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @brands.nil? - return false if @classifications.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - brands == o.brands && - classifications == o.classifications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [brands, classifications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItems2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/version.rb b/vendor/catalog_items_2020/lib/sp_catalog_items_2020/version.rb deleted file mode 100644 index 38f3f90..0000000 --- a/vendor/catalog_items_2020/lib/sp_catalog_items_2020/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpCatalogItems2020 - VERSION = '1.0.0' -end diff --git a/vendor/catalog_items_2020/sp_catalog_items_2020.gemspec b/vendor/catalog_items_2020/sp_catalog_items_2020.gemspec deleted file mode 100644 index 400e825..0000000 --- a/vendor/catalog_items_2020/sp_catalog_items_2020.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide). - -OpenAPI spec version: 2020-12-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_catalog_items_2020/version" - -Gem::Specification.new do |s| - s.name = "sp_catalog_items_2020" - s.version = SpCatalogItems2020::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Catalog Items Ruby Gem" - s.description = "The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2020-12-01-use-case-guide)." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/catalog_items_v0/.gitignore b/vendor/catalog_items_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/catalog_items_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/catalog_items_v0/.rspec b/vendor/catalog_items_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/catalog_items_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/catalog_items_v0/.rubocop.yml b/vendor/catalog_items_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/catalog_items_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/catalog_items_v0/.swagger-codegen-ignore b/vendor/catalog_items_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/catalog_items_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/catalog_items_v0/.swagger-codegen/VERSION b/vendor/catalog_items_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/catalog_items_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/catalog_items_v0/Gemfile b/vendor/catalog_items_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/catalog_items_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/catalog_items_v0/README.md b/vendor/catalog_items_v0/README.md deleted file mode 100644 index 844c825..0000000 --- a/vendor/catalog_items_v0/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# sp_catalog_items_v0 - -SpCatalogItemsV0 - the Ruby gem for the Selling Partner API for Catalog Items - -The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_catalog_items_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_catalog_items_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_catalog_items_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_catalog_items_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_catalog_items_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_catalog_items_v0' - -api_instance = SpCatalogItemsV0::CatalogApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for the item. -asin = 'asin_example' # String | The Amazon Standard Identification Number (ASIN) of the item. - - -begin - result = api_instance.get_catalog_item(marketplace_id, asin) - p result -rescue SpCatalogItemsV0::ApiError => e - puts "Exception when calling CatalogApi->get_catalog_item: #{e}" -end - -api_instance = SpCatalogItemsV0::CatalogApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for the item. -opts = { - asin: 'asin_example', # String | The Amazon Standard Identification Number (ASIN) of the item. - seller_sku: 'seller_sku_example' # String | Used to identify items in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. -} - -begin - result = api_instance.list_catalog_categories(marketplace_id, opts) - p result -rescue SpCatalogItemsV0::ApiError => e - puts "Exception when calling CatalogApi->list_catalog_categories: #{e}" -end - -api_instance = SpCatalogItemsV0::CatalogApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for which items are returned. -opts = { - query: 'query_example', # String | Keyword(s) to use to search for items in the catalog. Example: 'harry potter books'. - query_context_id: 'query_context_id_example', # String | An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. - seller_sku: 'seller_sku_example', # String | Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - upc: 'upc_example', # String | A 12-digit bar code used for retail packaging. - ean: 'ean_example', # String | A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. - isbn: 'isbn_example', # String | The unique commercial book identifier used to identify books internationally. - jan: 'jan_example' # String | A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. -} - -begin - result = api_instance.list_catalog_items(marketplace_id, opts) - p result -rescue SpCatalogItemsV0::ApiError => e - puts "Exception when calling CatalogApi->list_catalog_items: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpCatalogItemsV0::CatalogApi* | [**get_catalog_item**](docs/CatalogApi.md#get_catalog_item) | **GET** /catalog/v0/items/{asin} | -*SpCatalogItemsV0::CatalogApi* | [**list_catalog_categories**](docs/CatalogApi.md#list_catalog_categories) | **GET** /catalog/v0/categories | -*SpCatalogItemsV0::CatalogApi* | [**list_catalog_items**](docs/CatalogApi.md#list_catalog_items) | **GET** /catalog/v0/items | - -## Documentation for Models - - - [SpCatalogItemsV0::ASINIdentifier](docs/ASINIdentifier.md) - - [SpCatalogItemsV0::AttributeSetList](docs/AttributeSetList.md) - - [SpCatalogItemsV0::AttributeSetListType](docs/AttributeSetListType.md) - - [SpCatalogItemsV0::Categories](docs/Categories.md) - - [SpCatalogItemsV0::CreatorType](docs/CreatorType.md) - - [SpCatalogItemsV0::DecimalWithUnits](docs/DecimalWithUnits.md) - - [SpCatalogItemsV0::DimensionType](docs/DimensionType.md) - - [SpCatalogItemsV0::Error](docs/Error.md) - - [SpCatalogItemsV0::ErrorList](docs/ErrorList.md) - - [SpCatalogItemsV0::GetCatalogItemResponse](docs/GetCatalogItemResponse.md) - - [SpCatalogItemsV0::IdentifierType](docs/IdentifierType.md) - - [SpCatalogItemsV0::Image](docs/Image.md) - - [SpCatalogItemsV0::Item](docs/Item.md) - - [SpCatalogItemsV0::ItemList](docs/ItemList.md) - - [SpCatalogItemsV0::LanguageType](docs/LanguageType.md) - - [SpCatalogItemsV0::ListCatalogCategoriesResponse](docs/ListCatalogCategoriesResponse.md) - - [SpCatalogItemsV0::ListCatalogItemsResponse](docs/ListCatalogItemsResponse.md) - - [SpCatalogItemsV0::ListMatchingItemsResponse](docs/ListMatchingItemsResponse.md) - - [SpCatalogItemsV0::ListOfCategories](docs/ListOfCategories.md) - - [SpCatalogItemsV0::Price](docs/Price.md) - - [SpCatalogItemsV0::RelationshipList](docs/RelationshipList.md) - - [SpCatalogItemsV0::RelationshipType](docs/RelationshipType.md) - - [SpCatalogItemsV0::SalesRankList](docs/SalesRankList.md) - - [SpCatalogItemsV0::SalesRankType](docs/SalesRankType.md) - - [SpCatalogItemsV0::SellerSKUIdentifier](docs/SellerSKUIdentifier.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/catalog_items_v0/Rakefile b/vendor/catalog_items_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/catalog_items_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/catalog_items_v0/git_push.sh b/vendor/catalog_items_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/catalog_items_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0.rb deleted file mode 100644 index a959faf..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0.rb +++ /dev/null @@ -1,97 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_catalog_items_v0/api_client' -# require 'sp_catalog_items_v0/api_error' -# require 'sp_catalog_items_v0/version' -# require 'sp_catalog_items_v0/configuration' - -# Models -# -# -# require_relative './sp_catalog_items_v0/models/asin_identifier' -# -# -# require_relative './sp_catalog_items_v0/models/attribute_set_list' -# -# -# require_relative './sp_catalog_items_v0/models/attribute_set_list_type' -# -# -# require_relative './sp_catalog_items_v0/models/categories' -# -# -# require_relative './sp_catalog_items_v0/models/creator_type' -# -# -# require_relative './sp_catalog_items_v0/models/decimal_with_units' -# -# -# require_relative './sp_catalog_items_v0/models/dimension_type' -# -# -# require_relative './sp_catalog_items_v0/models/error' -# -# -# require_relative './sp_catalog_items_v0/models/error_list' -# -# -# require_relative './sp_catalog_items_v0/models/get_catalog_item_response' -# -# -# require_relative './sp_catalog_items_v0/models/identifier_type' -# -# -# require_relative './sp_catalog_items_v0/models/image' -# -# -# require_relative './sp_catalog_items_v0/models/item' -# -# -# require_relative './sp_catalog_items_v0/models/item_list' -# -# -# require_relative './sp_catalog_items_v0/models/language_type' -# -# -# require_relative './sp_catalog_items_v0/models/list_catalog_categories_response' -# -# -# require_relative './sp_catalog_items_v0/models/list_catalog_items_response' -# -# -# require_relative './sp_catalog_items_v0/models/list_matching_items_response' -# -# -# require_relative './sp_catalog_items_v0/models/list_of_categories' -# -# -# require_relative './sp_catalog_items_v0/models/price' -# -# -# require_relative './sp_catalog_items_v0/models/relationship_list' -# -# -# require_relative './sp_catalog_items_v0/models/relationship_type' -# -# -# require_relative './sp_catalog_items_v0/models/sales_rank_list' -# -# -# require_relative './sp_catalog_items_v0/models/sales_rank_type' -# -# -# require_relative './sp_catalog_items_v0/models/seller_sku_identifier' -# - -# APIs -require_relative './sp_catalog_items_v0/api/catalog_api' diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api/catalog_api.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api/catalog_api.rb deleted file mode 100644 index eb8cf1b..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api/catalog_api.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItemsV0 - class CatalogApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. - # @param marketplace_id A marketplace identifier. Specifies the marketplace for the item. - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @return [GetCatalogItemResponse] - def get_catalog_item(marketplace_id, asin, opts = {}) - data = get_catalog_item_with_http_info(marketplace_id, asin, opts) - return data - end - - # Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. - # @param marketplace_id A marketplace identifier. Specifies the marketplace for the item. - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @return [Array<(GetCatalogItemResponse)>] GetCatalogItemResponse data, response status code and response headers - def get_catalog_item_with_http_info(marketplace_id, asin, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogApi.get_catalog_item ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling CatalogApi.get_catalog_item" - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling CatalogApi.get_catalog_item" - end - # resource path - local_var_path = '/catalog/v0/items/{asin}'.sub('{' + 'asin' + '}', asin.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogApi#get_catalog_item\nData: #{data.inspect}" - end - return data - end - # Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for the item. - # @param [Hash] opts the optional parameters - # @option opts [String] :asin The Amazon Standard Identification Number (ASIN) of the item. - # @option opts [String] :seller_sku Used to identify items in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @return [ListCatalogCategoriesResponse] - def list_catalog_categories(marketplace_id, opts = {}) - data = list_catalog_categories_with_http_info(marketplace_id, opts) - return data - end - - # Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for the item. - # @param [Hash] opts the optional parameters - # @option opts [String] :asin The Amazon Standard Identification Number (ASIN) of the item. - # @option opts [String] :seller_sku Used to identify items in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @return [Array<(ListCatalogCategoriesResponse)>] ListCatalogCategoriesResponse data, response status code and response headers - def list_catalog_categories_with_http_info(marketplace_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogApi.list_catalog_categories ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling CatalogApi.list_catalog_categories" - end - # resource path - local_var_path = '/catalog/v0/categories' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ASIN'] = opts[:'asin'] if !opts[:'asin'].nil? - query_params[:'SellerSKU'] = opts[:'seller_sku'] if !opts[:'seller_sku'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogApi#list_catalog_categories\nData: #{data.inspect}" - end - return data - end - # Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which items are returned. - # @param [Hash] opts the optional parameters - # @option opts [String] :query Keyword(s) to use to search for items in the catalog. Example: 'harry potter books'. - # @option opts [String] :query_context_id An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. - # @option opts [String] :seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @option opts [String] :upc A 12-digit bar code used for retail packaging. - # @option opts [String] :ean A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. - # @option opts [String] :isbn The unique commercial book identifier used to identify books internationally. - # @option opts [String] :jan A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. - # @return [ListCatalogItemsResponse] - def list_catalog_items(marketplace_id, opts = {}) - data = list_catalog_items_with_http_info(marketplace_id, opts) - return data - end - - # Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which items are returned. - # @param [Hash] opts the optional parameters - # @option opts [String] :query Keyword(s) to use to search for items in the catalog. Example: 'harry potter books'. - # @option opts [String] :query_context_id An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. - # @option opts [String] :seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @option opts [String] :upc A 12-digit bar code used for retail packaging. - # @option opts [String] :ean A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. - # @option opts [String] :isbn The unique commercial book identifier used to identify books internationally. - # @option opts [String] :jan A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. - # @return [Array<(ListCatalogItemsResponse)>] ListCatalogItemsResponse data, response status code and response headers - def list_catalog_items_with_http_info(marketplace_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogApi.list_catalog_items ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling CatalogApi.list_catalog_items" - end - # resource path - local_var_path = '/catalog/v0/items' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'Query'] = opts[:'query'] if !opts[:'query'].nil? - query_params[:'QueryContextId'] = opts[:'query_context_id'] if !opts[:'query_context_id'].nil? - query_params[:'SellerSKU'] = opts[:'seller_sku'] if !opts[:'seller_sku'].nil? - query_params[:'UPC'] = opts[:'upc'] if !opts[:'upc'].nil? - query_params[:'EAN'] = opts[:'ean'] if !opts[:'ean'].nil? - query_params[:'ISBN'] = opts[:'isbn'] if !opts[:'isbn'].nil? - query_params[:'JAN'] = opts[:'jan'] if !opts[:'jan'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogApi#list_catalog_items\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_client.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_client.rb deleted file mode 100644 index 4855a92..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpCatalogItemsV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpCatalogItemsV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_error.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_error.rb deleted file mode 100644 index bced6c4..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItemsV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/configuration.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/configuration.rb deleted file mode 100644 index 4d25de4..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpCatalogItemsV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/asin_identifier.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/asin_identifier.rb deleted file mode 100644 index 4391e0d..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/asin_identifier.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class ASINIdentifier - # A marketplace identifier. - attr_accessor :marketplace_id - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'asin' => :'ASIN' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ASINIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ASINIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @asin.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list.rb deleted file mode 100644 index 093f7fb..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # A list of attributes for the item. - class AttributeSetList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::AttributeSetList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::AttributeSetList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list_type.rb deleted file mode 100644 index 23c3b09..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/attribute_set_list_type.rb +++ /dev/null @@ -1,1170 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The attributes of the item. - class AttributeSetListType - # The actor attributes of the item. - attr_accessor :actor - - # The artist attributes of the item. - attr_accessor :artist - - # The aspect ratio attribute of the item. - attr_accessor :aspect_ratio - - # The audience rating attribute of the item. - attr_accessor :audience_rating - - # The author attributes of the item. - attr_accessor :author - - # The back finding attribute of the item. - attr_accessor :back_finding - - # The band material type attribute of the item. - attr_accessor :band_material_type - - # The binding attribute of the item. - attr_accessor :binding - - # The Bluray region attribute of the item. - attr_accessor :bluray_region - - # The brand attribute of the item. - attr_accessor :brand - - # The CERO age rating attribute of the item. - attr_accessor :cero_age_rating - - # The chain type attribute of the item. - attr_accessor :chain_type - - # The clasp type attribute of the item. - attr_accessor :clasp_type - - # The color attribute of the item. - attr_accessor :color - - # The CPU manufacturer attribute of the item. - attr_accessor :cpu_manufacturer - - attr_accessor :cpu_speed - - # The CPU type attribute of the item. - attr_accessor :cpu_type - - # The creator attributes of the item. - attr_accessor :creator - - # The department attribute of the item. - attr_accessor :department - - # The director attributes of the item. - attr_accessor :director - - attr_accessor :display_size - - # The edition attribute of the item. - attr_accessor :edition - - # The episode sequence attribute of the item. - attr_accessor :episode_sequence - - # The ESRB age rating attribute of the item. - attr_accessor :esrb_age_rating - - # The feature attributes of the item - attr_accessor :feature - - # The flavor attribute of the item. - attr_accessor :flavor - - # The format attributes of the item. - attr_accessor :format - - # The gem type attributes of the item. - attr_accessor :gem_type - - # The genre attribute of the item. - attr_accessor :genre - - # The golf club flex attribute of the item. - attr_accessor :golf_club_flex - - attr_accessor :golf_club_loft - - # The hand orientation attribute of the item. - attr_accessor :hand_orientation - - # The hard disk interface attribute of the item. - attr_accessor :hard_disk_interface - - attr_accessor :hard_disk_size - - # The hardware platform attribute of the item. - attr_accessor :hardware_platform - - # The hazardous material type attribute of the item. - attr_accessor :hazardous_material_type - - attr_accessor :item_dimensions - - # The adult product attribute of the item. - attr_accessor :is_adult_product - - # The autographed attribute of the item. - attr_accessor :is_autographed - - # The is eligible for trade in attribute of the item. - attr_accessor :is_eligible_for_trade_in - - # The is memorabilia attribute of the item. - attr_accessor :is_memorabilia - - # The issues per year attribute of the item. - attr_accessor :issues_per_year - - # The item part number attribute of the item. - attr_accessor :item_part_number - - # The label attribute of the item. - attr_accessor :label - - # The languages attribute of the item. - attr_accessor :languages - - # The legal disclaimer attribute of the item. - attr_accessor :legal_disclaimer - - attr_accessor :list_price - - # The manufacturer attribute of the item. - attr_accessor :manufacturer - - attr_accessor :manufacturer_maximum_age - - attr_accessor :manufacturer_minimum_age - - # The manufacturer parts warranty description attribute of the item. - attr_accessor :manufacturer_parts_warranty_description - - # The material type attributes of the item. - attr_accessor :material_type - - attr_accessor :maximum_resolution - - # The media type attributes of the item. - attr_accessor :media_type - - # The metal stamp attribute of the item. - attr_accessor :metal_stamp - - # The metal type attribute of the item. - attr_accessor :metal_type - - # The model attribute of the item. - attr_accessor :model - - # The number of discs attribute of the item. - attr_accessor :number_of_discs - - # The number of issues attribute of the item. - attr_accessor :number_of_issues - - # The number of items attribute of the item. - attr_accessor :number_of_items - - # The number of pages attribute of the item. - attr_accessor :number_of_pages - - # The number of tracks attribute of the item. - attr_accessor :number_of_tracks - - # The operating system attributes of the item. - attr_accessor :operating_system - - attr_accessor :optical_zoom - - attr_accessor :package_dimensions - - # The package quantity attribute of the item. - attr_accessor :package_quantity - - # The part number attribute of the item. - attr_accessor :part_number - - # The PEGI rating attribute of the item. - attr_accessor :pegi_rating - - # The platform attributes of the item. - attr_accessor :platform - - # The processor count attribute of the item. - attr_accessor :processor_count - - # The product group attribute of the item. - attr_accessor :product_group - - # The product type name attribute of the item. - attr_accessor :product_type_name - - # The product type subcategory attribute of the item. - attr_accessor :product_type_subcategory - - # The publication date attribute of the item. - attr_accessor :publication_date - - # The publisher attribute of the item. - attr_accessor :publisher - - # The region code attribute of the item. - attr_accessor :region_code - - # The release date attribute of the item. - attr_accessor :release_date - - # The ring size attribute of the item. - attr_accessor :ring_size - - attr_accessor :running_time - - # The shaft material attribute of the item. - attr_accessor :shaft_material - - # The scent attribute of the item. - attr_accessor :scent - - # The season sequence attribute of the item. - attr_accessor :season_sequence - - # The Seikodo product code attribute of the item. - attr_accessor :seikodo_product_code - - # The size attribute of the item. - attr_accessor :size - - # The size per pearl attribute of the item. - attr_accessor :size_per_pearl - - attr_accessor :small_image - - # The studio attribute of the item. - attr_accessor :studio - - attr_accessor :subscription_length - - attr_accessor :system_memory_size - - # The system memory type attribute of the item. - attr_accessor :system_memory_type - - # The theatrical release date attribute of the item. - attr_accessor :theatrical_release_date - - # The title attribute of the item. - attr_accessor :title - - attr_accessor :total_diamond_weight - - attr_accessor :total_gem_weight - - # The warranty attribute of the item. - attr_accessor :warranty - - attr_accessor :weee_tax_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'actor' => :'Actor', - :'artist' => :'Artist', - :'aspect_ratio' => :'AspectRatio', - :'audience_rating' => :'AudienceRating', - :'author' => :'Author', - :'back_finding' => :'BackFinding', - :'band_material_type' => :'BandMaterialType', - :'binding' => :'Binding', - :'bluray_region' => :'BlurayRegion', - :'brand' => :'Brand', - :'cero_age_rating' => :'CeroAgeRating', - :'chain_type' => :'ChainType', - :'clasp_type' => :'ClaspType', - :'color' => :'Color', - :'cpu_manufacturer' => :'CpuManufacturer', - :'cpu_speed' => :'CpuSpeed', - :'cpu_type' => :'CpuType', - :'creator' => :'Creator', - :'department' => :'Department', - :'director' => :'Director', - :'display_size' => :'DisplaySize', - :'edition' => :'Edition', - :'episode_sequence' => :'EpisodeSequence', - :'esrb_age_rating' => :'EsrbAgeRating', - :'feature' => :'Feature', - :'flavor' => :'Flavor', - :'format' => :'Format', - :'gem_type' => :'GemType', - :'genre' => :'Genre', - :'golf_club_flex' => :'GolfClubFlex', - :'golf_club_loft' => :'GolfClubLoft', - :'hand_orientation' => :'HandOrientation', - :'hard_disk_interface' => :'HardDiskInterface', - :'hard_disk_size' => :'HardDiskSize', - :'hardware_platform' => :'HardwarePlatform', - :'hazardous_material_type' => :'HazardousMaterialType', - :'item_dimensions' => :'ItemDimensions', - :'is_adult_product' => :'IsAdultProduct', - :'is_autographed' => :'IsAutographed', - :'is_eligible_for_trade_in' => :'IsEligibleForTradeIn', - :'is_memorabilia' => :'IsMemorabilia', - :'issues_per_year' => :'IssuesPerYear', - :'item_part_number' => :'ItemPartNumber', - :'label' => :'Label', - :'languages' => :'Languages', - :'legal_disclaimer' => :'LegalDisclaimer', - :'list_price' => :'ListPrice', - :'manufacturer' => :'Manufacturer', - :'manufacturer_maximum_age' => :'ManufacturerMaximumAge', - :'manufacturer_minimum_age' => :'ManufacturerMinimumAge', - :'manufacturer_parts_warranty_description' => :'ManufacturerPartsWarrantyDescription', - :'material_type' => :'MaterialType', - :'maximum_resolution' => :'MaximumResolution', - :'media_type' => :'MediaType', - :'metal_stamp' => :'MetalStamp', - :'metal_type' => :'MetalType', - :'model' => :'Model', - :'number_of_discs' => :'NumberOfDiscs', - :'number_of_issues' => :'NumberOfIssues', - :'number_of_items' => :'NumberOfItems', - :'number_of_pages' => :'NumberOfPages', - :'number_of_tracks' => :'NumberOfTracks', - :'operating_system' => :'OperatingSystem', - :'optical_zoom' => :'OpticalZoom', - :'package_dimensions' => :'PackageDimensions', - :'package_quantity' => :'PackageQuantity', - :'part_number' => :'PartNumber', - :'pegi_rating' => :'PegiRating', - :'platform' => :'Platform', - :'processor_count' => :'ProcessorCount', - :'product_group' => :'ProductGroup', - :'product_type_name' => :'ProductTypeName', - :'product_type_subcategory' => :'ProductTypeSubcategory', - :'publication_date' => :'PublicationDate', - :'publisher' => :'Publisher', - :'region_code' => :'RegionCode', - :'release_date' => :'ReleaseDate', - :'ring_size' => :'RingSize', - :'running_time' => :'RunningTime', - :'shaft_material' => :'ShaftMaterial', - :'scent' => :'Scent', - :'season_sequence' => :'SeasonSequence', - :'seikodo_product_code' => :'SeikodoProductCode', - :'size' => :'Size', - :'size_per_pearl' => :'SizePerPearl', - :'small_image' => :'SmallImage', - :'studio' => :'Studio', - :'subscription_length' => :'SubscriptionLength', - :'system_memory_size' => :'SystemMemorySize', - :'system_memory_type' => :'SystemMemoryType', - :'theatrical_release_date' => :'TheatricalReleaseDate', - :'title' => :'Title', - :'total_diamond_weight' => :'TotalDiamondWeight', - :'total_gem_weight' => :'TotalGemWeight', - :'warranty' => :'Warranty', - :'weee_tax_value' => :'WeeeTaxValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'actor' => :'Object', - :'artist' => :'Object', - :'aspect_ratio' => :'Object', - :'audience_rating' => :'Object', - :'author' => :'Object', - :'back_finding' => :'Object', - :'band_material_type' => :'Object', - :'binding' => :'Object', - :'bluray_region' => :'Object', - :'brand' => :'Object', - :'cero_age_rating' => :'Object', - :'chain_type' => :'Object', - :'clasp_type' => :'Object', - :'color' => :'Object', - :'cpu_manufacturer' => :'Object', - :'cpu_speed' => :'Object', - :'cpu_type' => :'Object', - :'creator' => :'Object', - :'department' => :'Object', - :'director' => :'Object', - :'display_size' => :'Object', - :'edition' => :'Object', - :'episode_sequence' => :'Object', - :'esrb_age_rating' => :'Object', - :'feature' => :'Object', - :'flavor' => :'Object', - :'format' => :'Object', - :'gem_type' => :'Object', - :'genre' => :'Object', - :'golf_club_flex' => :'Object', - :'golf_club_loft' => :'Object', - :'hand_orientation' => :'Object', - :'hard_disk_interface' => :'Object', - :'hard_disk_size' => :'Object', - :'hardware_platform' => :'Object', - :'hazardous_material_type' => :'Object', - :'item_dimensions' => :'Object', - :'is_adult_product' => :'Object', - :'is_autographed' => :'Object', - :'is_eligible_for_trade_in' => :'Object', - :'is_memorabilia' => :'Object', - :'issues_per_year' => :'Object', - :'item_part_number' => :'Object', - :'label' => :'Object', - :'languages' => :'Object', - :'legal_disclaimer' => :'Object', - :'list_price' => :'Object', - :'manufacturer' => :'Object', - :'manufacturer_maximum_age' => :'Object', - :'manufacturer_minimum_age' => :'Object', - :'manufacturer_parts_warranty_description' => :'Object', - :'material_type' => :'Object', - :'maximum_resolution' => :'Object', - :'media_type' => :'Object', - :'metal_stamp' => :'Object', - :'metal_type' => :'Object', - :'model' => :'Object', - :'number_of_discs' => :'Object', - :'number_of_issues' => :'Object', - :'number_of_items' => :'Object', - :'number_of_pages' => :'Object', - :'number_of_tracks' => :'Object', - :'operating_system' => :'Object', - :'optical_zoom' => :'Object', - :'package_dimensions' => :'Object', - :'package_quantity' => :'Object', - :'part_number' => :'Object', - :'pegi_rating' => :'Object', - :'platform' => :'Object', - :'processor_count' => :'Object', - :'product_group' => :'Object', - :'product_type_name' => :'Object', - :'product_type_subcategory' => :'Object', - :'publication_date' => :'Object', - :'publisher' => :'Object', - :'region_code' => :'Object', - :'release_date' => :'Object', - :'ring_size' => :'Object', - :'running_time' => :'Object', - :'shaft_material' => :'Object', - :'scent' => :'Object', - :'season_sequence' => :'Object', - :'seikodo_product_code' => :'Object', - :'size' => :'Object', - :'size_per_pearl' => :'Object', - :'small_image' => :'Object', - :'studio' => :'Object', - :'subscription_length' => :'Object', - :'system_memory_size' => :'Object', - :'system_memory_type' => :'Object', - :'theatrical_release_date' => :'Object', - :'title' => :'Object', - :'total_diamond_weight' => :'Object', - :'total_gem_weight' => :'Object', - :'warranty' => :'Object', - :'weee_tax_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::AttributeSetListType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::AttributeSetListType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'actor') - if (value = attributes[:'actor']).is_a?(Array) - self.actor = value - end - end - - if attributes.key?(:'artist') - if (value = attributes[:'artist']).is_a?(Array) - self.artist = value - end - end - - if attributes.key?(:'aspect_ratio') - self.aspect_ratio = attributes[:'aspect_ratio'] - end - - if attributes.key?(:'audience_rating') - self.audience_rating = attributes[:'audience_rating'] - end - - if attributes.key?(:'author') - if (value = attributes[:'author']).is_a?(Array) - self.author = value - end - end - - if attributes.key?(:'back_finding') - self.back_finding = attributes[:'back_finding'] - end - - if attributes.key?(:'band_material_type') - self.band_material_type = attributes[:'band_material_type'] - end - - if attributes.key?(:'binding') - self.binding = attributes[:'binding'] - end - - if attributes.key?(:'bluray_region') - self.bluray_region = attributes[:'bluray_region'] - end - - if attributes.key?(:'brand') - self.brand = attributes[:'brand'] - end - - if attributes.key?(:'cero_age_rating') - self.cero_age_rating = attributes[:'cero_age_rating'] - end - - if attributes.key?(:'chain_type') - self.chain_type = attributes[:'chain_type'] - end - - if attributes.key?(:'clasp_type') - self.clasp_type = attributes[:'clasp_type'] - end - - if attributes.key?(:'color') - self.color = attributes[:'color'] - end - - if attributes.key?(:'cpu_manufacturer') - self.cpu_manufacturer = attributes[:'cpu_manufacturer'] - end - - if attributes.key?(:'cpu_speed') - self.cpu_speed = attributes[:'cpu_speed'] - end - - if attributes.key?(:'cpu_type') - self.cpu_type = attributes[:'cpu_type'] - end - - if attributes.key?(:'creator') - if (value = attributes[:'creator']).is_a?(Array) - self.creator = value - end - end - - if attributes.key?(:'department') - self.department = attributes[:'department'] - end - - if attributes.key?(:'director') - if (value = attributes[:'director']).is_a?(Array) - self.director = value - end - end - - if attributes.key?(:'display_size') - self.display_size = attributes[:'display_size'] - end - - if attributes.key?(:'edition') - self.edition = attributes[:'edition'] - end - - if attributes.key?(:'episode_sequence') - self.episode_sequence = attributes[:'episode_sequence'] - end - - if attributes.key?(:'esrb_age_rating') - self.esrb_age_rating = attributes[:'esrb_age_rating'] - end - - if attributes.key?(:'feature') - if (value = attributes[:'feature']).is_a?(Array) - self.feature = value - end - end - - if attributes.key?(:'flavor') - self.flavor = attributes[:'flavor'] - end - - if attributes.key?(:'format') - if (value = attributes[:'format']).is_a?(Array) - self.format = value - end - end - - if attributes.key?(:'gem_type') - if (value = attributes[:'gem_type']).is_a?(Array) - self.gem_type = value - end - end - - if attributes.key?(:'genre') - self.genre = attributes[:'genre'] - end - - if attributes.key?(:'golf_club_flex') - self.golf_club_flex = attributes[:'golf_club_flex'] - end - - if attributes.key?(:'golf_club_loft') - self.golf_club_loft = attributes[:'golf_club_loft'] - end - - if attributes.key?(:'hand_orientation') - self.hand_orientation = attributes[:'hand_orientation'] - end - - if attributes.key?(:'hard_disk_interface') - self.hard_disk_interface = attributes[:'hard_disk_interface'] - end - - if attributes.key?(:'hard_disk_size') - self.hard_disk_size = attributes[:'hard_disk_size'] - end - - if attributes.key?(:'hardware_platform') - self.hardware_platform = attributes[:'hardware_platform'] - end - - if attributes.key?(:'hazardous_material_type') - self.hazardous_material_type = attributes[:'hazardous_material_type'] - end - - if attributes.key?(:'item_dimensions') - self.item_dimensions = attributes[:'item_dimensions'] - end - - if attributes.key?(:'is_adult_product') - self.is_adult_product = attributes[:'is_adult_product'] - end - - if attributes.key?(:'is_autographed') - self.is_autographed = attributes[:'is_autographed'] - end - - if attributes.key?(:'is_eligible_for_trade_in') - self.is_eligible_for_trade_in = attributes[:'is_eligible_for_trade_in'] - end - - if attributes.key?(:'is_memorabilia') - self.is_memorabilia = attributes[:'is_memorabilia'] - end - - if attributes.key?(:'issues_per_year') - self.issues_per_year = attributes[:'issues_per_year'] - end - - if attributes.key?(:'item_part_number') - self.item_part_number = attributes[:'item_part_number'] - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - end - - if attributes.key?(:'languages') - if (value = attributes[:'languages']).is_a?(Array) - self.languages = value - end - end - - if attributes.key?(:'legal_disclaimer') - self.legal_disclaimer = attributes[:'legal_disclaimer'] - end - - if attributes.key?(:'list_price') - self.list_price = attributes[:'list_price'] - end - - if attributes.key?(:'manufacturer') - self.manufacturer = attributes[:'manufacturer'] - end - - if attributes.key?(:'manufacturer_maximum_age') - self.manufacturer_maximum_age = attributes[:'manufacturer_maximum_age'] - end - - if attributes.key?(:'manufacturer_minimum_age') - self.manufacturer_minimum_age = attributes[:'manufacturer_minimum_age'] - end - - if attributes.key?(:'manufacturer_parts_warranty_description') - self.manufacturer_parts_warranty_description = attributes[:'manufacturer_parts_warranty_description'] - end - - if attributes.key?(:'material_type') - if (value = attributes[:'material_type']).is_a?(Array) - self.material_type = value - end - end - - if attributes.key?(:'maximum_resolution') - self.maximum_resolution = attributes[:'maximum_resolution'] - end - - if attributes.key?(:'media_type') - if (value = attributes[:'media_type']).is_a?(Array) - self.media_type = value - end - end - - if attributes.key?(:'metal_stamp') - self.metal_stamp = attributes[:'metal_stamp'] - end - - if attributes.key?(:'metal_type') - self.metal_type = attributes[:'metal_type'] - end - - if attributes.key?(:'model') - self.model = attributes[:'model'] - end - - if attributes.key?(:'number_of_discs') - self.number_of_discs = attributes[:'number_of_discs'] - end - - if attributes.key?(:'number_of_issues') - self.number_of_issues = attributes[:'number_of_issues'] - end - - if attributes.key?(:'number_of_items') - self.number_of_items = attributes[:'number_of_items'] - end - - if attributes.key?(:'number_of_pages') - self.number_of_pages = attributes[:'number_of_pages'] - end - - if attributes.key?(:'number_of_tracks') - self.number_of_tracks = attributes[:'number_of_tracks'] - end - - if attributes.key?(:'operating_system') - if (value = attributes[:'operating_system']).is_a?(Array) - self.operating_system = value - end - end - - if attributes.key?(:'optical_zoom') - self.optical_zoom = attributes[:'optical_zoom'] - end - - if attributes.key?(:'package_dimensions') - self.package_dimensions = attributes[:'package_dimensions'] - end - - if attributes.key?(:'package_quantity') - self.package_quantity = attributes[:'package_quantity'] - end - - if attributes.key?(:'part_number') - self.part_number = attributes[:'part_number'] - end - - if attributes.key?(:'pegi_rating') - self.pegi_rating = attributes[:'pegi_rating'] - end - - if attributes.key?(:'platform') - if (value = attributes[:'platform']).is_a?(Array) - self.platform = value - end - end - - if attributes.key?(:'processor_count') - self.processor_count = attributes[:'processor_count'] - end - - if attributes.key?(:'product_group') - self.product_group = attributes[:'product_group'] - end - - if attributes.key?(:'product_type_name') - self.product_type_name = attributes[:'product_type_name'] - end - - if attributes.key?(:'product_type_subcategory') - self.product_type_subcategory = attributes[:'product_type_subcategory'] - end - - if attributes.key?(:'publication_date') - self.publication_date = attributes[:'publication_date'] - end - - if attributes.key?(:'publisher') - self.publisher = attributes[:'publisher'] - end - - if attributes.key?(:'region_code') - self.region_code = attributes[:'region_code'] - end - - if attributes.key?(:'release_date') - self.release_date = attributes[:'release_date'] - end - - if attributes.key?(:'ring_size') - self.ring_size = attributes[:'ring_size'] - end - - if attributes.key?(:'running_time') - self.running_time = attributes[:'running_time'] - end - - if attributes.key?(:'shaft_material') - self.shaft_material = attributes[:'shaft_material'] - end - - if attributes.key?(:'scent') - self.scent = attributes[:'scent'] - end - - if attributes.key?(:'season_sequence') - self.season_sequence = attributes[:'season_sequence'] - end - - if attributes.key?(:'seikodo_product_code') - self.seikodo_product_code = attributes[:'seikodo_product_code'] - end - - if attributes.key?(:'size') - self.size = attributes[:'size'] - end - - if attributes.key?(:'size_per_pearl') - self.size_per_pearl = attributes[:'size_per_pearl'] - end - - if attributes.key?(:'small_image') - self.small_image = attributes[:'small_image'] - end - - if attributes.key?(:'studio') - self.studio = attributes[:'studio'] - end - - if attributes.key?(:'subscription_length') - self.subscription_length = attributes[:'subscription_length'] - end - - if attributes.key?(:'system_memory_size') - self.system_memory_size = attributes[:'system_memory_size'] - end - - if attributes.key?(:'system_memory_type') - self.system_memory_type = attributes[:'system_memory_type'] - end - - if attributes.key?(:'theatrical_release_date') - self.theatrical_release_date = attributes[:'theatrical_release_date'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'total_diamond_weight') - self.total_diamond_weight = attributes[:'total_diamond_weight'] - end - - if attributes.key?(:'total_gem_weight') - self.total_gem_weight = attributes[:'total_gem_weight'] - end - - if attributes.key?(:'warranty') - self.warranty = attributes[:'warranty'] - end - - if attributes.key?(:'weee_tax_value') - self.weee_tax_value = attributes[:'weee_tax_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - actor == o.actor && - artist == o.artist && - aspect_ratio == o.aspect_ratio && - audience_rating == o.audience_rating && - author == o.author && - back_finding == o.back_finding && - band_material_type == o.band_material_type && - binding == o.binding && - bluray_region == o.bluray_region && - brand == o.brand && - cero_age_rating == o.cero_age_rating && - chain_type == o.chain_type && - clasp_type == o.clasp_type && - color == o.color && - cpu_manufacturer == o.cpu_manufacturer && - cpu_speed == o.cpu_speed && - cpu_type == o.cpu_type && - creator == o.creator && - department == o.department && - director == o.director && - display_size == o.display_size && - edition == o.edition && - episode_sequence == o.episode_sequence && - esrb_age_rating == o.esrb_age_rating && - feature == o.feature && - flavor == o.flavor && - format == o.format && - gem_type == o.gem_type && - genre == o.genre && - golf_club_flex == o.golf_club_flex && - golf_club_loft == o.golf_club_loft && - hand_orientation == o.hand_orientation && - hard_disk_interface == o.hard_disk_interface && - hard_disk_size == o.hard_disk_size && - hardware_platform == o.hardware_platform && - hazardous_material_type == o.hazardous_material_type && - item_dimensions == o.item_dimensions && - is_adult_product == o.is_adult_product && - is_autographed == o.is_autographed && - is_eligible_for_trade_in == o.is_eligible_for_trade_in && - is_memorabilia == o.is_memorabilia && - issues_per_year == o.issues_per_year && - item_part_number == o.item_part_number && - label == o.label && - languages == o.languages && - legal_disclaimer == o.legal_disclaimer && - list_price == o.list_price && - manufacturer == o.manufacturer && - manufacturer_maximum_age == o.manufacturer_maximum_age && - manufacturer_minimum_age == o.manufacturer_minimum_age && - manufacturer_parts_warranty_description == o.manufacturer_parts_warranty_description && - material_type == o.material_type && - maximum_resolution == o.maximum_resolution && - media_type == o.media_type && - metal_stamp == o.metal_stamp && - metal_type == o.metal_type && - model == o.model && - number_of_discs == o.number_of_discs && - number_of_issues == o.number_of_issues && - number_of_items == o.number_of_items && - number_of_pages == o.number_of_pages && - number_of_tracks == o.number_of_tracks && - operating_system == o.operating_system && - optical_zoom == o.optical_zoom && - package_dimensions == o.package_dimensions && - package_quantity == o.package_quantity && - part_number == o.part_number && - pegi_rating == o.pegi_rating && - platform == o.platform && - processor_count == o.processor_count && - product_group == o.product_group && - product_type_name == o.product_type_name && - product_type_subcategory == o.product_type_subcategory && - publication_date == o.publication_date && - publisher == o.publisher && - region_code == o.region_code && - release_date == o.release_date && - ring_size == o.ring_size && - running_time == o.running_time && - shaft_material == o.shaft_material && - scent == o.scent && - season_sequence == o.season_sequence && - seikodo_product_code == o.seikodo_product_code && - size == o.size && - size_per_pearl == o.size_per_pearl && - small_image == o.small_image && - studio == o.studio && - subscription_length == o.subscription_length && - system_memory_size == o.system_memory_size && - system_memory_type == o.system_memory_type && - theatrical_release_date == o.theatrical_release_date && - title == o.title && - total_diamond_weight == o.total_diamond_weight && - total_gem_weight == o.total_gem_weight && - warranty == o.warranty && - weee_tax_value == o.weee_tax_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [actor, artist, aspect_ratio, audience_rating, author, back_finding, band_material_type, binding, bluray_region, brand, cero_age_rating, chain_type, clasp_type, color, cpu_manufacturer, cpu_speed, cpu_type, creator, department, director, display_size, edition, episode_sequence, esrb_age_rating, feature, flavor, format, gem_type, genre, golf_club_flex, golf_club_loft, hand_orientation, hard_disk_interface, hard_disk_size, hardware_platform, hazardous_material_type, item_dimensions, is_adult_product, is_autographed, is_eligible_for_trade_in, is_memorabilia, issues_per_year, item_part_number, label, languages, legal_disclaimer, list_price, manufacturer, manufacturer_maximum_age, manufacturer_minimum_age, manufacturer_parts_warranty_description, material_type, maximum_resolution, media_type, metal_stamp, metal_type, model, number_of_discs, number_of_issues, number_of_items, number_of_pages, number_of_tracks, operating_system, optical_zoom, package_dimensions, package_quantity, part_number, pegi_rating, platform, processor_count, product_group, product_type_name, product_type_subcategory, publication_date, publisher, region_code, release_date, ring_size, running_time, shaft_material, scent, season_sequence, seikodo_product_code, size, size_per_pearl, small_image, studio, subscription_length, system_memory_size, system_memory_type, theatrical_release_date, title, total_diamond_weight, total_gem_weight, warranty, weee_tax_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/categories.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/categories.rb deleted file mode 100644 index 5784d33..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/categories.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class Categories - # The identifier for the product category (or browse node). - attr_accessor :product_category_id - - # The name of the product category (or browse node). - attr_accessor :product_category_name - - # The parent product category. - attr_accessor :parent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_category_id' => :'ProductCategoryId', - :'product_category_name' => :'ProductCategoryName', - :'parent' => :'parent' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_category_id' => :'Object', - :'product_category_name' => :'Object', - :'parent' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::Categories` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::Categories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_category_id') - self.product_category_id = attributes[:'product_category_id'] - end - - if attributes.key?(:'product_category_name') - self.product_category_name = attributes[:'product_category_name'] - end - - if attributes.key?(:'parent') - self.parent = attributes[:'parent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_category_id == o.product_category_id && - product_category_name == o.product_category_name && - parent == o.parent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_category_id, product_category_name, parent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/creator_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/creator_type.rb deleted file mode 100644 index 89e730d..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/creator_type.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The creator type attribute of an item. - class CreatorType - # The value of the attribute. - attr_accessor :value - - # The role of the value. - attr_accessor :role - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'role' => :'Role' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'role' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::CreatorType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::CreatorType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'role') - self.role = attributes[:'role'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - role == o.role - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, role].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/decimal_with_units.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/decimal_with_units.rb deleted file mode 100644 index 7a0cbeb..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/decimal_with_units.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The decimal value and unit. - class DecimalWithUnits - # The decimal value. - attr_accessor :value - - # The unit of the decimal value. - attr_accessor :units - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'units' => :'Units' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'units' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::DecimalWithUnits` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::DecimalWithUnits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'units') - self.units = attributes[:'units'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - units == o.units - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, units].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/dimension_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/dimension_type.rb deleted file mode 100644 index e7b6b18..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/dimension_type.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The dimension type attribute of an item. - class DimensionType - attr_accessor :height - - attr_accessor :length - - attr_accessor :width - - attr_accessor :weight - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'height' => :'Height', - :'length' => :'Length', - :'width' => :'Width', - :'weight' => :'Weight' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'height' => :'Object', - :'length' => :'Object', - :'width' => :'Object', - :'weight' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::DimensionType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::DimensionType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - height == o.height && - length == o.length && - width == o.width && - weight == o.weight - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [height, length, width, weight].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error.rb deleted file mode 100644 index cb6f0f7..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional information that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error_list.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error_list.rb deleted file mode 100644 index 3ba1a27..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/get_catalog_item_response.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/get_catalog_item_response.rb deleted file mode 100644 index a580ea6..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/get_catalog_item_response.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class GetCatalogItemResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::GetCatalogItemResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::GetCatalogItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/identifier_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/identifier_type.rb deleted file mode 100644 index a9ef43d..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/identifier_type.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class IdentifierType - attr_accessor :marketplace_asin - - attr_accessor :sku_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_asin' => :'MarketplaceASIN', - :'sku_identifier' => :'SKUIdentifier' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_asin' => :'Object', - :'sku_identifier' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::IdentifierType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::IdentifierType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_asin') - self.marketplace_asin = attributes[:'marketplace_asin'] - end - - if attributes.key?(:'sku_identifier') - self.sku_identifier = attributes[:'sku_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_asin == o.marketplace_asin && - sku_identifier == o.sku_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_asin, sku_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/image.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/image.rb deleted file mode 100644 index 5319f43..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/image.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The image attribute of the item. - class Image - # The image URL attribute of the item. - attr_accessor :url - - attr_accessor :height - - attr_accessor :width - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url' => :'URL', - :'height' => :'Height', - :'width' => :'Width' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'url' => :'Object', - :'height' => :'Object', - :'width' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::Image` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::Image`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url == o.url && - height == o.height && - width == o.width - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url, height, width].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item.rb deleted file mode 100644 index 407ce47..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # An item in the Amazon catalog. - class Item - attr_accessor :identifiers - - attr_accessor :attribute_sets - - attr_accessor :relationships - - attr_accessor :sales_rankings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identifiers' => :'Identifiers', - :'attribute_sets' => :'AttributeSets', - :'relationships' => :'Relationships', - :'sales_rankings' => :'SalesRankings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'identifiers' => :'Object', - :'attribute_sets' => :'Object', - :'relationships' => :'Object', - :'sales_rankings' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identifiers') - self.identifiers = attributes[:'identifiers'] - end - - if attributes.key?(:'attribute_sets') - self.attribute_sets = attributes[:'attribute_sets'] - end - - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] - end - - if attributes.key?(:'sales_rankings') - self.sales_rankings = attributes[:'sales_rankings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identifiers.nil? - invalid_properties.push('invalid value for "identifiers", identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identifiers == o.identifiers && - attribute_sets == o.attribute_sets && - relationships == o.relationships && - sales_rankings == o.sales_rankings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identifiers, attribute_sets, relationships, sales_rankings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item_list.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item_list.rb deleted file mode 100644 index 89c191a..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # A list of items. - class ItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/language_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/language_type.rb deleted file mode 100644 index ad6132c..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/language_type.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The language type attribute of an item. - class LanguageType - # The name attribute of the item. - attr_accessor :name - - # The type attribute of the item. - attr_accessor :type - - # The audio format attribute of the item. - attr_accessor :audio_format - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'type' => :'Type', - :'audio_format' => :'AudioFormat' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'type' => :'Object', - :'audio_format' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::LanguageType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::LanguageType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'audio_format') - self.audio_format = attributes[:'audio_format'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - type == o.type && - audio_format == o.audio_format - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, type, audio_format].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_categories_response.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_categories_response.rb deleted file mode 100644 index 756dc17..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_categories_response.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class ListCatalogCategoriesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ListCatalogCategoriesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ListCatalogCategoriesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_items_response.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_items_response.rb deleted file mode 100644 index 733919e..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_catalog_items_response.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class ListCatalogItemsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ListCatalogItemsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ListCatalogItemsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_matching_items_response.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_matching_items_response.rb deleted file mode 100644 index 7e41b67..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_matching_items_response.rb +++ /dev/null @@ -1,210 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class ListMatchingItemsResponse - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'Items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ListMatchingItemsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ListMatchingItemsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - self.items = attributes[:'items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_of_categories.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_of_categories.rb deleted file mode 100644 index 52f1049..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/list_of_categories.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class ListOfCategories - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::ListOfCategories` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::ListOfCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/price.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/price.rb deleted file mode 100644 index 0014872..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/price.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # The price attribute of the item. - class Price - # The amount. - attr_accessor :amount - - # The currency code of the amount. - attr_accessor :currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'Amount', - :'currency_code' => :'CurrencyCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'currency_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::Price` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::Price`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - currency_code == o.currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_list.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_list.rb deleted file mode 100644 index c31a47d..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # A list of variation relationship information, if applicable for the item. - class RelationshipList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::RelationshipList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::RelationshipList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_type.rb deleted file mode 100644 index bdb2a69..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/relationship_type.rb +++ /dev/null @@ -1,433 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # Specific variations of the item. - class RelationshipType - attr_accessor :identifiers - - # The color variation of the item. - attr_accessor :color - - # The edition variation of the item. - attr_accessor :edition - - # The flavor variation of the item. - attr_accessor :flavor - - # The gem type variations of the item. - attr_accessor :gem_type - - # The golf club flex variation of an item. - attr_accessor :golf_club_flex - - # The hand orientation variation of an item. - attr_accessor :hand_orientation - - # The hardware platform variation of an item. - attr_accessor :hardware_platform - - # The material type variations of an item. - attr_accessor :material_type - - # The metal type variation of an item. - attr_accessor :metal_type - - # The model variation of an item. - attr_accessor :model - - # The operating system variations of an item. - attr_accessor :operating_system - - # The product type subcategory variation of an item. - attr_accessor :product_type_subcategory - - # The ring size variation of an item. - attr_accessor :ring_size - - # The shaft material variation of an item. - attr_accessor :shaft_material - - # The scent variation of an item. - attr_accessor :scent - - # The size variation of an item. - attr_accessor :size - - # The size per pearl variation of an item. - attr_accessor :size_per_pearl - - attr_accessor :golf_club_loft - - attr_accessor :total_diamond_weight - - attr_accessor :total_gem_weight - - # The package quantity variation of an item. - attr_accessor :package_quantity - - attr_accessor :item_dimensions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identifiers' => :'Identifiers', - :'color' => :'Color', - :'edition' => :'Edition', - :'flavor' => :'Flavor', - :'gem_type' => :'GemType', - :'golf_club_flex' => :'GolfClubFlex', - :'hand_orientation' => :'HandOrientation', - :'hardware_platform' => :'HardwarePlatform', - :'material_type' => :'MaterialType', - :'metal_type' => :'MetalType', - :'model' => :'Model', - :'operating_system' => :'OperatingSystem', - :'product_type_subcategory' => :'ProductTypeSubcategory', - :'ring_size' => :'RingSize', - :'shaft_material' => :'ShaftMaterial', - :'scent' => :'Scent', - :'size' => :'Size', - :'size_per_pearl' => :'SizePerPearl', - :'golf_club_loft' => :'GolfClubLoft', - :'total_diamond_weight' => :'TotalDiamondWeight', - :'total_gem_weight' => :'TotalGemWeight', - :'package_quantity' => :'PackageQuantity', - :'item_dimensions' => :'ItemDimensions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'identifiers' => :'Object', - :'color' => :'Object', - :'edition' => :'Object', - :'flavor' => :'Object', - :'gem_type' => :'Object', - :'golf_club_flex' => :'Object', - :'hand_orientation' => :'Object', - :'hardware_platform' => :'Object', - :'material_type' => :'Object', - :'metal_type' => :'Object', - :'model' => :'Object', - :'operating_system' => :'Object', - :'product_type_subcategory' => :'Object', - :'ring_size' => :'Object', - :'shaft_material' => :'Object', - :'scent' => :'Object', - :'size' => :'Object', - :'size_per_pearl' => :'Object', - :'golf_club_loft' => :'Object', - :'total_diamond_weight' => :'Object', - :'total_gem_weight' => :'Object', - :'package_quantity' => :'Object', - :'item_dimensions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::RelationshipType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::RelationshipType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identifiers') - self.identifiers = attributes[:'identifiers'] - end - - if attributes.key?(:'color') - self.color = attributes[:'color'] - end - - if attributes.key?(:'edition') - self.edition = attributes[:'edition'] - end - - if attributes.key?(:'flavor') - self.flavor = attributes[:'flavor'] - end - - if attributes.key?(:'gem_type') - if (value = attributes[:'gem_type']).is_a?(Array) - self.gem_type = value - end - end - - if attributes.key?(:'golf_club_flex') - self.golf_club_flex = attributes[:'golf_club_flex'] - end - - if attributes.key?(:'hand_orientation') - self.hand_orientation = attributes[:'hand_orientation'] - end - - if attributes.key?(:'hardware_platform') - self.hardware_platform = attributes[:'hardware_platform'] - end - - if attributes.key?(:'material_type') - if (value = attributes[:'material_type']).is_a?(Array) - self.material_type = value - end - end - - if attributes.key?(:'metal_type') - self.metal_type = attributes[:'metal_type'] - end - - if attributes.key?(:'model') - self.model = attributes[:'model'] - end - - if attributes.key?(:'operating_system') - if (value = attributes[:'operating_system']).is_a?(Array) - self.operating_system = value - end - end - - if attributes.key?(:'product_type_subcategory') - self.product_type_subcategory = attributes[:'product_type_subcategory'] - end - - if attributes.key?(:'ring_size') - self.ring_size = attributes[:'ring_size'] - end - - if attributes.key?(:'shaft_material') - self.shaft_material = attributes[:'shaft_material'] - end - - if attributes.key?(:'scent') - self.scent = attributes[:'scent'] - end - - if attributes.key?(:'size') - self.size = attributes[:'size'] - end - - if attributes.key?(:'size_per_pearl') - self.size_per_pearl = attributes[:'size_per_pearl'] - end - - if attributes.key?(:'golf_club_loft') - self.golf_club_loft = attributes[:'golf_club_loft'] - end - - if attributes.key?(:'total_diamond_weight') - self.total_diamond_weight = attributes[:'total_diamond_weight'] - end - - if attributes.key?(:'total_gem_weight') - self.total_gem_weight = attributes[:'total_gem_weight'] - end - - if attributes.key?(:'package_quantity') - self.package_quantity = attributes[:'package_quantity'] - end - - if attributes.key?(:'item_dimensions') - self.item_dimensions = attributes[:'item_dimensions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identifiers == o.identifiers && - color == o.color && - edition == o.edition && - flavor == o.flavor && - gem_type == o.gem_type && - golf_club_flex == o.golf_club_flex && - hand_orientation == o.hand_orientation && - hardware_platform == o.hardware_platform && - material_type == o.material_type && - metal_type == o.metal_type && - model == o.model && - operating_system == o.operating_system && - product_type_subcategory == o.product_type_subcategory && - ring_size == o.ring_size && - shaft_material == o.shaft_material && - scent == o.scent && - size == o.size && - size_per_pearl == o.size_per_pearl && - golf_club_loft == o.golf_club_loft && - total_diamond_weight == o.total_diamond_weight && - total_gem_weight == o.total_gem_weight && - package_quantity == o.package_quantity && - item_dimensions == o.item_dimensions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identifiers, color, edition, flavor, gem_type, golf_club_flex, hand_orientation, hardware_platform, material_type, metal_type, model, operating_system, product_type_subcategory, ring_size, shaft_material, scent, size, size_per_pearl, golf_club_loft, total_diamond_weight, total_gem_weight, package_quantity, item_dimensions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_list.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_list.rb deleted file mode 100644 index 725113f..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - # A list of sales rank information for the item by category. - class SalesRankList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::SalesRankList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::SalesRankList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_type.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_type.rb deleted file mode 100644 index 11721b7..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/sales_rank_type.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class SalesRankType - # Identifies the item category from which the sales rank is taken. - attr_accessor :product_category_id - - # The sales rank of the item within the item category. - attr_accessor :rank - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_category_id' => :'ProductCategoryId', - :'rank' => :'Rank' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_category_id' => :'Object', - :'rank' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::SalesRankType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::SalesRankType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_category_id') - self.product_category_id = attributes[:'product_category_id'] - end - - if attributes.key?(:'rank') - self.rank = attributes[:'rank'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product_category_id.nil? - invalid_properties.push('invalid value for "product_category_id", product_category_id cannot be nil.') - end - - if @rank.nil? - invalid_properties.push('invalid value for "rank", rank cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product_category_id.nil? - return false if @rank.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_category_id == o.product_category_id && - rank == o.rank - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_category_id, rank].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/seller_sku_identifier.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/seller_sku_identifier.rb deleted file mode 100644 index 67ff54a..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/models/seller_sku_identifier.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpCatalogItemsV0 - class SellerSKUIdentifier - # A marketplace identifier. - attr_accessor :marketplace_id - - # The seller identifier submitted for the operation. - attr_accessor :seller_id - - # The seller stock keeping unit (SKU) of the item. - attr_accessor :seller_sku - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'seller_id' => :'SellerId', - :'seller_sku' => :'SellerSKU' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'seller_id' => :'Object', - :'seller_sku' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpCatalogItemsV0::SellerSKUIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpCatalogItemsV0::SellerSKUIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @seller_id.nil? - invalid_properties.push('invalid value for "seller_id", seller_id cannot be nil.') - end - - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @seller_id.nil? - return false if @seller_sku.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - seller_id == o.seller_id && - seller_sku == o.seller_sku - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, seller_id, seller_sku].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpCatalogItemsV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/version.rb b/vendor/catalog_items_v0/lib/sp_catalog_items_v0/version.rb deleted file mode 100644 index 3093baa..0000000 --- a/vendor/catalog_items_v0/lib/sp_catalog_items_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpCatalogItemsV0 - VERSION = '1.0.0' -end diff --git a/vendor/catalog_items_v0/sp_catalog_items_v0.gemspec b/vendor/catalog_items_v0/sp_catalog_items_v0.gemspec deleted file mode 100644 index 418438e..0000000 --- a/vendor/catalog_items_v0/sp_catalog_items_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Catalog Items - -#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_catalog_items_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_catalog_items_v0" - s.version = SpCatalogItemsV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Catalog Items Ruby Gem" - s.description = "The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/fba_inbound/.gitignore b/vendor/fba_inbound/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/fba_inbound/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/fba_inbound/.rspec b/vendor/fba_inbound/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/fba_inbound/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/fba_inbound/.rubocop.yml b/vendor/fba_inbound/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/fba_inbound/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/fba_inbound/.swagger-codegen-ignore b/vendor/fba_inbound/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/fba_inbound/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/fba_inbound/.swagger-codegen/VERSION b/vendor/fba_inbound/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/fba_inbound/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/fba_inbound/Gemfile b/vendor/fba_inbound/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/fba_inbound/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/fba_inbound/README.md b/vendor/fba_inbound/README.md deleted file mode 100644 index 832dee1..0000000 --- a/vendor/fba_inbound/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# sp_fba_inbound - -SpFbaInbound - the Ruby gem for the Selling Partner API for FBA Inbound Eligibilty - -With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_fba_inbound.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_fba_inbound-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_fba_inbound-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_fba_inbound', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_fba_inbound', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_fba_inbound' - -api_instance = SpFbaInbound::FbaInboundApi.new -asin = 'asin_example' # String | The ASIN of the item for which you want an eligibility preview. -program = 'program_example' # String | The program that you want to check eligibility against. -opts = { - marketplace_ids: ['marketplace_ids_example'] # Array | The identifier for the marketplace in which you want to determine eligibility. Required only when program=INBOUND. -} - -begin - result = api_instance.get_item_eligibility_preview(asin, program, opts) - p result -rescue SpFbaInbound::ApiError => e - puts "Exception when calling FbaInboundApi->get_item_eligibility_preview: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpFbaInbound::FbaInboundApi* | [**get_item_eligibility_preview**](docs/FbaInboundApi.md#get_item_eligibility_preview) | **GET** /fba/inbound/v1/eligibility/itemPreview | - -## Documentation for Models - - - [SpFbaInbound::Error](docs/Error.md) - - [SpFbaInbound::ErrorList](docs/ErrorList.md) - - [SpFbaInbound::GetItemEligibilityPreviewResponse](docs/GetItemEligibilityPreviewResponse.md) - - [SpFbaInbound::ItemEligibilityPreview](docs/ItemEligibilityPreview.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/fba_inbound/Rakefile b/vendor/fba_inbound/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/fba_inbound/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/fba_inbound/git_push.sh b/vendor/fba_inbound/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/fba_inbound/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/fba_inbound/lib/sp_fba_inbound.rb b/vendor/fba_inbound/lib/sp_fba_inbound.rb deleted file mode 100644 index 058b699..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_fba_inbound/api_client' -# require 'sp_fba_inbound/api_error' -# require 'sp_fba_inbound/version' -# require 'sp_fba_inbound/configuration' - -# Models -# -# -# require_relative './sp_fba_inbound/models/error' -# -# -# require_relative './sp_fba_inbound/models/error_list' -# -# -# require_relative './sp_fba_inbound/models/get_item_eligibility_preview_response' -# -# -# require_relative './sp_fba_inbound/models/item_eligibility_preview' -# - -# APIs -require_relative './sp_fba_inbound/api/fba_inbound_api' diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/api/fba_inbound_api.rb b/vendor/fba_inbound/lib/sp_fba_inbound/api/fba_inbound_api.rb deleted file mode 100644 index c47f516..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/api/fba_inbound_api.rb +++ /dev/null @@ -1,91 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFbaInbound - class FbaInboundApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item's eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param asin The ASIN of the item for which you want an eligibility preview. - # @param program The program that you want to check eligibility against. - # @param [Hash] opts the optional parameters - # @option opts [Array] :marketplace_ids The identifier for the marketplace in which you want to determine eligibility. Required only when program=INBOUND. - # @return [GetItemEligibilityPreviewResponse] - def get_item_eligibility_preview(asin, program, opts = {}) - data = get_item_eligibility_preview_with_http_info(asin, program, opts) - return data - end - - # This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item's eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param asin The ASIN of the item for which you want an eligibility preview. - # @param program The program that you want to check eligibility against. - # @param [Hash] opts the optional parameters - # @option opts [Array] :marketplace_ids The identifier for the marketplace in which you want to determine eligibility. Required only when program=INBOUND. - # @return [Array<(GetItemEligibilityPreviewResponse)>] GetItemEligibilityPreviewResponse data, response status code and response headers - def get_item_eligibility_preview_with_http_info(asin, program, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_item_eligibility_preview ...' - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling FbaInboundApi.get_item_eligibility_preview" - end - # verify the required parameter 'program' is set - if @api_client.config.client_side_validation && program.nil? - fail ArgumentError, "Missing the required parameter 'program' when calling FbaInboundApi.get_item_eligibility_preview" - end - # verify enum value - if @api_client.config.client_side_validation && !['INBOUND', 'COMMINGLING'].include?(program) - fail ArgumentError, "invalid value for 'program', must be one of INBOUND, COMMINGLING" - end - # resource path - local_var_path = '/fba/inbound/v1/eligibility/itemPreview' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'asin'] = asin - query_params[:'program'] = program - query_params[:'marketplaceIds'] = @api_client.build_collection_param(opts[:'marketplace_ids'], :csv) if !opts[:'marketplace_ids'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'ItemEligibilityPreview']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_item_eligibility_preview\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/api_client.rb b/vendor/fba_inbound/lib/sp_fba_inbound/api_client.rb deleted file mode 100644 index f4f06d9..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpFbaInbound - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpFbaInbound.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/api_error.rb b/vendor/fba_inbound/lib/sp_fba_inbound/api_error.rb deleted file mode 100644 index 4ea786d..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFbaInbound - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/configuration.rb b/vendor/fba_inbound/lib/sp_fba_inbound/configuration.rb deleted file mode 100644 index c36f9c1..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFbaInbound - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/models/error.rb b/vendor/fba_inbound/lib/sp_fba_inbound/models/error.rb deleted file mode 100644 index fe96d3b..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/models/error.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInbound - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional information that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInbound::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInbound::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInbound.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/models/error_list.rb b/vendor/fba_inbound/lib/sp_fba_inbound/models/error_list.rb deleted file mode 100644 index b8c50d7..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInbound - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInbound::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInbound::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInbound.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/models/get_item_eligibility_preview_response.rb b/vendor/fba_inbound/lib/sp_fba_inbound/models/get_item_eligibility_preview_response.rb deleted file mode 100644 index 485fc1a..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/models/get_item_eligibility_preview_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInbound - # The response schema for the getItemEligibilityPreview operation. - class GetItemEligibilityPreviewResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInbound::GetItemEligibilityPreviewResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInbound::GetItemEligibilityPreviewResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInbound.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/models/item_eligibility_preview.rb b/vendor/fba_inbound/lib/sp_fba_inbound/models/item_eligibility_preview.rb deleted file mode 100644 index 1329f93..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/models/item_eligibility_preview.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInbound - # The response object which contains the ASIN, marketplaceId if required, eligibility program, the eligibility status (boolean), and a list of ineligibility reason codes. - class ItemEligibilityPreview - # The ASIN for which eligibility was determined. - attr_accessor :asin - - # The marketplace for which eligibility was determined. - attr_accessor :marketplace_id - - # The program for which eligibility was determined. - attr_accessor :program - - # Indicates if the item is eligible for the program. - attr_accessor :is_eligible_for_program - - # Potential Ineligibility Reason Codes. - attr_accessor :ineligibility_reason_list - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'asin', - :'marketplace_id' => :'marketplaceId', - :'program' => :'program', - :'is_eligible_for_program' => :'isEligibleForProgram', - :'ineligibility_reason_list' => :'ineligibilityReasonList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'marketplace_id' => :'Object', - :'program' => :'Object', - :'is_eligible_for_program' => :'Object', - :'ineligibility_reason_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInbound::ItemEligibilityPreview` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInbound::ItemEligibilityPreview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'program') - self.program = attributes[:'program'] - end - - if attributes.key?(:'is_eligible_for_program') - self.is_eligible_for_program = attributes[:'is_eligible_for_program'] - end - - if attributes.key?(:'ineligibility_reason_list') - if (value = attributes[:'ineligibility_reason_list']).is_a?(Array) - self.ineligibility_reason_list = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - if @program.nil? - invalid_properties.push('invalid value for "program", program cannot be nil.') - end - - if @is_eligible_for_program.nil? - invalid_properties.push('invalid value for "is_eligible_for_program", is_eligible_for_program cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asin.nil? - return false if @program.nil? - program_validator = EnumAttributeValidator.new('Object', ['INBOUND', 'COMMINGLING']) - return false unless program_validator.valid?(@program) - return false if @is_eligible_for_program.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] program Object to be assigned - def program=(program) - validator = EnumAttributeValidator.new('Object', ['INBOUND', 'COMMINGLING']) - unless validator.valid?(program) - fail ArgumentError, "invalid value for \"program\", must be one of #{validator.allowable_values}." - end - @program = program - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - marketplace_id == o.marketplace_id && - program == o.program && - is_eligible_for_program == o.is_eligible_for_program && - ineligibility_reason_list == o.ineligibility_reason_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, marketplace_id, program, is_eligible_for_program, ineligibility_reason_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInbound.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inbound/lib/sp_fba_inbound/version.rb b/vendor/fba_inbound/lib/sp_fba_inbound/version.rb deleted file mode 100644 index a91f84e..0000000 --- a/vendor/fba_inbound/lib/sp_fba_inbound/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpFbaInbound - VERSION = '1.0.0' -end diff --git a/vendor/fba_inbound/sp_fba_inbound.gemspec b/vendor/fba_inbound/sp_fba_inbound.gemspec deleted file mode 100644 index 397cc13..0000000 --- a/vendor/fba_inbound/sp_fba_inbound.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for FBA Inbound Eligibilty - -#With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_fba_inbound/version" - -Gem::Specification.new do |s| - s.name = "sp_fba_inbound" - s.version = SpFbaInbound::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for FBA Inbound Eligibilty Ruby Gem" - s.description = "With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/fulfillment_inbound_v0/.gitignore b/vendor/fulfillment_inbound_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/fulfillment_inbound_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/fulfillment_inbound_v0/.rspec b/vendor/fulfillment_inbound_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/fulfillment_inbound_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/fulfillment_inbound_v0/.rubocop.yml b/vendor/fulfillment_inbound_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/fulfillment_inbound_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/fulfillment_inbound_v0/.swagger-codegen-ignore b/vendor/fulfillment_inbound_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/fulfillment_inbound_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/fulfillment_inbound_v0/.swagger-codegen/VERSION b/vendor/fulfillment_inbound_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/fulfillment_inbound_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/fulfillment_inbound_v0/Gemfile b/vendor/fulfillment_inbound_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/fulfillment_inbound_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/fulfillment_inbound_v0/README.md b/vendor/fulfillment_inbound_v0/README.md deleted file mode 100644 index e3f10bb..0000000 --- a/vendor/fulfillment_inbound_v0/README.md +++ /dev/null @@ -1,213 +0,0 @@ -# sp_fulfillment_inbound_v0 - -SpFulfillmentInboundV0 - the Ruby gem for the Selling Partner API for Fulfillment Inbound - -The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_fulfillment_inbound_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_fulfillment_inbound_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_fulfillment_inbound_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_fulfillment_inbound_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_fulfillment_inbound_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_fulfillment_inbound_v0' - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -shipment_id = 'shipment_id_example' # String | A shipment identifier originally returned by the createInboundShipmentPlan operation. - - -begin - result = api_instance.get_bill_of_lading(shipment_id) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_bill_of_lading: #{e}" -end - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -shipment_id = 'shipment_id_example' # String | A shipment identifier originally returned by the createInboundShipmentPlan operation. -page_type = 'page_type_example' # String | The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error. -label_type = 'label_type_example' # String | The type of labels requested. -opts = { - number_of_packages: 56, # Integer | The number of packages in the shipment. - package_labels_to_print: ['package_labels_to_print_example'], # Array | A list of identifiers that specify packages for which you want package labels printed. If you provide box content information with the [FBA Inbound Shipment Carton Information Feed](https://developer-docs.amazon.com/sp-api/docs/fulfillment-by-amazon-feed-type-values#fba-inbound-shipment-carton-information-feed), then `PackageLabelsToPrint` must match the `CartonId` values you provide through that feed. If you provide box content information with the Fulfillment Inbound API v2024-03-20, then `PackageLabelsToPrint` must match the `boxID` values from the [`listShipmentBoxes`](https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#listshipmentboxes) response. If these values do not match as required, the operation returns the `IncorrectPackageIdentifier` error code. - number_of_pallets: 56, # Integer | The number of pallets in the shipment. This returns four identical labels for each pallet. - page_size: 56, # Integer | The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000. - page_start_index: 56 # Integer | The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. -} - -begin - result = api_instance.get_labels(shipment_id, page_type, label_type, opts) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_labels: #{e}" -end - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -ship_to_country_code = 'ship_to_country_code_example' # String | The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country. -opts = { - seller_sku_list: ['seller_sku_list_example'], # Array | A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response. - asin_list: ['asin_list_example'] # Array | A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers. -} - -begin - result = api_instance.get_prep_instructions(ship_to_country_code, opts) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_prep_instructions: #{e}" -end - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -query_type = 'query_type_example' # String | Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request. -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace where the product would be stored. -opts = { - last_updated_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - last_updated_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - next_token: 'next_token_example' # String | A string token returned in the response to your previous request. -} - -begin - result = api_instance.get_shipment_items(query_type, marketplace_id, opts) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_shipment_items: #{e}" -end - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -shipment_id = 'shipment_id_example' # String | A shipment identifier used for selecting items in a specific inbound shipment. -opts = { - marketplace_id: 'marketplace_id_example' # String | Deprecated. Do not use. -} - -begin - result = api_instance.get_shipment_items_by_shipment_id(shipment_id, opts) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_shipment_items_by_shipment_id: #{e}" -end - -api_instance = SpFulfillmentInboundV0::FbaInboundApi.new -query_type = 'query_type_example' # String | Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request. -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace where the product would be stored. -opts = { - shipment_status_list: ['shipment_status_list_example'], # Array | A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify. - shipment_id_list: ['shipment_id_list_example'], # Array | A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned. - last_updated_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - last_updated_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - next_token: 'next_token_example' # String | A string token returned in the response to your previous request. -} - -begin - result = api_instance.get_shipments(query_type, marketplace_id, opts) - p result -rescue SpFulfillmentInboundV0::ApiError => e - puts "Exception when calling FbaInboundApi->get_shipments: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_bill_of_lading**](docs/FbaInboundApi.md#get_bill_of_lading) | **GET** /fba/inbound/v0/shipments/{shipmentId}/billOfLading | -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_labels**](docs/FbaInboundApi.md#get_labels) | **GET** /fba/inbound/v0/shipments/{shipmentId}/labels | -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_prep_instructions**](docs/FbaInboundApi.md#get_prep_instructions) | **GET** /fba/inbound/v0/prepInstructions | -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_shipment_items**](docs/FbaInboundApi.md#get_shipment_items) | **GET** /fba/inbound/v0/shipmentItems | -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_shipment_items_by_shipment_id**](docs/FbaInboundApi.md#get_shipment_items_by_shipment_id) | **GET** /fba/inbound/v0/shipments/{shipmentId}/items | -*SpFulfillmentInboundV0::FbaInboundApi* | [**get_shipments**](docs/FbaInboundApi.md#get_shipments) | **GET** /fba/inbound/v0/shipments | - -## Documentation for Models - - - [SpFulfillmentInboundV0::ASINPrepInstructions](docs/ASINPrepInstructions.md) - - [SpFulfillmentInboundV0::ASINPrepInstructionsList](docs/ASINPrepInstructionsList.md) - - [SpFulfillmentInboundV0::Address](docs/Address.md) - - [SpFulfillmentInboundV0::AmazonPrepFeesDetails](docs/AmazonPrepFeesDetails.md) - - [SpFulfillmentInboundV0::AmazonPrepFeesDetailsList](docs/AmazonPrepFeesDetailsList.md) - - [SpFulfillmentInboundV0::Amount](docs/Amount.md) - - [SpFulfillmentInboundV0::BarcodeInstruction](docs/BarcodeInstruction.md) - - [SpFulfillmentInboundV0::BigDecimalType](docs/BigDecimalType.md) - - [SpFulfillmentInboundV0::BillOfLadingDownloadURL](docs/BillOfLadingDownloadURL.md) - - [SpFulfillmentInboundV0::BoxContentsFeeDetails](docs/BoxContentsFeeDetails.md) - - [SpFulfillmentInboundV0::BoxContentsSource](docs/BoxContentsSource.md) - - [SpFulfillmentInboundV0::CurrencyCode](docs/CurrencyCode.md) - - [SpFulfillmentInboundV0::DateStringType](docs/DateStringType.md) - - [SpFulfillmentInboundV0::Error](docs/Error.md) - - [SpFulfillmentInboundV0::ErrorList](docs/ErrorList.md) - - [SpFulfillmentInboundV0::ErrorReason](docs/ErrorReason.md) - - [SpFulfillmentInboundV0::GetBillOfLadingResponse](docs/GetBillOfLadingResponse.md) - - [SpFulfillmentInboundV0::GetLabelsResponse](docs/GetLabelsResponse.md) - - [SpFulfillmentInboundV0::GetPrepInstructionsResponse](docs/GetPrepInstructionsResponse.md) - - [SpFulfillmentInboundV0::GetPrepInstructionsResult](docs/GetPrepInstructionsResult.md) - - [SpFulfillmentInboundV0::GetShipmentItemsResponse](docs/GetShipmentItemsResponse.md) - - [SpFulfillmentInboundV0::GetShipmentItemsResult](docs/GetShipmentItemsResult.md) - - [SpFulfillmentInboundV0::GetShipmentsResponse](docs/GetShipmentsResponse.md) - - [SpFulfillmentInboundV0::GetShipmentsResult](docs/GetShipmentsResult.md) - - [SpFulfillmentInboundV0::InboundShipmentInfo](docs/InboundShipmentInfo.md) - - [SpFulfillmentInboundV0::InboundShipmentItem](docs/InboundShipmentItem.md) - - [SpFulfillmentInboundV0::InboundShipmentItemList](docs/InboundShipmentItemList.md) - - [SpFulfillmentInboundV0::InboundShipmentList](docs/InboundShipmentList.md) - - [SpFulfillmentInboundV0::InvalidASIN](docs/InvalidASIN.md) - - [SpFulfillmentInboundV0::InvalidASINList](docs/InvalidASINList.md) - - [SpFulfillmentInboundV0::InvalidSKU](docs/InvalidSKU.md) - - [SpFulfillmentInboundV0::InvalidSKUList](docs/InvalidSKUList.md) - - [SpFulfillmentInboundV0::LabelDownloadURL](docs/LabelDownloadURL.md) - - [SpFulfillmentInboundV0::LabelPrepType](docs/LabelPrepType.md) - - [SpFulfillmentInboundV0::PrepDetails](docs/PrepDetails.md) - - [SpFulfillmentInboundV0::PrepDetailsList](docs/PrepDetailsList.md) - - [SpFulfillmentInboundV0::PrepGuidance](docs/PrepGuidance.md) - - [SpFulfillmentInboundV0::PrepInstruction](docs/PrepInstruction.md) - - [SpFulfillmentInboundV0::PrepInstructionList](docs/PrepInstructionList.md) - - [SpFulfillmentInboundV0::PrepOwner](docs/PrepOwner.md) - - [SpFulfillmentInboundV0::Quantity](docs/Quantity.md) - - [SpFulfillmentInboundV0::SKUPrepInstructions](docs/SKUPrepInstructions.md) - - [SpFulfillmentInboundV0::SKUPrepInstructionsList](docs/SKUPrepInstructionsList.md) - - [SpFulfillmentInboundV0::ShipmentStatus](docs/ShipmentStatus.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/fulfillment_inbound_v0/Rakefile b/vendor/fulfillment_inbound_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/fulfillment_inbound_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/fulfillment_inbound_v0/git_push.sh b/vendor/fulfillment_inbound_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/fulfillment_inbound_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0.rb deleted file mode 100644 index fcb115e..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0.rb +++ /dev/null @@ -1,154 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_fulfillment_inbound_v0/api_client' -# require 'sp_fulfillment_inbound_v0/api_error' -# require 'sp_fulfillment_inbound_v0/version' -# require 'sp_fulfillment_inbound_v0/configuration' - -# Models -# -# -# require_relative './sp_fulfillment_inbound_v0/models/asin_prep_instructions' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/asin_prep_instructions_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/address' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/amazon_prep_fees_details' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/amazon_prep_fees_details_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/amount' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/barcode_instruction' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/big_decimal_type' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/bill_of_lading_download_url' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/box_contents_fee_details' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/box_contents_source' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/currency_code' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/date_string_type' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/error' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/error_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/error_reason' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_bill_of_lading_response' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_labels_response' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_prep_instructions_response' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_prep_instructions_result' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_shipment_items_response' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_shipment_items_result' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_shipments_response' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/get_shipments_result' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/inbound_shipment_info' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/inbound_shipment_item' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/inbound_shipment_item_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/inbound_shipment_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/invalid_asin' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/invalid_asin_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/invalid_sku' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/invalid_sku_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/label_download_url' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/label_prep_type' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_details' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_details_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_guidance' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_instruction' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_instruction_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/prep_owner' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/quantity' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/sku_prep_instructions' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/sku_prep_instructions_list' -# -# -# require_relative './sp_fulfillment_inbound_v0/models/shipment_status' -# - -# APIs -require_relative './sp_fulfillment_inbound_v0/api/fba_inbound_api' diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api/fba_inbound_api.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api/fba_inbound_api.rb deleted file mode 100644 index 5c4da1b..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api/fba_inbound_api.rb +++ /dev/null @@ -1,444 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFulfillmentInboundV0 - class FbaInboundApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation. - # @param [Hash] opts the optional parameters - # @return [GetBillOfLadingResponse] - def get_bill_of_lading(shipment_id, opts = {}) - data = get_bill_of_lading_with_http_info(shipment_id, opts) - return data - end - - # Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation. - # @param [Hash] opts the optional parameters - # @return [Array<(GetBillOfLadingResponse)>] GetBillOfLadingResponse data, response status code and response headers - def get_bill_of_lading_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_bill_of_lading ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_bill_of_lading" - end - # resource path - local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/billOfLading'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_bill_of_lading\nData: #{data.inspect}" - end - return data - end - # Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation. - # @param page_type The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error. - # @param label_type The type of labels requested. - # @param [Hash] opts the optional parameters - # @option opts [Integer] :number_of_packages The number of packages in the shipment. - # @option opts [Array] :package_labels_to_print A list of identifiers that specify packages for which you want package labels printed. If you provide box content information with the [FBA Inbound Shipment Carton Information Feed](https://developer-docs.amazon.com/sp-api/docs/fulfillment-by-amazon-feed-type-values#fba-inbound-shipment-carton-information-feed), then `PackageLabelsToPrint` must match the `CartonId` values you provide through that feed. If you provide box content information with the Fulfillment Inbound API v2024-03-20, then `PackageLabelsToPrint` must match the `boxID` values from the [`listShipmentBoxes`](https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#listshipmentboxes) response. If these values do not match as required, the operation returns the `IncorrectPackageIdentifier` error code. - # @option opts [Integer] :number_of_pallets The number of pallets in the shipment. This returns four identical labels for each pallet. - # @option opts [Integer] :page_size The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000. - # @option opts [Integer] :page_start_index The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. - # @return [GetLabelsResponse] - def get_labels(shipment_id, page_type, label_type, opts = {}) - data = get_labels_with_http_info(shipment_id, page_type, label_type, opts) - return data - end - - # Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation. - # @param page_type The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error. - # @param label_type The type of labels requested. - # @param [Hash] opts the optional parameters - # @option opts [Integer] :number_of_packages The number of packages in the shipment. - # @option opts [Array] :package_labels_to_print A list of identifiers that specify packages for which you want package labels printed. If you provide box content information with the [FBA Inbound Shipment Carton Information Feed](https://developer-docs.amazon.com/sp-api/docs/fulfillment-by-amazon-feed-type-values#fba-inbound-shipment-carton-information-feed), then `PackageLabelsToPrint` must match the `CartonId` values you provide through that feed. If you provide box content information with the Fulfillment Inbound API v2024-03-20, then `PackageLabelsToPrint` must match the `boxID` values from the [`listShipmentBoxes`](https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#listshipmentboxes) response. If these values do not match as required, the operation returns the `IncorrectPackageIdentifier` error code. - # @option opts [Integer] :number_of_pallets The number of pallets in the shipment. This returns four identical labels for each pallet. - # @option opts [Integer] :page_size The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000. - # @option opts [Integer] :page_start_index The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. - # @return [Array<(GetLabelsResponse)>] GetLabelsResponse data, response status code and response headers - def get_labels_with_http_info(shipment_id, page_type, label_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_labels ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_labels" - end - # verify the required parameter 'page_type' is set - if @api_client.config.client_side_validation && page_type.nil? - fail ArgumentError, "Missing the required parameter 'page_type' when calling FbaInboundApi.get_labels" - end - # verify enum value - if @api_client.config.client_side_validation && !['PackageLabel_Letter_2', 'PackageLabel_Letter_4', 'PackageLabel_Letter_6', 'PackageLabel_Letter_6_CarrierLeft', 'PackageLabel_A4_2', 'PackageLabel_A4_4', 'PackageLabel_Plain_Paper', 'PackageLabel_Plain_Paper_CarrierBottom', 'PackageLabel_Thermal', 'PackageLabel_Thermal_Unified', 'PackageLabel_Thermal_NonPCP', 'PackageLabel_Thermal_No_Carrier_Rotation'].include?(page_type) - fail ArgumentError, "invalid value for 'page_type', must be one of PackageLabel_Letter_2, PackageLabel_Letter_4, PackageLabel_Letter_6, PackageLabel_Letter_6_CarrierLeft, PackageLabel_A4_2, PackageLabel_A4_4, PackageLabel_Plain_Paper, PackageLabel_Plain_Paper_CarrierBottom, PackageLabel_Thermal, PackageLabel_Thermal_Unified, PackageLabel_Thermal_NonPCP, PackageLabel_Thermal_No_Carrier_Rotation" - end - # verify the required parameter 'label_type' is set - if @api_client.config.client_side_validation && label_type.nil? - fail ArgumentError, "Missing the required parameter 'label_type' when calling FbaInboundApi.get_labels" - end - # verify enum value - if @api_client.config.client_side_validation && !['BARCODE_2D', 'UNIQUE', 'PALLET'].include?(label_type) - fail ArgumentError, "invalid value for 'label_type', must be one of BARCODE_2D, UNIQUE, PALLET" - end - # resource path - local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/labels'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'PageType'] = page_type - query_params[:'LabelType'] = label_type - query_params[:'NumberOfPackages'] = opts[:'number_of_packages'] if !opts[:'number_of_packages'].nil? - query_params[:'PackageLabelsToPrint'] = @api_client.build_collection_param(opts[:'package_labels_to_print'], :csv) if !opts[:'package_labels_to_print'].nil? - query_params[:'NumberOfPallets'] = opts[:'number_of_pallets'] if !opts[:'number_of_pallets'].nil? - query_params[:'PageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'PageStartIndex'] = opts[:'page_start_index'] if !opts[:'page_start_index'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_labels\nData: #{data.inspect}" - end - return data - end - # Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param ship_to_country_code The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country. - # @param [Hash] opts the optional parameters - # @option opts [Array] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response. - # @option opts [Array] :asin_list A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers. - # @return [GetPrepInstructionsResponse] - def get_prep_instructions(ship_to_country_code, opts = {}) - data = get_prep_instructions_with_http_info(ship_to_country_code, opts) - return data - end - - # Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param ship_to_country_code The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country. - # @param [Hash] opts the optional parameters - # @option opts [Array] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response. - # @option opts [Array] :asin_list A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers. - # @return [Array<(GetPrepInstructionsResponse)>] GetPrepInstructionsResponse data, response status code and response headers - def get_prep_instructions_with_http_info(ship_to_country_code, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_prep_instructions ...' - end - # verify the required parameter 'ship_to_country_code' is set - if @api_client.config.client_side_validation && ship_to_country_code.nil? - fail ArgumentError, "Missing the required parameter 'ship_to_country_code' when calling FbaInboundApi.get_prep_instructions" - end - # resource path - local_var_path = '/fba/inbound/v0/prepInstructions' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'ShipToCountryCode'] = ship_to_country_code - query_params[:'SellerSKUList'] = @api_client.build_collection_param(opts[:'seller_sku_list'], :csv) if !opts[:'seller_sku_list'].nil? - query_params[:'ASINList'] = @api_client.build_collection_param(opts[:'asin_list'], :csv) if !opts[:'asin_list'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_prep_instructions\nData: #{data.inspect}" - end - return data - end - # Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param query_type Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request. - # @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored. - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :last_updated_after A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [DateTime] :last_updated_before A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [String] :next_token A string token returned in the response to your previous request. - # @return [GetShipmentItemsResponse] - def get_shipment_items(query_type, marketplace_id, opts = {}) - data = get_shipment_items_with_http_info(query_type, marketplace_id, opts) - return data - end - - # Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param query_type Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request. - # @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored. - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :last_updated_after A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [DateTime] :last_updated_before A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [String] :next_token A string token returned in the response to your previous request. - # @return [Array<(GetShipmentItemsResponse)>] GetShipmentItemsResponse data, response status code and response headers - def get_shipment_items_with_http_info(query_type, marketplace_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipment_items ...' - end - # verify the required parameter 'query_type' is set - if @api_client.config.client_side_validation && query_type.nil? - fail ArgumentError, "Missing the required parameter 'query_type' when calling FbaInboundApi.get_shipment_items" - end - # verify enum value - if @api_client.config.client_side_validation && !['DATE_RANGE', 'NEXT_TOKEN'].include?(query_type) - fail ArgumentError, "invalid value for 'query_type', must be one of DATE_RANGE, NEXT_TOKEN" - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_shipment_items" - end - # resource path - local_var_path = '/fba/inbound/v0/shipmentItems' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'QueryType'] = query_type - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'LastUpdatedAfter'] = opts[:'last_updated_after'] if !opts[:'last_updated_after'].nil? - query_params[:'LastUpdatedBefore'] = opts[:'last_updated_before'] if !opts[:'last_updated_before'].nil? - query_params[:'NextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_shipment_items\nData: #{data.inspect}" - end - return data - end - # Returns a list of items in a specified inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier used for selecting items in a specific inbound shipment. - # @param [Hash] opts the optional parameters - # @option opts [String] :marketplace_id Deprecated. Do not use. - # @return [GetShipmentItemsResponse] - def get_shipment_items_by_shipment_id(shipment_id, opts = {}) - data = get_shipment_items_by_shipment_id_with_http_info(shipment_id, opts) - return data - end - - # Returns a list of items in a specified inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id A shipment identifier used for selecting items in a specific inbound shipment. - # @param [Hash] opts the optional parameters - # @option opts [String] :marketplace_id Deprecated. Do not use. - # @return [Array<(GetShipmentItemsResponse)>] GetShipmentItemsResponse data, response status code and response headers - def get_shipment_items_by_shipment_id_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipment_items_by_shipment_id ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_shipment_items_by_shipment_id" - end - # resource path - local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/items'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = opts[:'marketplace_id'] if !opts[:'marketplace_id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_shipment_items_by_shipment_id\nData: #{data.inspect}" - end - return data - end - # Returns a list of inbound shipments based on criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param query_type Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request. - # @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored. - # @param [Hash] opts the optional parameters - # @option opts [Array] :shipment_status_list A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify. - # @option opts [Array] :shipment_id_list A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned. - # @option opts [DateTime] :last_updated_after A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [DateTime] :last_updated_before A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [String] :next_token A string token returned in the response to your previous request. - # @return [GetShipmentsResponse] - def get_shipments(query_type, marketplace_id, opts = {}) - data = get_shipments_with_http_info(query_type, marketplace_id, opts) - return data - end - - # Returns a list of inbound shipments based on criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param query_type Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request. - # @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored. - # @param [Hash] opts the optional parameters - # @option opts [Array] :shipment_status_list A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify. - # @option opts [Array] :shipment_id_list A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned. - # @option opts [DateTime] :last_updated_after A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [DateTime] :last_updated_before A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller. - # @option opts [String] :next_token A string token returned in the response to your previous request. - # @return [Array<(GetShipmentsResponse)>] GetShipmentsResponse data, response status code and response headers - def get_shipments_with_http_info(query_type, marketplace_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipments ...' - end - # verify the required parameter 'query_type' is set - if @api_client.config.client_side_validation && query_type.nil? - fail ArgumentError, "Missing the required parameter 'query_type' when calling FbaInboundApi.get_shipments" - end - # verify enum value - if @api_client.config.client_side_validation && !['SHIPMENT', 'DATE_RANGE', 'NEXT_TOKEN'].include?(query_type) - fail ArgumentError, "invalid value for 'query_type', must be one of SHIPMENT, DATE_RANGE, NEXT_TOKEN" - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_shipments" - end - if @api_client.config.client_side_validation && opts[:'shipment_status_list'] && !opts[:'shipment_status_list'].all? { |item| ['WORKING', 'READY_TO_SHIP', 'SHIPPED', 'RECEIVING', 'CANCELLED', 'DELETED', 'CLOSED', 'ERROR', 'IN_TRANSIT', 'DELIVERED', 'CHECKED_IN'].include?(item) } - fail ArgumentError, 'invalid value for "shipment_status_list", must include one of WORKING, READY_TO_SHIP, SHIPPED, RECEIVING, CANCELLED, DELETED, CLOSED, ERROR, IN_TRANSIT, DELIVERED, CHECKED_IN' - end - # resource path - local_var_path = '/fba/inbound/v0/shipments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'QueryType'] = query_type - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ShipmentStatusList'] = @api_client.build_collection_param(opts[:'shipment_status_list'], :csv) if !opts[:'shipment_status_list'].nil? - query_params[:'ShipmentIdList'] = @api_client.build_collection_param(opts[:'shipment_id_list'], :csv) if !opts[:'shipment_id_list'].nil? - query_params[:'LastUpdatedAfter'] = opts[:'last_updated_after'] if !opts[:'last_updated_after'].nil? - query_params[:'LastUpdatedBefore'] = opts[:'last_updated_before'] if !opts[:'last_updated_before'].nil? - query_params[:'NextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FbaInboundApi#get_shipments\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_client.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_client.rb deleted file mode 100644 index 7d08d95..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpFulfillmentInboundV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_error.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_error.rb deleted file mode 100644 index 7a38885..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFulfillmentInboundV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/configuration.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/configuration.rb deleted file mode 100644 index e6bb3eb..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFulfillmentInboundV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/address.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/address.rb deleted file mode 100644 index 5aa5dfc..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/address.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Specific details to identify a place. - class Address - # Name of the individual or business. - attr_accessor :name - - # The street address information. - attr_accessor :address_line1 - - # Additional street address information, if required. - attr_accessor :address_line2 - - # The district or county. - attr_accessor :district_or_county - - # The city. - attr_accessor :city - - # The state or province code. If state or province codes are used in your marketplace, it is recommended that you include one with your request. This helps Amazon to select the most appropriate Amazon fulfillment center for your inbound shipment plan. - attr_accessor :state_or_province_code - - # The country code in two-character ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The postal code. If postal codes are used in your marketplace, we recommended that you include one with your request. This helps Amazon select the most appropriate Amazon fulfillment center for the inbound shipment plan. - attr_accessor :postal_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'address_line1' => :'AddressLine1', - :'address_line2' => :'AddressLine2', - :'district_or_county' => :'DistrictOrCounty', - :'city' => :'City', - :'state_or_province_code' => :'StateOrProvinceCode', - :'country_code' => :'CountryCode', - :'postal_code' => :'PostalCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'district_or_county' => :'Object', - :'city' => :'Object', - :'state_or_province_code' => :'Object', - :'country_code' => :'Object', - :'postal_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'district_or_county') - self.district_or_county = attributes[:'district_or_county'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'state_or_province_code') - self.state_or_province_code = attributes[:'state_or_province_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @state_or_province_code.nil? - invalid_properties.push('invalid value for "state_or_province_code", state_or_province_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @city.nil? - return false if @state_or_province_code.nil? - return false if @country_code.nil? - return false if @postal_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - district_or_county == o.district_or_county && - city == o.city && - state_or_province_code == o.state_or_province_code && - country_code == o.country_code && - postal_code == o.postal_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, district_or_county, city, state_or_province_code, country_code, postal_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details.rb deleted file mode 100644 index c75bce5..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The fees for Amazon to prep goods for shipment. - class AmazonPrepFeesDetails - attr_accessor :prep_instruction - - attr_accessor :fee_per_unit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prep_instruction' => :'PrepInstruction', - :'fee_per_unit' => :'FeePerUnit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'prep_instruction' => :'Object', - :'fee_per_unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::AmazonPrepFeesDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::AmazonPrepFeesDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prep_instruction') - self.prep_instruction = attributes[:'prep_instruction'] - end - - if attributes.key?(:'fee_per_unit') - self.fee_per_unit = attributes[:'fee_per_unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prep_instruction == o.prep_instruction && - fee_per_unit == o.fee_per_unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prep_instruction, fee_per_unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details_list.rb deleted file mode 100644 index 4ef3874..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amazon_prep_fees_details_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of preparation instructions and fees for Amazon to prep goods for shipment. - class AmazonPrepFeesDetailsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::AmazonPrepFeesDetailsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::AmazonPrepFeesDetailsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amount.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amount.rb deleted file mode 100644 index ea7c502..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/amount.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The monetary value. - class Amount - attr_accessor :currency_code - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'CurrencyCode', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::Amount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::Amount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions.rb deleted file mode 100644 index ef78fd5..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Item preparation instructions to help with item sourcing decisions. - class ASINPrepInstructions - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - attr_accessor :barcode_instruction - - attr_accessor :prep_guidance - - attr_accessor :prep_instruction_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'ASIN', - :'barcode_instruction' => :'BarcodeInstruction', - :'prep_guidance' => :'PrepGuidance', - :'prep_instruction_list' => :'PrepInstructionList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'barcode_instruction' => :'Object', - :'prep_guidance' => :'Object', - :'prep_instruction_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::ASINPrepInstructions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::ASINPrepInstructions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'barcode_instruction') - self.barcode_instruction = attributes[:'barcode_instruction'] - end - - if attributes.key?(:'prep_guidance') - self.prep_guidance = attributes[:'prep_guidance'] - end - - if attributes.key?(:'prep_instruction_list') - self.prep_instruction_list = attributes[:'prep_instruction_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - barcode_instruction == o.barcode_instruction && - prep_guidance == o.prep_guidance && - prep_instruction_list == o.prep_instruction_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, barcode_instruction, prep_guidance, prep_instruction_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions_list.rb deleted file mode 100644 index afa83c3..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/asin_prep_instructions_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of item preparation instructions. - class ASINPrepInstructionsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::ASINPrepInstructionsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::ASINPrepInstructionsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/barcode_instruction.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/barcode_instruction.rb deleted file mode 100644 index c732ff0..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/barcode_instruction.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class BarcodeInstruction - REQUIRES_FNSKU_LABEL = 'RequiresFNSKULabel'.freeze - CAN_USE_ORIGINAL_BARCODE = 'CanUseOriginalBarcode'.freeze - MUST_PROVIDE_SELLER_SKU = 'MustProvideSellerSKU'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = BarcodeInstruction.constants.select { |c| BarcodeInstruction::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #BarcodeInstruction" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/big_decimal_type.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/big_decimal_type.rb deleted file mode 100644 index 07fbe88..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/big_decimal_type.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Number format that supports decimal. - class BigDecimalType - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::BigDecimalType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::BigDecimalType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/bill_of_lading_download_url.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/bill_of_lading_download_url.rb deleted file mode 100644 index c4e03b8..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/bill_of_lading_download_url.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Download URL for the bill of lading. - class BillOfLadingDownloadURL - # URL to download the bill of lading for the package. Note: The URL will only be valid for 15 seconds - attr_accessor :download_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'download_url' => :'DownloadURL' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'download_url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::BillOfLadingDownloadURL` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::BillOfLadingDownloadURL`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'download_url') - self.download_url = attributes[:'download_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - download_url == o.download_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [download_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_fee_details.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_fee_details.rb deleted file mode 100644 index 44e2a90..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_fee_details.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The manual processing fee per unit and total fee for a shipment. - class BoxContentsFeeDetails - attr_accessor :total_units - - attr_accessor :fee_per_unit - - attr_accessor :total_fee - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_units' => :'TotalUnits', - :'fee_per_unit' => :'FeePerUnit', - :'total_fee' => :'TotalFee' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_units' => :'Object', - :'fee_per_unit' => :'Object', - :'total_fee' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::BoxContentsFeeDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::BoxContentsFeeDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_units') - self.total_units = attributes[:'total_units'] - end - - if attributes.key?(:'fee_per_unit') - self.fee_per_unit = attributes[:'fee_per_unit'] - end - - if attributes.key?(:'total_fee') - self.total_fee = attributes[:'total_fee'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_units == o.total_units && - fee_per_unit == o.fee_per_unit && - total_fee == o.total_fee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_units, fee_per_unit, total_fee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_source.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_source.rb deleted file mode 100644 index d2137a8..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/box_contents_source.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class BoxContentsSource - NONE = 'NONE'.freeze - FEED = 'FEED'.freeze - N2_D_BARCODE = '2D_BARCODE'.freeze - INTERACTIVE = 'INTERACTIVE'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = BoxContentsSource.constants.select { |c| BoxContentsSource::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #BoxContentsSource" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/currency_code.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/currency_code.rb deleted file mode 100644 index 34f3e31..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/currency_code.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class CurrencyCode - USD = 'USD'.freeze - GBP = 'GBP'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CurrencyCode.constants.select { |c| CurrencyCode::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CurrencyCode" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/date_string_type.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/date_string_type.rb deleted file mode 100644 index b1711f3..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/date_string_type.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Type containing date in string format - class DateStringType - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::DateStringType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::DateStringType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error.rb deleted file mode 100644 index ef1a658..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occured. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_list.rb deleted file mode 100644 index 10ca5a5..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_reason.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_reason.rb deleted file mode 100644 index d21daf9..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/error_reason.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class ErrorReason - DOES_NOT_EXIST = 'DoesNotExist'.freeze - INVALID_ASIN = 'InvalidASIN'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ErrorReason.constants.select { |c| ErrorReason::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ErrorReason" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_bill_of_lading_response.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_bill_of_lading_response.rb deleted file mode 100644 index 7aa967b..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_bill_of_lading_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The response schema for the getBillOfLading operation. - class GetBillOfLadingResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetBillOfLadingResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetBillOfLadingResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_labels_response.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_labels_response.rb deleted file mode 100644 index a035a3a..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_labels_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The response schema for the getLabels operation. - class GetLabelsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetLabelsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetLabelsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_response.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_response.rb deleted file mode 100644 index 6a4ef98..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The response schema for the getPrepInstructions operation. - class GetPrepInstructionsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetPrepInstructionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetPrepInstructionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_result.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_result.rb deleted file mode 100644 index eee864d..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_prep_instructions_result.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Result for the get prep instructions operation - class GetPrepInstructionsResult - attr_accessor :sku_prep_instructions_list - - attr_accessor :invalid_sku_list - - attr_accessor :asin_prep_instructions_list - - attr_accessor :invalid_asin_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sku_prep_instructions_list' => :'SKUPrepInstructionsList', - :'invalid_sku_list' => :'InvalidSKUList', - :'asin_prep_instructions_list' => :'ASINPrepInstructionsList', - :'invalid_asin_list' => :'InvalidASINList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'sku_prep_instructions_list' => :'Object', - :'invalid_sku_list' => :'Object', - :'asin_prep_instructions_list' => :'Object', - :'invalid_asin_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetPrepInstructionsResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetPrepInstructionsResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sku_prep_instructions_list') - self.sku_prep_instructions_list = attributes[:'sku_prep_instructions_list'] - end - - if attributes.key?(:'invalid_sku_list') - self.invalid_sku_list = attributes[:'invalid_sku_list'] - end - - if attributes.key?(:'asin_prep_instructions_list') - self.asin_prep_instructions_list = attributes[:'asin_prep_instructions_list'] - end - - if attributes.key?(:'invalid_asin_list') - self.invalid_asin_list = attributes[:'invalid_asin_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sku_prep_instructions_list == o.sku_prep_instructions_list && - invalid_sku_list == o.invalid_sku_list && - asin_prep_instructions_list == o.asin_prep_instructions_list && - invalid_asin_list == o.invalid_asin_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sku_prep_instructions_list, invalid_sku_list, asin_prep_instructions_list, invalid_asin_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_response.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_response.rb deleted file mode 100644 index b003517..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The response schema for the getShipmentItems operation. - class GetShipmentItemsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentItemsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentItemsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_result.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_result.rb deleted file mode 100644 index 3279bf7..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipment_items_result.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Result for the get shipment items operation - class GetShipmentItemsResult - attr_accessor :item_data - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_data' => :'ItemData', - :'next_token' => :'NextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_data' => :'Object', - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentItemsResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentItemsResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_data') - self.item_data = attributes[:'item_data'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_data == o.item_data && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_data, next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_response.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_response.rb deleted file mode 100644 index 0be8980..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The response schema for the getShipments operation. - class GetShipmentsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_result.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_result.rb deleted file mode 100644 index b0c97e0..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/get_shipments_result.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Result for the get shipments operation - class GetShipmentsResult - attr_accessor :shipment_data - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_data' => :'ShipmentData', - :'next_token' => :'NextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_data' => :'Object', - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentsResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::GetShipmentsResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_data') - self.shipment_data = attributes[:'shipment_data'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_data == o.shipment_data && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_data, next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_info.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_info.rb deleted file mode 100644 index e282e76..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_info.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Information about the seller's inbound shipments. Returned by the listInboundShipments operation. - class InboundShipmentInfo - # The shipment identifier submitted in the request. - attr_accessor :shipment_id - - # The name for the inbound shipment. - attr_accessor :shipment_name - - attr_accessor :ship_from_address - - # An Amazon fulfillment center identifier created by Amazon. - attr_accessor :destination_fulfillment_center_id - - attr_accessor :shipment_status - - attr_accessor :label_prep_type - - # Indicates whether or not an inbound shipment contains case-packed boxes. When AreCasesRequired = true for an inbound shipment, all items in the inbound shipment must be case packed. - attr_accessor :are_cases_required - - attr_accessor :confirmed_need_by_date - - attr_accessor :box_contents_source - - attr_accessor :estimated_box_contents_fee - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'ShipmentId', - :'shipment_name' => :'ShipmentName', - :'ship_from_address' => :'ShipFromAddress', - :'destination_fulfillment_center_id' => :'DestinationFulfillmentCenterId', - :'shipment_status' => :'ShipmentStatus', - :'label_prep_type' => :'LabelPrepType', - :'are_cases_required' => :'AreCasesRequired', - :'confirmed_need_by_date' => :'ConfirmedNeedByDate', - :'box_contents_source' => :'BoxContentsSource', - :'estimated_box_contents_fee' => :'EstimatedBoxContentsFee' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'shipment_name' => :'Object', - :'ship_from_address' => :'Object', - :'destination_fulfillment_center_id' => :'Object', - :'shipment_status' => :'Object', - :'label_prep_type' => :'Object', - :'are_cases_required' => :'Object', - :'confirmed_need_by_date' => :'Object', - :'box_contents_source' => :'Object', - :'estimated_box_contents_fee' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'shipment_name') - self.shipment_name = attributes[:'shipment_name'] - end - - if attributes.key?(:'ship_from_address') - self.ship_from_address = attributes[:'ship_from_address'] - end - - if attributes.key?(:'destination_fulfillment_center_id') - self.destination_fulfillment_center_id = attributes[:'destination_fulfillment_center_id'] - end - - if attributes.key?(:'shipment_status') - self.shipment_status = attributes[:'shipment_status'] - end - - if attributes.key?(:'label_prep_type') - self.label_prep_type = attributes[:'label_prep_type'] - end - - if attributes.key?(:'are_cases_required') - self.are_cases_required = attributes[:'are_cases_required'] - end - - if attributes.key?(:'confirmed_need_by_date') - self.confirmed_need_by_date = attributes[:'confirmed_need_by_date'] - end - - if attributes.key?(:'box_contents_source') - self.box_contents_source = attributes[:'box_contents_source'] - end - - if attributes.key?(:'estimated_box_contents_fee') - self.estimated_box_contents_fee = attributes[:'estimated_box_contents_fee'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @ship_from_address.nil? - invalid_properties.push('invalid value for "ship_from_address", ship_from_address cannot be nil.') - end - - if @are_cases_required.nil? - invalid_properties.push('invalid value for "are_cases_required", are_cases_required cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @ship_from_address.nil? - return false if @are_cases_required.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - shipment_name == o.shipment_name && - ship_from_address == o.ship_from_address && - destination_fulfillment_center_id == o.destination_fulfillment_center_id && - shipment_status == o.shipment_status && - label_prep_type == o.label_prep_type && - are_cases_required == o.are_cases_required && - confirmed_need_by_date == o.confirmed_need_by_date && - box_contents_source == o.box_contents_source && - estimated_box_contents_fee == o.estimated_box_contents_fee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, shipment_name, ship_from_address, destination_fulfillment_center_id, shipment_status, label_prep_type, are_cases_required, confirmed_need_by_date, box_contents_source, estimated_box_contents_fee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item.rb deleted file mode 100644 index f0491b4..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Item information for an inbound shipment. Submitted with a call to the createInboundShipment or updateInboundShipment operation. - class InboundShipmentItem - # A shipment identifier originally returned by the createInboundShipmentPlan operation. - attr_accessor :shipment_id - - # The seller SKU of the item. - attr_accessor :seller_sku - - # Amazon's fulfillment network SKU of the item. - attr_accessor :fulfillment_network_sku - - attr_accessor :quantity_shipped - - attr_accessor :quantity_received - - attr_accessor :quantity_in_case - - attr_accessor :release_date - - attr_accessor :prep_details_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'ShipmentId', - :'seller_sku' => :'SellerSKU', - :'fulfillment_network_sku' => :'FulfillmentNetworkSKU', - :'quantity_shipped' => :'QuantityShipped', - :'quantity_received' => :'QuantityReceived', - :'quantity_in_case' => :'QuantityInCase', - :'release_date' => :'ReleaseDate', - :'prep_details_list' => :'PrepDetailsList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'seller_sku' => :'Object', - :'fulfillment_network_sku' => :'Object', - :'quantity_shipped' => :'Object', - :'quantity_received' => :'Object', - :'quantity_in_case' => :'Object', - :'release_date' => :'Object', - :'prep_details_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'fulfillment_network_sku') - self.fulfillment_network_sku = attributes[:'fulfillment_network_sku'] - end - - if attributes.key?(:'quantity_shipped') - self.quantity_shipped = attributes[:'quantity_shipped'] - end - - if attributes.key?(:'quantity_received') - self.quantity_received = attributes[:'quantity_received'] - end - - if attributes.key?(:'quantity_in_case') - self.quantity_in_case = attributes[:'quantity_in_case'] - end - - if attributes.key?(:'release_date') - self.release_date = attributes[:'release_date'] - end - - if attributes.key?(:'prep_details_list') - self.prep_details_list = attributes[:'prep_details_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @quantity_shipped.nil? - invalid_properties.push('invalid value for "quantity_shipped", quantity_shipped cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @quantity_shipped.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - seller_sku == o.seller_sku && - fulfillment_network_sku == o.fulfillment_network_sku && - quantity_shipped == o.quantity_shipped && - quantity_received == o.quantity_received && - quantity_in_case == o.quantity_in_case && - release_date == o.release_date && - prep_details_list == o.prep_details_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, seller_sku, fulfillment_network_sku, quantity_shipped, quantity_received, quantity_in_case, release_date, prep_details_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item_list.rb deleted file mode 100644 index fc943cf..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of inbound shipment item information. - class InboundShipmentItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_list.rb deleted file mode 100644 index d66df79..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/inbound_shipment_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of inbound shipment information. - class InboundShipmentList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InboundShipmentList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin.rb deleted file mode 100644 index c99894d..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Contains details about an invalid ASIN - class InvalidASIN - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - attr_accessor :error_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'ASIN', - :'error_reason' => :'ErrorReason' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'error_reason' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InvalidASIN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InvalidASIN`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'error_reason') - self.error_reason = attributes[:'error_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - error_reason == o.error_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, error_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin_list.rb deleted file mode 100644 index 4e04955..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_asin_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of invalid ASIN values and the reasons they are invalid. - class InvalidASINList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InvalidASINList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InvalidASINList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku.rb deleted file mode 100644 index 25a6698..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Contains detail about an invalid SKU - class InvalidSKU - # The seller SKU of the item. - attr_accessor :seller_sku - - attr_accessor :error_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'SellerSKU', - :'error_reason' => :'ErrorReason' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'error_reason' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InvalidSKU` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InvalidSKU`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'error_reason') - self.error_reason = attributes[:'error_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - error_reason == o.error_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, error_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku_list.rb deleted file mode 100644 index 6835e5f..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/invalid_sku_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of invalid SKU values and the reason they are invalid. - class InvalidSKUList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::InvalidSKUList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::InvalidSKUList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_download_url.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_download_url.rb deleted file mode 100644 index 90c113e..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_download_url.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Download URL for a label - class LabelDownloadURL - # URL to download the label for the package. Note: The URL will only be valid for 15 seconds - attr_accessor :download_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'download_url' => :'DownloadURL' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'download_url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::LabelDownloadURL` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::LabelDownloadURL`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'download_url') - self.download_url = attributes[:'download_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - download_url == o.download_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [download_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_prep_type.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_prep_type.rb deleted file mode 100644 index 2571036..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/label_prep_type.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class LabelPrepType - NO_LABEL = 'NO_LABEL'.freeze - SELLER_LABEL = 'SELLER_LABEL'.freeze - AMAZON_LABEL = 'AMAZON_LABEL'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = LabelPrepType.constants.select { |c| LabelPrepType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #LabelPrepType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details.rb deleted file mode 100644 index 94b24b0..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Preparation instructions and who is responsible for the preparation. - class PrepDetails - attr_accessor :prep_instruction - - attr_accessor :prep_owner - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prep_instruction' => :'PrepInstruction', - :'prep_owner' => :'PrepOwner' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'prep_instruction' => :'Object', - :'prep_owner' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::PrepDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::PrepDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prep_instruction') - self.prep_instruction = attributes[:'prep_instruction'] - end - - if attributes.key?(:'prep_owner') - self.prep_owner = attributes[:'prep_owner'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @prep_instruction.nil? - invalid_properties.push('invalid value for "prep_instruction", prep_instruction cannot be nil.') - end - - if @prep_owner.nil? - invalid_properties.push('invalid value for "prep_owner", prep_owner cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @prep_instruction.nil? - return false if @prep_owner.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prep_instruction == o.prep_instruction && - prep_owner == o.prep_owner - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prep_instruction, prep_owner].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details_list.rb deleted file mode 100644 index 1688831..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_details_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of preparation instructions and who is responsible for that preparation. - class PrepDetailsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::PrepDetailsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::PrepDetailsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_guidance.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_guidance.rb deleted file mode 100644 index a98ad72..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_guidance.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class PrepGuidance - CONSULT_HELP_DOCUMENTS = 'ConsultHelpDocuments'.freeze - NO_ADDITIONAL_PREP_REQUIRED = 'NoAdditionalPrepRequired'.freeze - SEE_PREP_INSTRUCTIONS_LIST = 'SeePrepInstructionsList'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = PrepGuidance.constants.select { |c| PrepGuidance::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #PrepGuidance" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction.rb deleted file mode 100644 index 9dcb5e7..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class PrepInstruction - POLYBAGGING = 'Polybagging'.freeze - BUBBLE_WRAPPING = 'BubbleWrapping'.freeze - TAPING = 'Taping'.freeze - BLACK_SHRINK_WRAPPING = 'BlackShrinkWrapping'.freeze - LABELING = 'Labeling'.freeze - HANG_GARMENT = 'HangGarment'.freeze - SET_CREATION = 'SetCreation'.freeze - BOXING = 'Boxing'.freeze - REMOVE_FROM_HANGER = 'RemoveFromHanger'.freeze - DEBUNDLE = 'Debundle'.freeze - SUFFOCATION_STICKERING = 'SuffocationStickering'.freeze - CAP_SEALING = 'CapSealing'.freeze - SET_STICKERING = 'SetStickering'.freeze - BLANK_STICKERING = 'BlankStickering'.freeze - SHIPS_IN_PRODUCT_PACKAGING = 'ShipsInProductPackaging'.freeze - NO_PREP = 'NoPrep'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = PrepInstruction.constants.select { |c| PrepInstruction::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #PrepInstruction" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction_list.rb deleted file mode 100644 index 8710790..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_instruction_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of preparation instructions to help with item sourcing decisions. - class PrepInstructionList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::PrepInstructionList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::PrepInstructionList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_owner.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_owner.rb deleted file mode 100644 index c382d86..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/prep_owner.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class PrepOwner - AMAZON = 'AMAZON'.freeze - SELLER = 'SELLER'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = PrepOwner.constants.select { |c| PrepOwner::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #PrepOwner" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/quantity.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/quantity.rb deleted file mode 100644 index 2304f73..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/quantity.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # The item quantity. - class Quantity - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::Quantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::Quantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/shipment_status.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/shipment_status.rb deleted file mode 100644 index 9af9240..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/shipment_status.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - class ShipmentStatus - WORKING = 'WORKING'.freeze - SHIPPED = 'SHIPPED'.freeze - RECEIVING = 'RECEIVING'.freeze - CANCELLED = 'CANCELLED'.freeze - DELETED = 'DELETED'.freeze - CLOSED = 'CLOSED'.freeze - ERROR = 'ERROR'.freeze - IN_TRANSIT = 'IN_TRANSIT'.freeze - DELIVERED = 'DELIVERED'.freeze - CHECKED_IN = 'CHECKED_IN'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ShipmentStatus.constants.select { |c| ShipmentStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ShipmentStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions.rb deleted file mode 100644 index c28c00f..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # Labeling requirements and item preparation instructions to help you prepare items for shipment to Amazon's fulfillment network. - class SKUPrepInstructions - # The seller SKU of the item. - attr_accessor :seller_sku - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - attr_accessor :barcode_instruction - - attr_accessor :prep_guidance - - attr_accessor :prep_instruction_list - - attr_accessor :amazon_prep_fees_details_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'SellerSKU', - :'asin' => :'ASIN', - :'barcode_instruction' => :'BarcodeInstruction', - :'prep_guidance' => :'PrepGuidance', - :'prep_instruction_list' => :'PrepInstructionList', - :'amazon_prep_fees_details_list' => :'AmazonPrepFeesDetailsList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'asin' => :'Object', - :'barcode_instruction' => :'Object', - :'prep_guidance' => :'Object', - :'prep_instruction_list' => :'Object', - :'amazon_prep_fees_details_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::SKUPrepInstructions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::SKUPrepInstructions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'barcode_instruction') - self.barcode_instruction = attributes[:'barcode_instruction'] - end - - if attributes.key?(:'prep_guidance') - self.prep_guidance = attributes[:'prep_guidance'] - end - - if attributes.key?(:'prep_instruction_list') - self.prep_instruction_list = attributes[:'prep_instruction_list'] - end - - if attributes.key?(:'amazon_prep_fees_details_list') - self.amazon_prep_fees_details_list = attributes[:'amazon_prep_fees_details_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - asin == o.asin && - barcode_instruction == o.barcode_instruction && - prep_guidance == o.prep_guidance && - prep_instruction_list == o.prep_instruction_list && - amazon_prep_fees_details_list == o.amazon_prep_fees_details_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, asin, barcode_instruction, prep_guidance, prep_instruction_list, amazon_prep_fees_details_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions_list.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions_list.rb deleted file mode 100644 index 7ac51c5..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/models/sku_prep_instructions_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentInboundV0 - # A list of SKU labeling requirements and item preparation instructions. - class SKUPrepInstructionsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentInboundV0::SKUPrepInstructionsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentInboundV0::SKUPrepInstructionsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentInboundV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/version.rb b/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/version.rb deleted file mode 100644 index 03c6c8b..0000000 --- a/vendor/fulfillment_inbound_v0/lib/sp_fulfillment_inbound_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpFulfillmentInboundV0 - VERSION = '1.0.0' -end diff --git a/vendor/fulfillment_inbound_v0/sp_fulfillment_inbound_v0.gemspec b/vendor/fulfillment_inbound_v0/sp_fulfillment_inbound_v0.gemspec deleted file mode 100644 index 196eee3..0000000 --- a/vendor/fulfillment_inbound_v0/sp_fulfillment_inbound_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Fulfillment Inbound - -#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_fulfillment_inbound_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_fulfillment_inbound_v0" - s.version = SpFulfillmentInboundV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Fulfillment Inbound Ruby Gem" - s.description = "The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/merchant_fulfillment_v0/.gitignore b/vendor/merchant_fulfillment_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/merchant_fulfillment_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/merchant_fulfillment_v0/.rspec b/vendor/merchant_fulfillment_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/merchant_fulfillment_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/merchant_fulfillment_v0/.rubocop.yml b/vendor/merchant_fulfillment_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/merchant_fulfillment_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/merchant_fulfillment_v0/.swagger-codegen-ignore b/vendor/merchant_fulfillment_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/merchant_fulfillment_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/merchant_fulfillment_v0/.swagger-codegen/VERSION b/vendor/merchant_fulfillment_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/merchant_fulfillment_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/merchant_fulfillment_v0/Gemfile b/vendor/merchant_fulfillment_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/merchant_fulfillment_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/merchant_fulfillment_v0/README.md b/vendor/merchant_fulfillment_v0/README.md deleted file mode 100644 index 190dc63..0000000 --- a/vendor/merchant_fulfillment_v0/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# sp_merchant_fulfillment_v0 - -SpMerchantFulfillmentV0 - the Ruby gem for the Selling Partner API for Merchant Fulfillment - -With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_merchant_fulfillment_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_merchant_fulfillment_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_merchant_fulfillment_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_merchant_fulfillment_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_merchant_fulfillment_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_merchant_fulfillment_v0' - -api_instance = SpMerchantFulfillmentV0::MerchantFulfillmentApi.new -shipment_id = 'shipment_id_example' # String | The Amazon-defined shipment identifier for the shipment to cancel. - - -begin - result = api_instance.cancel_shipment(shipment_id) - p result -rescue SpMerchantFulfillmentV0::ApiError => e - puts "Exception when calling MerchantFulfillmentApi->cancel_shipment: #{e}" -end - -api_instance = SpMerchantFulfillmentV0::MerchantFulfillmentApi.new -body = SpMerchantFulfillmentV0::CreateShipmentRequest.new # CreateShipmentRequest | The request schema for the `CreateShipment` operation. - - -begin - result = api_instance.create_shipment(body) - p result -rescue SpMerchantFulfillmentV0::ApiError => e - puts "Exception when calling MerchantFulfillmentApi->create_shipment: #{e}" -end - -api_instance = SpMerchantFulfillmentV0::MerchantFulfillmentApi.new -body = SpMerchantFulfillmentV0::GetAdditionalSellerInputsRequest.new # GetAdditionalSellerInputsRequest | The request schema for the `GetAdditionalSellerInputs` operation. - - -begin - result = api_instance.get_additional_seller_inputs(body) - p result -rescue SpMerchantFulfillmentV0::ApiError => e - puts "Exception when calling MerchantFulfillmentApi->get_additional_seller_inputs: #{e}" -end - -api_instance = SpMerchantFulfillmentV0::MerchantFulfillmentApi.new -body = SpMerchantFulfillmentV0::GetEligibleShipmentServicesRequest.new # GetEligibleShipmentServicesRequest | The request schema for the `GetEligibleShipmentServices` operation. - - -begin - result = api_instance.get_eligible_shipment_services(body) - p result -rescue SpMerchantFulfillmentV0::ApiError => e - puts "Exception when calling MerchantFulfillmentApi->get_eligible_shipment_services: #{e}" -end - -api_instance = SpMerchantFulfillmentV0::MerchantFulfillmentApi.new -shipment_id = 'shipment_id_example' # String | The Amazon-defined shipment identifier for the shipment. - - -begin - result = api_instance.get_shipment(shipment_id) - p result -rescue SpMerchantFulfillmentV0::ApiError => e - puts "Exception when calling MerchantFulfillmentApi->get_shipment: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpMerchantFulfillmentV0::MerchantFulfillmentApi* | [**cancel_shipment**](docs/MerchantFulfillmentApi.md#cancel_shipment) | **DELETE** /mfn/v0/shipments/{shipmentId} | -*SpMerchantFulfillmentV0::MerchantFulfillmentApi* | [**create_shipment**](docs/MerchantFulfillmentApi.md#create_shipment) | **POST** /mfn/v0/shipments | -*SpMerchantFulfillmentV0::MerchantFulfillmentApi* | [**get_additional_seller_inputs**](docs/MerchantFulfillmentApi.md#get_additional_seller_inputs) | **POST** /mfn/v0/additionalSellerInputs | -*SpMerchantFulfillmentV0::MerchantFulfillmentApi* | [**get_eligible_shipment_services**](docs/MerchantFulfillmentApi.md#get_eligible_shipment_services) | **POST** /mfn/v0/eligibleShippingServices | -*SpMerchantFulfillmentV0::MerchantFulfillmentApi* | [**get_shipment**](docs/MerchantFulfillmentApi.md#get_shipment) | **GET** /mfn/v0/shipments/{shipmentId} | - -## Documentation for Models - - - [SpMerchantFulfillmentV0::AdditionalInputs](docs/AdditionalInputs.md) - - [SpMerchantFulfillmentV0::AdditionalInputsList](docs/AdditionalInputsList.md) - - [SpMerchantFulfillmentV0::AdditionalSellerInput](docs/AdditionalSellerInput.md) - - [SpMerchantFulfillmentV0::AdditionalSellerInputs](docs/AdditionalSellerInputs.md) - - [SpMerchantFulfillmentV0::AdditionalSellerInputsList](docs/AdditionalSellerInputsList.md) - - [SpMerchantFulfillmentV0::Address](docs/Address.md) - - [SpMerchantFulfillmentV0::AddressLine1](docs/AddressLine1.md) - - [SpMerchantFulfillmentV0::AddressLine2](docs/AddressLine2.md) - - [SpMerchantFulfillmentV0::AddressLine3](docs/AddressLine3.md) - - [SpMerchantFulfillmentV0::AddressName](docs/AddressName.md) - - [SpMerchantFulfillmentV0::AmazonOrderId](docs/AmazonOrderId.md) - - [SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOption](docs/AvailableCarrierWillPickUpOption.md) - - [SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOptionsList](docs/AvailableCarrierWillPickUpOptionsList.md) - - [SpMerchantFulfillmentV0::AvailableDeliveryExperienceOption](docs/AvailableDeliveryExperienceOption.md) - - [SpMerchantFulfillmentV0::AvailableDeliveryExperienceOptionsList](docs/AvailableDeliveryExperienceOptionsList.md) - - [SpMerchantFulfillmentV0::AvailableFormatOptionsForLabel](docs/AvailableFormatOptionsForLabel.md) - - [SpMerchantFulfillmentV0::AvailableFormatOptionsForLabelList](docs/AvailableFormatOptionsForLabelList.md) - - [SpMerchantFulfillmentV0::AvailableShippingServiceOptions](docs/AvailableShippingServiceOptions.md) - - [SpMerchantFulfillmentV0::Benefits](docs/Benefits.md) - - [SpMerchantFulfillmentV0::CancelShipmentResponse](docs/CancelShipmentResponse.md) - - [SpMerchantFulfillmentV0::CarrierWillPickUpOption](docs/CarrierWillPickUpOption.md) - - [SpMerchantFulfillmentV0::City](docs/City.md) - - [SpMerchantFulfillmentV0::Constraint](docs/Constraint.md) - - [SpMerchantFulfillmentV0::Constraints](docs/Constraints.md) - - [SpMerchantFulfillmentV0::CountryCode](docs/CountryCode.md) - - [SpMerchantFulfillmentV0::CreateShipmentRequest](docs/CreateShipmentRequest.md) - - [SpMerchantFulfillmentV0::CreateShipmentResponse](docs/CreateShipmentResponse.md) - - [SpMerchantFulfillmentV0::CurrencyAmount](docs/CurrencyAmount.md) - - [SpMerchantFulfillmentV0::CustomTextForLabel](docs/CustomTextForLabel.md) - - [SpMerchantFulfillmentV0::DangerousGoodsDetails](docs/DangerousGoodsDetails.md) - - [SpMerchantFulfillmentV0::DeliveryExperienceOption](docs/DeliveryExperienceOption.md) - - [SpMerchantFulfillmentV0::DeliveryExperienceType](docs/DeliveryExperienceType.md) - - [SpMerchantFulfillmentV0::DistrictOrCounty](docs/DistrictOrCounty.md) - - [SpMerchantFulfillmentV0::EmailAddress](docs/EmailAddress.md) - - [SpMerchantFulfillmentV0::Error](docs/Error.md) - - [SpMerchantFulfillmentV0::ErrorList](docs/ErrorList.md) - - [SpMerchantFulfillmentV0::ExcludedBenefit](docs/ExcludedBenefit.md) - - [SpMerchantFulfillmentV0::ExcludedBenefitReasonCodes](docs/ExcludedBenefitReasonCodes.md) - - [SpMerchantFulfillmentV0::ExcludedBenefits](docs/ExcludedBenefits.md) - - [SpMerchantFulfillmentV0::FileContents](docs/FileContents.md) - - [SpMerchantFulfillmentV0::FileType](docs/FileType.md) - - [SpMerchantFulfillmentV0::GetAdditionalSellerInputsRequest](docs/GetAdditionalSellerInputsRequest.md) - - [SpMerchantFulfillmentV0::GetAdditionalSellerInputsResponse](docs/GetAdditionalSellerInputsResponse.md) - - [SpMerchantFulfillmentV0::GetAdditionalSellerInputsResult](docs/GetAdditionalSellerInputsResult.md) - - [SpMerchantFulfillmentV0::GetEligibleShipmentServicesRequest](docs/GetEligibleShipmentServicesRequest.md) - - [SpMerchantFulfillmentV0::GetEligibleShipmentServicesResponse](docs/GetEligibleShipmentServicesResponse.md) - - [SpMerchantFulfillmentV0::GetEligibleShipmentServicesResult](docs/GetEligibleShipmentServicesResult.md) - - [SpMerchantFulfillmentV0::GetShipmentResponse](docs/GetShipmentResponse.md) - - [SpMerchantFulfillmentV0::HazmatType](docs/HazmatType.md) - - [SpMerchantFulfillmentV0::IncludedBenefits](docs/IncludedBenefits.md) - - [SpMerchantFulfillmentV0::InputTargetType](docs/InputTargetType.md) - - [SpMerchantFulfillmentV0::Item](docs/Item.md) - - [SpMerchantFulfillmentV0::ItemDescription](docs/ItemDescription.md) - - [SpMerchantFulfillmentV0::ItemLevelFields](docs/ItemLevelFields.md) - - [SpMerchantFulfillmentV0::ItemLevelFieldsList](docs/ItemLevelFieldsList.md) - - [SpMerchantFulfillmentV0::ItemList](docs/ItemList.md) - - [SpMerchantFulfillmentV0::ItemQuantity](docs/ItemQuantity.md) - - [SpMerchantFulfillmentV0::Label](docs/Label.md) - - [SpMerchantFulfillmentV0::LabelCustomization](docs/LabelCustomization.md) - - [SpMerchantFulfillmentV0::LabelDimension](docs/LabelDimension.md) - - [SpMerchantFulfillmentV0::LabelDimensions](docs/LabelDimensions.md) - - [SpMerchantFulfillmentV0::LabelFormat](docs/LabelFormat.md) - - [SpMerchantFulfillmentV0::LabelFormatList](docs/LabelFormatList.md) - - [SpMerchantFulfillmentV0::LabelFormatOption](docs/LabelFormatOption.md) - - [SpMerchantFulfillmentV0::LabelFormatOptionRequest](docs/LabelFormatOptionRequest.md) - - [SpMerchantFulfillmentV0::Length](docs/Length.md) - - [SpMerchantFulfillmentV0::LiquidVolume](docs/LiquidVolume.md) - - [SpMerchantFulfillmentV0::OrderItemId](docs/OrderItemId.md) - - [SpMerchantFulfillmentV0::PackageDimension](docs/PackageDimension.md) - - [SpMerchantFulfillmentV0::PackageDimensions](docs/PackageDimensions.md) - - [SpMerchantFulfillmentV0::PhoneNumber](docs/PhoneNumber.md) - - [SpMerchantFulfillmentV0::PostalCode](docs/PostalCode.md) - - [SpMerchantFulfillmentV0::PredefinedPackageDimensions](docs/PredefinedPackageDimensions.md) - - [SpMerchantFulfillmentV0::RejectedShippingService](docs/RejectedShippingService.md) - - [SpMerchantFulfillmentV0::RejectedShippingServiceList](docs/RejectedShippingServiceList.md) - - [SpMerchantFulfillmentV0::RestrictedSetValues](docs/RestrictedSetValues.md) - - [SpMerchantFulfillmentV0::SellerInputDefinition](docs/SellerInputDefinition.md) - - [SpMerchantFulfillmentV0::SellerOrderId](docs/SellerOrderId.md) - - [SpMerchantFulfillmentV0::Shipment](docs/Shipment.md) - - [SpMerchantFulfillmentV0::ShipmentId](docs/ShipmentId.md) - - [SpMerchantFulfillmentV0::ShipmentRequestDetails](docs/ShipmentRequestDetails.md) - - [SpMerchantFulfillmentV0::ShipmentStatus](docs/ShipmentStatus.md) - - [SpMerchantFulfillmentV0::ShippingOfferingFilter](docs/ShippingOfferingFilter.md) - - [SpMerchantFulfillmentV0::ShippingService](docs/ShippingService.md) - - [SpMerchantFulfillmentV0::ShippingServiceIdentifier](docs/ShippingServiceIdentifier.md) - - [SpMerchantFulfillmentV0::ShippingServiceList](docs/ShippingServiceList.md) - - [SpMerchantFulfillmentV0::ShippingServiceOptions](docs/ShippingServiceOptions.md) - - [SpMerchantFulfillmentV0::StandardIdForLabel](docs/StandardIdForLabel.md) - - [SpMerchantFulfillmentV0::StateOrProvinceCode](docs/StateOrProvinceCode.md) - - [SpMerchantFulfillmentV0::TemporarilyUnavailableCarrier](docs/TemporarilyUnavailableCarrier.md) - - [SpMerchantFulfillmentV0::TemporarilyUnavailableCarrierList](docs/TemporarilyUnavailableCarrierList.md) - - [SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrier](docs/TermsAndConditionsNotAcceptedCarrier.md) - - [SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrierList](docs/TermsAndConditionsNotAcceptedCarrierList.md) - - [SpMerchantFulfillmentV0::Timestamp](docs/Timestamp.md) - - [SpMerchantFulfillmentV0::TrackingId](docs/TrackingId.md) - - [SpMerchantFulfillmentV0::TransparencyCode](docs/TransparencyCode.md) - - [SpMerchantFulfillmentV0::TransparencyCodeList](docs/TransparencyCodeList.md) - - [SpMerchantFulfillmentV0::UnitOfLength](docs/UnitOfLength.md) - - [SpMerchantFulfillmentV0::UnitOfWeight](docs/UnitOfWeight.md) - - [SpMerchantFulfillmentV0::Weight](docs/Weight.md) - - [SpMerchantFulfillmentV0::WeightValue](docs/WeightValue.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/merchant_fulfillment_v0/Rakefile b/vendor/merchant_fulfillment_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/merchant_fulfillment_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/merchant_fulfillment_v0/git_push.sh b/vendor/merchant_fulfillment_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/merchant_fulfillment_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0.rb deleted file mode 100644 index 04a731e..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0.rb +++ /dev/null @@ -1,325 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_merchant_fulfillment_v0/api_client' -# require 'sp_merchant_fulfillment_v0/api_error' -# require 'sp_merchant_fulfillment_v0/version' -# require 'sp_merchant_fulfillment_v0/configuration' - -# Models -# -# -# require_relative './sp_merchant_fulfillment_v0/models/additional_inputs' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/additional_inputs_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/additional_seller_input' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/additional_seller_inputs' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/additional_seller_inputs_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/address' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/address_line1' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/address_line2' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/address_line3' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/address_name' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/amazon_order_id' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_option' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_options_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_delivery_experience_option' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_delivery_experience_options_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_format_options_for_label' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_format_options_for_label_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/available_shipping_service_options' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/benefits' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/cancel_shipment_response' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/carrier_will_pick_up_option' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/city' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/constraint' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/constraints' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/country_code' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/create_shipment_request' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/create_shipment_response' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/currency_amount' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/custom_text_for_label' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/dangerous_goods_details' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/delivery_experience_option' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/delivery_experience_type' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/district_or_county' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/email_address' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/error' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/error_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/excluded_benefit' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/excluded_benefit_reason_codes' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/excluded_benefits' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/file_contents' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/file_type' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_request' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_response' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_result' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_request' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_response' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_result' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/get_shipment_response' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/hazmat_type' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/included_benefits' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/input_target_type' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item_description' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item_level_fields' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item_level_fields_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/item_quantity' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_customization' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_dimension' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_dimensions' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_format' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_format_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_format_option' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/label_format_option_request' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/length' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/liquid_volume' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/order_item_id' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/package_dimension' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/package_dimensions' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/phone_number' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/postal_code' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/predefined_package_dimensions' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/rejected_shipping_service' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/rejected_shipping_service_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/restricted_set_values' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/seller_input_definition' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/seller_order_id' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipment' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipment_id' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipment_request_details' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipment_status' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipping_offering_filter' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipping_service' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipping_service_identifier' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipping_service_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/shipping_service_options' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/standard_id_for_label' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/state_or_province_code' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/timestamp' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/tracking_id' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/transparency_code' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/transparency_code_list' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/unit_of_length' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/unit_of_weight' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/weight' -# -# -# require_relative './sp_merchant_fulfillment_v0/models/weight_value' -# - -# APIs -require_relative './sp_merchant_fulfillment_v0/api/merchant_fulfillment_api' diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api/merchant_fulfillment_api.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api/merchant_fulfillment_api.rb deleted file mode 100644 index aec7f24..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api/merchant_fulfillment_api.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class MerchantFulfillmentApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id The Amazon-defined shipment identifier for the shipment to cancel. - # @param [Hash] opts the optional parameters - # @return [CancelShipmentResponse] - def cancel_shipment(shipment_id, opts = {}) - data = cancel_shipment_with_http_info(shipment_id, opts) - return data - end - - # Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id The Amazon-defined shipment identifier for the shipment to cancel. - # @param [Hash] opts the optional parameters - # @return [Array<(CancelShipmentResponse)>] CancelShipmentResponse data, response status code and response headers - def cancel_shipment_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MerchantFulfillmentApi.cancel_shipment ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling MerchantFulfillmentApi.cancel_shipment" - end - # resource path - local_var_path = '/mfn/v0/shipments/{shipmentId}'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MerchantFulfillmentApi#cancel_shipment\nData: #{data.inspect}" - end - return data - end - # Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `CreateShipment` operation. - # @param [Hash] opts the optional parameters - # @return [CreateShipmentResponse] - def create_shipment(body, opts = {}) - data = create_shipment_with_http_info(body, opts) - return data - end - - # Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `CreateShipment` operation. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateShipmentResponse)>] CreateShipmentResponse data, response status code and response headers - def create_shipment_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MerchantFulfillmentApi.create_shipment ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MerchantFulfillmentApi.create_shipment" - end - # resource path - local_var_path = '/mfn/v0/shipments' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MerchantFulfillmentApi#create_shipment\nData: #{data.inspect}" - end - return data - end - # Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `GetAdditionalSellerInputs` operation. - # @param [Hash] opts the optional parameters - # @return [GetAdditionalSellerInputsResponse] - def get_additional_seller_inputs(body, opts = {}) - data = get_additional_seller_inputs_with_http_info(body, opts) - return data - end - - # Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `GetAdditionalSellerInputs` operation. - # @param [Hash] opts the optional parameters - # @return [Array<(GetAdditionalSellerInputsResponse)>] GetAdditionalSellerInputsResponse data, response status code and response headers - def get_additional_seller_inputs_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MerchantFulfillmentApi.get_additional_seller_inputs ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MerchantFulfillmentApi.get_additional_seller_inputs" - end - # resource path - local_var_path = '/mfn/v0/additionalSellerInputs' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MerchantFulfillmentApi#get_additional_seller_inputs\nData: #{data.inspect}" - end - return data - end - # Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `GetEligibleShipmentServices` operation. - # @param [Hash] opts the optional parameters - # @return [GetEligibleShipmentServicesResponse] - def get_eligible_shipment_services(body, opts = {}) - data = get_eligible_shipment_services_with_http_info(body, opts) - return data - end - - # Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request schema for the `GetEligibleShipmentServices` operation. - # @param [Hash] opts the optional parameters - # @return [Array<(GetEligibleShipmentServicesResponse)>] GetEligibleShipmentServicesResponse data, response status code and response headers - def get_eligible_shipment_services_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MerchantFulfillmentApi.get_eligible_shipment_services ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MerchantFulfillmentApi.get_eligible_shipment_services" - end - # resource path - local_var_path = '/mfn/v0/eligibleShippingServices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MerchantFulfillmentApi#get_eligible_shipment_services\nData: #{data.inspect}" - end - return data - end - # Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id The Amazon-defined shipment identifier for the shipment. - # @param [Hash] opts the optional parameters - # @return [GetShipmentResponse] - def get_shipment(shipment_id, opts = {}) - data = get_shipment_with_http_info(shipment_id, opts) - return data - end - - # Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param shipment_id The Amazon-defined shipment identifier for the shipment. - # @param [Hash] opts the optional parameters - # @return [Array<(GetShipmentResponse)>] GetShipmentResponse data, response status code and response headers - def get_shipment_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MerchantFulfillmentApi.get_shipment ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling MerchantFulfillmentApi.get_shipment" - end - # resource path - local_var_path = '/mfn/v0/shipments/{shipmentId}'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MerchantFulfillmentApi#get_shipment\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_client.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_client.rb deleted file mode 100644 index d6a7075..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpMerchantFulfillmentV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_error.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_error.rb deleted file mode 100644 index b3bdd89..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/configuration.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/configuration.rb deleted file mode 100644 index 572c951..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs.rb deleted file mode 100644 index cd8eae6..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Maps the additional seller input to the definition. The key to the map is the field name. - class AdditionalInputs - # The field name. - attr_accessor :additional_input_field_name - - attr_accessor :seller_input_definition - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_input_field_name' => :'AdditionalInputFieldName', - :'seller_input_definition' => :'SellerInputDefinition' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_input_field_name' => :'Object', - :'seller_input_definition' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalInputs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalInputs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_input_field_name') - self.additional_input_field_name = attributes[:'additional_input_field_name'] - end - - if attributes.key?(:'seller_input_definition') - self.seller_input_definition = attributes[:'seller_input_definition'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_input_field_name == o.additional_input_field_name && - seller_input_definition == o.seller_input_definition - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_input_field_name, seller_input_definition].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs_list.rb deleted file mode 100644 index ef5f285..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_inputs_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of additional inputs. - class AdditionalInputsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalInputsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalInputsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_input.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_input.rb deleted file mode 100644 index a97f8d0..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_input.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Additional information required to purchase shipping. - class AdditionalSellerInput - # The data type of the additional information. - attr_accessor :data_type - - # The value when the data type is string. - attr_accessor :value_as_string - - # The value when the data type is boolean. - attr_accessor :value_as_boolean - - # The value when the data type is integer. - attr_accessor :value_as_integer - - attr_accessor :value_as_timestamp - - attr_accessor :value_as_address - - attr_accessor :value_as_weight - - attr_accessor :value_as_dimension - - attr_accessor :value_as_currency - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'data_type' => :'DataType', - :'value_as_string' => :'ValueAsString', - :'value_as_boolean' => :'ValueAsBoolean', - :'value_as_integer' => :'ValueAsInteger', - :'value_as_timestamp' => :'ValueAsTimestamp', - :'value_as_address' => :'ValueAsAddress', - :'value_as_weight' => :'ValueAsWeight', - :'value_as_dimension' => :'ValueAsDimension', - :'value_as_currency' => :'ValueAsCurrency' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'data_type' => :'Object', - :'value_as_string' => :'Object', - :'value_as_boolean' => :'Object', - :'value_as_integer' => :'Object', - :'value_as_timestamp' => :'Object', - :'value_as_address' => :'Object', - :'value_as_weight' => :'Object', - :'value_as_dimension' => :'Object', - :'value_as_currency' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInput` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'data_type') - self.data_type = attributes[:'data_type'] - end - - if attributes.key?(:'value_as_string') - self.value_as_string = attributes[:'value_as_string'] - end - - if attributes.key?(:'value_as_boolean') - self.value_as_boolean = attributes[:'value_as_boolean'] - end - - if attributes.key?(:'value_as_integer') - self.value_as_integer = attributes[:'value_as_integer'] - end - - if attributes.key?(:'value_as_timestamp') - self.value_as_timestamp = attributes[:'value_as_timestamp'] - end - - if attributes.key?(:'value_as_address') - self.value_as_address = attributes[:'value_as_address'] - end - - if attributes.key?(:'value_as_weight') - self.value_as_weight = attributes[:'value_as_weight'] - end - - if attributes.key?(:'value_as_dimension') - self.value_as_dimension = attributes[:'value_as_dimension'] - end - - if attributes.key?(:'value_as_currency') - self.value_as_currency = attributes[:'value_as_currency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data_type == o.data_type && - value_as_string == o.value_as_string && - value_as_boolean == o.value_as_boolean && - value_as_integer == o.value_as_integer && - value_as_timestamp == o.value_as_timestamp && - value_as_address == o.value_as_address && - value_as_weight == o.value_as_weight && - value_as_dimension == o.value_as_dimension && - value_as_currency == o.value_as_currency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [data_type, value_as_string, value_as_boolean, value_as_integer, value_as_timestamp, value_as_address, value_as_weight, value_as_dimension, value_as_currency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs.rb deleted file mode 100644 index a929d15..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An additional set of seller inputs required to purchase shipping. - class AdditionalSellerInputs - # The name of the additional input field. - attr_accessor :additional_input_field_name - - attr_accessor :additional_seller_input - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_input_field_name' => :'AdditionalInputFieldName', - :'additional_seller_input' => :'AdditionalSellerInput' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_input_field_name' => :'Object', - :'additional_seller_input' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInputs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInputs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_input_field_name') - self.additional_input_field_name = attributes[:'additional_input_field_name'] - end - - if attributes.key?(:'additional_seller_input') - self.additional_seller_input = attributes[:'additional_seller_input'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @additional_input_field_name.nil? - invalid_properties.push('invalid value for "additional_input_field_name", additional_input_field_name cannot be nil.') - end - - if @additional_seller_input.nil? - invalid_properties.push('invalid value for "additional_seller_input", additional_seller_input cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @additional_input_field_name.nil? - return false if @additional_seller_input.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_input_field_name == o.additional_input_field_name && - additional_seller_input == o.additional_seller_input - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_input_field_name, additional_seller_input].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs_list.rb deleted file mode 100644 index 2e66d85..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/additional_seller_inputs_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of additional seller input pairs required to purchase shipping. - class AdditionalSellerInputsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInputsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AdditionalSellerInputsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address.rb deleted file mode 100644 index 9b3f5d8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address.rb +++ /dev/null @@ -1,336 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The postal address information. - class Address - attr_accessor :name - - attr_accessor :address_line1 - - attr_accessor :address_line2 - - attr_accessor :address_line3 - - attr_accessor :district_or_county - - attr_accessor :email - - attr_accessor :city - - attr_accessor :state_or_province_code - - attr_accessor :postal_code - - attr_accessor :country_code - - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'address_line1' => :'AddressLine1', - :'address_line2' => :'AddressLine2', - :'address_line3' => :'AddressLine3', - :'district_or_county' => :'DistrictOrCounty', - :'email' => :'Email', - :'city' => :'City', - :'state_or_province_code' => :'StateOrProvinceCode', - :'postal_code' => :'PostalCode', - :'country_code' => :'CountryCode', - :'phone' => :'Phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'district_or_county' => :'Object', - :'email' => :'Object', - :'city' => :'Object', - :'state_or_province_code' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'district_or_county') - self.district_or_county = attributes[:'district_or_county'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'state_or_province_code') - self.state_or_province_code = attributes[:'state_or_province_code'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - if @phone.nil? - invalid_properties.push('invalid value for "phone", phone cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @email.nil? - return false if @city.nil? - return false if @postal_code.nil? - return false if @country_code.nil? - return false if @phone.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - district_or_county == o.district_or_county && - email == o.email && - city == o.city && - state_or_province_code == o.state_or_province_code && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, district_or_county, email, city, state_or_province_code, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line1.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line1.rb deleted file mode 100644 index f5dcfc4..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line1.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The street address information. - class AddressLine1 - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine1` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line2.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line2.rb deleted file mode 100644 index fc8a360..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line2.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Additional street address information. - class AddressLine2 - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line3.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line3.rb deleted file mode 100644 index bb6df00..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_line3.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Additional street address information. - class AddressLine3 - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine3` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AddressLine3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_name.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_name.rb deleted file mode 100644 index 7408ee4..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/address_name.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The name of the addressee, or business name. - class AddressName - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AddressName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AddressName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/amazon_order_id.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/amazon_order_id.rb deleted file mode 100644 index c6f2046..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/amazon_order_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An Amazon-defined order identifier, in 3-7-7 format. - class AmazonOrderId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AmazonOrderId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AmazonOrderId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_option.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_option.rb deleted file mode 100644 index 3d006fa..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_option.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Indicates whether the carrier will pick up the package, and what fee is charged, if any. - class AvailableCarrierWillPickUpOption - attr_accessor :carrier_will_pick_up_option - - attr_accessor :charge - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carrier_will_pick_up_option' => :'CarrierWillPickUpOption', - :'charge' => :'Charge' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carrier_will_pick_up_option' => :'Object', - :'charge' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carrier_will_pick_up_option') - self.carrier_will_pick_up_option = attributes[:'carrier_will_pick_up_option'] - end - - if attributes.key?(:'charge') - self.charge = attributes[:'charge'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carrier_will_pick_up_option.nil? - invalid_properties.push('invalid value for "carrier_will_pick_up_option", carrier_will_pick_up_option cannot be nil.') - end - - if @charge.nil? - invalid_properties.push('invalid value for "charge", charge cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carrier_will_pick_up_option.nil? - return false if @charge.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carrier_will_pick_up_option == o.carrier_will_pick_up_option && - charge == o.charge - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carrier_will_pick_up_option, charge].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_options_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_options_list.rb deleted file mode 100644 index 7a2ff6f..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_carrier_will_pick_up_options_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of available carrier pickup options. - class AvailableCarrierWillPickUpOptionsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOptionsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableCarrierWillPickUpOptionsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_option.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_option.rb deleted file mode 100644 index f47e3ff..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_option.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The available delivery confirmation options, and the fee charged, if any. - class AvailableDeliveryExperienceOption - attr_accessor :delivery_experience_option - - attr_accessor :charge - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_experience_option' => :'DeliveryExperienceOption', - :'charge' => :'Charge' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_experience_option' => :'Object', - :'charge' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableDeliveryExperienceOption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableDeliveryExperienceOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_experience_option') - self.delivery_experience_option = attributes[:'delivery_experience_option'] - end - - if attributes.key?(:'charge') - self.charge = attributes[:'charge'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @delivery_experience_option.nil? - invalid_properties.push('invalid value for "delivery_experience_option", delivery_experience_option cannot be nil.') - end - - if @charge.nil? - invalid_properties.push('invalid value for "charge", charge cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @delivery_experience_option.nil? - return false if @charge.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_experience_option == o.delivery_experience_option && - charge == o.charge - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_experience_option, charge].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_options_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_options_list.rb deleted file mode 100644 index 046288b..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_delivery_experience_options_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of available delivery experience options. - class AvailableDeliveryExperienceOptionsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableDeliveryExperienceOptionsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableDeliveryExperienceOptionsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label.rb deleted file mode 100644 index e611057..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The available label formats. - class AvailableFormatOptionsForLabel - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableFormatOptionsForLabel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableFormatOptionsForLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label_list.rb deleted file mode 100644 index cbb0801..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_format_options_for_label_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The available label formats. - class AvailableFormatOptionsForLabelList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableFormatOptionsForLabelList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableFormatOptionsForLabelList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_shipping_service_options.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_shipping_service_options.rb deleted file mode 100644 index 4696eb9..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/available_shipping_service_options.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The available shipping service options. - class AvailableShippingServiceOptions - attr_accessor :available_carrier_will_pick_up_options - - attr_accessor :available_delivery_experience_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available_carrier_will_pick_up_options' => :'AvailableCarrierWillPickUpOptions', - :'available_delivery_experience_options' => :'AvailableDeliveryExperienceOptions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'available_carrier_will_pick_up_options' => :'Object', - :'available_delivery_experience_options' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableShippingServiceOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::AvailableShippingServiceOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available_carrier_will_pick_up_options') - self.available_carrier_will_pick_up_options = attributes[:'available_carrier_will_pick_up_options'] - end - - if attributes.key?(:'available_delivery_experience_options') - self.available_delivery_experience_options = attributes[:'available_delivery_experience_options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @available_carrier_will_pick_up_options.nil? - invalid_properties.push('invalid value for "available_carrier_will_pick_up_options", available_carrier_will_pick_up_options cannot be nil.') - end - - if @available_delivery_experience_options.nil? - invalid_properties.push('invalid value for "available_delivery_experience_options", available_delivery_experience_options cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @available_carrier_will_pick_up_options.nil? - return false if @available_delivery_experience_options.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available_carrier_will_pick_up_options == o.available_carrier_will_pick_up_options && - available_delivery_experience_options == o.available_delivery_experience_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available_carrier_will_pick_up_options, available_delivery_experience_options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/benefits.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/benefits.rb deleted file mode 100644 index c99600d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/benefits.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Benefits that are included and excluded for each shipping offer. Benefits represents services provided by Amazon (for example, `CLAIMS_PROTECTED`) when sellers purchase shipping through Amazon. Benefit details are made available for any shipment placed on or after January 1st 2024 00:00 UTC. - class Benefits - attr_accessor :included_benefits - - attr_accessor :excluded_benefits - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'included_benefits' => :'IncludedBenefits', - :'excluded_benefits' => :'ExcludedBenefits' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'included_benefits' => :'Object', - :'excluded_benefits' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Benefits` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Benefits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'included_benefits') - self.included_benefits = attributes[:'included_benefits'] - end - - if attributes.key?(:'excluded_benefits') - self.excluded_benefits = attributes[:'excluded_benefits'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - included_benefits == o.included_benefits && - excluded_benefits == o.excluded_benefits - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [included_benefits, excluded_benefits].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/cancel_shipment_response.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/cancel_shipment_response.rb deleted file mode 100644 index eabc095..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/cancel_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Response schema. - class CancelShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CancelShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CancelShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/carrier_will_pick_up_option.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/carrier_will_pick_up_option.rb deleted file mode 100644 index 6a23744..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/carrier_will_pick_up_option.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class CarrierWillPickUpOption - CARRIER_WILL_PICK_UP = 'CarrierWillPickUp'.freeze - SHIPPER_WILL_DROP_OFF = 'ShipperWillDropOff'.freeze - NO_PREFERENCE = 'NoPreference'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CarrierWillPickUpOption.constants.select { |c| CarrierWillPickUpOption::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CarrierWillPickUpOption" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/city.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/city.rb deleted file mode 100644 index 7668e57..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/city.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The city. - class City - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::City` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::City`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraint.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraint.rb deleted file mode 100644 index d6612a8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraint.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A validation constraint. - class Constraint - # A regular expression. - attr_accessor :validation_reg_ex - - # A validation string. - attr_accessor :validation_string - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'validation_reg_ex' => :'ValidationRegEx', - :'validation_string' => :'ValidationString' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'validation_reg_ex' => :'Object', - :'validation_string' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Constraint` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Constraint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'validation_reg_ex') - self.validation_reg_ex = attributes[:'validation_reg_ex'] - end - - if attributes.key?(:'validation_string') - self.validation_string = attributes[:'validation_string'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @validation_string.nil? - invalid_properties.push('invalid value for "validation_string", validation_string cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @validation_string.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - validation_reg_ex == o.validation_reg_ex && - validation_string == o.validation_string - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [validation_reg_ex, validation_string].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraints.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraints.rb deleted file mode 100644 index e3e17d0..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/constraints.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of constraints. - class Constraints - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Constraints` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Constraints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/country_code.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/country_code.rb deleted file mode 100644 index c867586..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/country_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The two-letter country code in [ISO 3166-1 alpha-2](https://www.iban.com/country-codes) format. - class CountryCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CountryCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CountryCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_request.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_request.rb deleted file mode 100644 index 9f94c28..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Request schema. - class CreateShipmentRequest - attr_accessor :shipment_request_details - - attr_accessor :shipping_service_id - - # Identifies a shipping service order made by a carrier. - attr_accessor :shipping_service_offer_id - - attr_accessor :hazmat_type - - attr_accessor :label_format_option - - attr_accessor :shipment_level_seller_inputs_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_request_details' => :'ShipmentRequestDetails', - :'shipping_service_id' => :'ShippingServiceId', - :'shipping_service_offer_id' => :'ShippingServiceOfferId', - :'hazmat_type' => :'HazmatType', - :'label_format_option' => :'LabelFormatOption', - :'shipment_level_seller_inputs_list' => :'ShipmentLevelSellerInputsList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_request_details' => :'Object', - :'shipping_service_id' => :'Object', - :'shipping_service_offer_id' => :'Object', - :'hazmat_type' => :'Object', - :'label_format_option' => :'Object', - :'shipment_level_seller_inputs_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CreateShipmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CreateShipmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_request_details') - self.shipment_request_details = attributes[:'shipment_request_details'] - end - - if attributes.key?(:'shipping_service_id') - self.shipping_service_id = attributes[:'shipping_service_id'] - end - - if attributes.key?(:'shipping_service_offer_id') - self.shipping_service_offer_id = attributes[:'shipping_service_offer_id'] - end - - if attributes.key?(:'hazmat_type') - self.hazmat_type = attributes[:'hazmat_type'] - end - - if attributes.key?(:'label_format_option') - self.label_format_option = attributes[:'label_format_option'] - end - - if attributes.key?(:'shipment_level_seller_inputs_list') - self.shipment_level_seller_inputs_list = attributes[:'shipment_level_seller_inputs_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_request_details.nil? - invalid_properties.push('invalid value for "shipment_request_details", shipment_request_details cannot be nil.') - end - - if @shipping_service_id.nil? - invalid_properties.push('invalid value for "shipping_service_id", shipping_service_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_request_details.nil? - return false if @shipping_service_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_request_details == o.shipment_request_details && - shipping_service_id == o.shipping_service_id && - shipping_service_offer_id == o.shipping_service_offer_id && - hazmat_type == o.hazmat_type && - label_format_option == o.label_format_option && - shipment_level_seller_inputs_list == o.shipment_level_seller_inputs_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_request_details, shipping_service_id, shipping_service_offer_id, hazmat_type, label_format_option, shipment_level_seller_inputs_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_response.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_response.rb deleted file mode 100644 index f22fe59..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/create_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Response schema. - class CreateShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CreateShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CreateShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/currency_amount.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/currency_amount.rb deleted file mode 100644 index ddba757..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/currency_amount.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Currency type and amount. - class CurrencyAmount - # Three-digit currency code in ISO 4217 format. - attr_accessor :currency_code - - # The currency amount. - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'CurrencyCode', - :'amount' => :'Amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CurrencyAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CurrencyAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/custom_text_for_label.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/custom_text_for_label.rb deleted file mode 100644 index 7c5aee2..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/custom_text_for_label.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Custom text to print on the label. Note: Custom text is only included on labels that are in ZPL format (ZPL203). FedEx does not support `CustomTextForLabel`. - class CustomTextForLabel - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::CustomTextForLabel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::CustomTextForLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/dangerous_goods_details.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/dangerous_goods_details.rb deleted file mode 100644 index 6cbbbb8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/dangerous_goods_details.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Details related to any dangerous goods or items that are shipped. - class DangerousGoodsDetails - # The specific UNID of the item being shipped. - attr_accessor :united_nations_regulatory_id - - # The specific regulatory class of the shipped item. - attr_accessor :transportation_regulatory_class - - # The specific packaging group of the item being shipped. - attr_accessor :packing_group - - # The specific packing instruction of the item being shipped. - attr_accessor :packing_instruction - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'united_nations_regulatory_id' => :'UnitedNationsRegulatoryId', - :'transportation_regulatory_class' => :'TransportationRegulatoryClass', - :'packing_group' => :'PackingGroup', - :'packing_instruction' => :'PackingInstruction' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'united_nations_regulatory_id' => :'Object', - :'transportation_regulatory_class' => :'Object', - :'packing_group' => :'Object', - :'packing_instruction' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::DangerousGoodsDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::DangerousGoodsDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'united_nations_regulatory_id') - self.united_nations_regulatory_id = attributes[:'united_nations_regulatory_id'] - end - - if attributes.key?(:'transportation_regulatory_class') - self.transportation_regulatory_class = attributes[:'transportation_regulatory_class'] - end - - if attributes.key?(:'packing_group') - self.packing_group = attributes[:'packing_group'] - end - - if attributes.key?(:'packing_instruction') - self.packing_instruction = attributes[:'packing_instruction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - packing_group_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III']) - return false unless packing_group_validator.valid?(@packing_group) - packing_instruction_validator = EnumAttributeValidator.new('Object', ['PI965_SECTION_IA', 'PI965_SECTION_IB', 'PI965_SECTION_II', 'PI966_SECTION_I', 'PI966_SECTION_II', 'PI967_SECTION_I', 'PI967_SECTION_II', 'PI968_SECTION_IA', 'PI968_SECTION_IB', 'PI969_SECTION_I', 'PI969_SECTION_II', 'PI970_SECTION_I', 'PI970_SECTION_II']) - return false unless packing_instruction_validator.valid?(@packing_instruction) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] packing_group Object to be assigned - def packing_group=(packing_group) - validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III']) - unless validator.valid?(packing_group) - fail ArgumentError, "invalid value for \"packing_group\", must be one of #{validator.allowable_values}." - end - @packing_group = packing_group - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] packing_instruction Object to be assigned - def packing_instruction=(packing_instruction) - validator = EnumAttributeValidator.new('Object', ['PI965_SECTION_IA', 'PI965_SECTION_IB', 'PI965_SECTION_II', 'PI966_SECTION_I', 'PI966_SECTION_II', 'PI967_SECTION_I', 'PI967_SECTION_II', 'PI968_SECTION_IA', 'PI968_SECTION_IB', 'PI969_SECTION_I', 'PI969_SECTION_II', 'PI970_SECTION_I', 'PI970_SECTION_II']) - unless validator.valid?(packing_instruction) - fail ArgumentError, "invalid value for \"packing_instruction\", must be one of #{validator.allowable_values}." - end - @packing_instruction = packing_instruction - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - united_nations_regulatory_id == o.united_nations_regulatory_id && - transportation_regulatory_class == o.transportation_regulatory_class && - packing_group == o.packing_group && - packing_instruction == o.packing_instruction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [united_nations_regulatory_id, transportation_regulatory_class, packing_group, packing_instruction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_option.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_option.rb deleted file mode 100644 index a1a11ac..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_option.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class DeliveryExperienceOption - DELIVERY_CONFIRMATION_WITH_ADULT_SIGNATURE = 'DeliveryConfirmationWithAdultSignature'.freeze - DELIVERY_CONFIRMATION_WITH_SIGNATURE = 'DeliveryConfirmationWithSignature'.freeze - DELIVERY_CONFIRMATION_WITHOUT_SIGNATURE = 'DeliveryConfirmationWithoutSignature'.freeze - NO_TRACKING = 'NoTracking'.freeze - NO_PREFERENCE = 'NoPreference'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = DeliveryExperienceOption.constants.select { |c| DeliveryExperienceOption::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #DeliveryExperienceOption" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_type.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_type.rb deleted file mode 100644 index c0b4413..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/delivery_experience_type.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class DeliveryExperienceType - DELIVERY_CONFIRMATION_WITH_ADULT_SIGNATURE = 'DeliveryConfirmationWithAdultSignature'.freeze - DELIVERY_CONFIRMATION_WITH_SIGNATURE = 'DeliveryConfirmationWithSignature'.freeze - DELIVERY_CONFIRMATION_WITHOUT_SIGNATURE = 'DeliveryConfirmationWithoutSignature'.freeze - NO_TRACKING = 'NoTracking'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = DeliveryExperienceType.constants.select { |c| DeliveryExperienceType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #DeliveryExperienceType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/district_or_county.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/district_or_county.rb deleted file mode 100644 index b3bc765..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/district_or_county.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The district or county. - class DistrictOrCounty - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::DistrictOrCounty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::DistrictOrCounty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/email_address.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/email_address.rb deleted file mode 100644 index fc03b8b..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/email_address.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The email address. - class EmailAddress - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::EmailAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::EmailAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error.rb deleted file mode 100644 index e7308c2..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error_list.rb deleted file mode 100644 index 0c8fb19..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit.rb deleted file mode 100644 index cea35a2..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An object representing an excluded benefit that is excluded for a shipping offer or rate. - class ExcludedBenefit - # A benefit that is being excluded from a shipment. - attr_accessor :benefit - - attr_accessor :reason_codes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'benefit' => :'Benefit', - :'reason_codes' => :'ReasonCodes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'benefit' => :'Object', - :'reason_codes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefit` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'benefit') - self.benefit = attributes[:'benefit'] - end - - if attributes.key?(:'reason_codes') - self.reason_codes = attributes[:'reason_codes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - benefit == o.benefit && - reason_codes == o.reason_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [benefit, reason_codes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit_reason_codes.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit_reason_codes.rb deleted file mode 100644 index 1ea6989..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefit_reason_codes.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of reasons why a benefit is excluded for a shipping offer (for example, `LATE_DELIVERY_RISK`). - class ExcludedBenefitReasonCodes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefitReasonCodes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefitReasonCodes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefits.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefits.rb deleted file mode 100644 index bc56a6d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/excluded_benefits.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of excluded benefits. Refer to the `ExcludeBenefit` object for further documentation. - class ExcludedBenefits - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefits` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ExcludedBenefits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_contents.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_contents.rb deleted file mode 100644 index a9b23a3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_contents.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The document data and checksum. - class FileContents - # Data for printing labels encoded into a Base64, GZip-compressed string. - attr_accessor :contents - - attr_accessor :file_type - - # An MD5 hash to validate the PDF document data, in the form of a Base64 string. - attr_accessor :checksum - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contents' => :'Contents', - :'file_type' => :'FileType', - :'checksum' => :'Checksum' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'contents' => :'Object', - :'file_type' => :'Object', - :'checksum' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::FileContents` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::FileContents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contents') - self.contents = attributes[:'contents'] - end - - if attributes.key?(:'file_type') - self.file_type = attributes[:'file_type'] - end - - if attributes.key?(:'checksum') - self.checksum = attributes[:'checksum'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @contents.nil? - invalid_properties.push('invalid value for "contents", contents cannot be nil.') - end - - if @file_type.nil? - invalid_properties.push('invalid value for "file_type", file_type cannot be nil.') - end - - if @checksum.nil? - invalid_properties.push('invalid value for "checksum", checksum cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @contents.nil? - return false if @file_type.nil? - return false if @checksum.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contents == o.contents && - file_type == o.file_type && - checksum == o.checksum - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contents, file_type, checksum].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_type.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_type.rb deleted file mode 100644 index a5bc644..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/file_type.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class FileType - APPLICATIONPDF = 'application/pdf'.freeze - APPLICATIONZPL = 'application/zpl'.freeze - IMAGEPNG = 'image/png'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FileType.constants.select { |c| FileType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FileType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_request.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_request.rb deleted file mode 100644 index f599e15..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_request.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Request schema. - class GetAdditionalSellerInputsRequest - attr_accessor :shipping_service_id - - attr_accessor :ship_from_address - - attr_accessor :order_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipping_service_id' => :'ShippingServiceId', - :'ship_from_address' => :'ShipFromAddress', - :'order_id' => :'OrderId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipping_service_id' => :'Object', - :'ship_from_address' => :'Object', - :'order_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipping_service_id') - self.shipping_service_id = attributes[:'shipping_service_id'] - end - - if attributes.key?(:'ship_from_address') - self.ship_from_address = attributes[:'ship_from_address'] - end - - if attributes.key?(:'order_id') - self.order_id = attributes[:'order_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipping_service_id.nil? - invalid_properties.push('invalid value for "shipping_service_id", shipping_service_id cannot be nil.') - end - - if @ship_from_address.nil? - invalid_properties.push('invalid value for "ship_from_address", ship_from_address cannot be nil.') - end - - if @order_id.nil? - invalid_properties.push('invalid value for "order_id", order_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipping_service_id.nil? - return false if @ship_from_address.nil? - return false if @order_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipping_service_id == o.shipping_service_id && - ship_from_address == o.ship_from_address && - order_id == o.order_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipping_service_id, ship_from_address, order_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_response.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_response.rb deleted file mode 100644 index d187fbc..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Response schema. - class GetAdditionalSellerInputsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_result.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_result.rb deleted file mode 100644 index 764b368..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_additional_seller_inputs_result.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The payload for the `getAdditionalSellerInputs` operation. - class GetAdditionalSellerInputsResult - attr_accessor :shipment_level_fields - - attr_accessor :item_level_fields_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_level_fields' => :'ShipmentLevelFields', - :'item_level_fields_list' => :'ItemLevelFieldsList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_level_fields' => :'Object', - :'item_level_fields_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetAdditionalSellerInputsResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_level_fields') - self.shipment_level_fields = attributes[:'shipment_level_fields'] - end - - if attributes.key?(:'item_level_fields_list') - self.item_level_fields_list = attributes[:'item_level_fields_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_level_fields == o.shipment_level_fields && - item_level_fields_list == o.item_level_fields_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_level_fields, item_level_fields_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_request.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_request.rb deleted file mode 100644 index d7770f1..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_request.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Request schema. - class GetEligibleShipmentServicesRequest - attr_accessor :shipment_request_details - - attr_accessor :shipping_offering_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_request_details' => :'ShipmentRequestDetails', - :'shipping_offering_filter' => :'ShippingOfferingFilter' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_request_details' => :'Object', - :'shipping_offering_filter' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_request_details') - self.shipment_request_details = attributes[:'shipment_request_details'] - end - - if attributes.key?(:'shipping_offering_filter') - self.shipping_offering_filter = attributes[:'shipping_offering_filter'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_request_details.nil? - invalid_properties.push('invalid value for "shipment_request_details", shipment_request_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_request_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_request_details == o.shipment_request_details && - shipping_offering_filter == o.shipping_offering_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_request_details, shipping_offering_filter].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_response.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_response.rb deleted file mode 100644 index 80ef20d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Response schema. - class GetEligibleShipmentServicesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_result.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_result.rb deleted file mode 100644 index a066d7d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_eligible_shipment_services_result.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The payload for the `getEligibleShipmentServices` operation. - class GetEligibleShipmentServicesResult - attr_accessor :shipping_service_list - - attr_accessor :rejected_shipping_service_list - - attr_accessor :temporarily_unavailable_carrier_list - - attr_accessor :terms_and_conditions_not_accepted_carrier_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipping_service_list' => :'ShippingServiceList', - :'rejected_shipping_service_list' => :'RejectedShippingServiceList', - :'temporarily_unavailable_carrier_list' => :'TemporarilyUnavailableCarrierList', - :'terms_and_conditions_not_accepted_carrier_list' => :'TermsAndConditionsNotAcceptedCarrierList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipping_service_list' => :'Object', - :'rejected_shipping_service_list' => :'Object', - :'temporarily_unavailable_carrier_list' => :'Object', - :'terms_and_conditions_not_accepted_carrier_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetEligibleShipmentServicesResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipping_service_list') - self.shipping_service_list = attributes[:'shipping_service_list'] - end - - if attributes.key?(:'rejected_shipping_service_list') - self.rejected_shipping_service_list = attributes[:'rejected_shipping_service_list'] - end - - if attributes.key?(:'temporarily_unavailable_carrier_list') - self.temporarily_unavailable_carrier_list = attributes[:'temporarily_unavailable_carrier_list'] - end - - if attributes.key?(:'terms_and_conditions_not_accepted_carrier_list') - self.terms_and_conditions_not_accepted_carrier_list = attributes[:'terms_and_conditions_not_accepted_carrier_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipping_service_list.nil? - invalid_properties.push('invalid value for "shipping_service_list", shipping_service_list cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipping_service_list.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipping_service_list == o.shipping_service_list && - rejected_shipping_service_list == o.rejected_shipping_service_list && - temporarily_unavailable_carrier_list == o.temporarily_unavailable_carrier_list && - terms_and_conditions_not_accepted_carrier_list == o.terms_and_conditions_not_accepted_carrier_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipping_service_list, rejected_shipping_service_list, temporarily_unavailable_carrier_list, terms_and_conditions_not_accepted_carrier_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_shipment_response.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_shipment_response.rb deleted file mode 100644 index 918ddee..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/get_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Response schema. - class GetShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::GetShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::GetShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/hazmat_type.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/hazmat_type.rb deleted file mode 100644 index 1d3a4e8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/hazmat_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class HazmatType - NONE = 'None'.freeze - LQ_HAZMAT = 'LQHazmat'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = HazmatType.constants.select { |c| HazmatType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #HazmatType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/included_benefits.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/included_benefits.rb deleted file mode 100644 index 3a432e6..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/included_benefits.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of included benefits. - class IncludedBenefits - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::IncludedBenefits` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::IncludedBenefits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/input_target_type.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/input_target_type.rb deleted file mode 100644 index ccc10e8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/input_target_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class InputTargetType - SHIPMENT_LEVEL = 'SHIPMENT_LEVEL'.freeze - ITEM_LEVEL = 'ITEM_LEVEL'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = InputTargetType.constants.select { |c| InputTargetType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #InputTargetType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item.rb deleted file mode 100644 index 9755d3c..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item.rb +++ /dev/null @@ -1,294 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An Amazon order item identifier and a quantity. - class Item - attr_accessor :order_item_id - - attr_accessor :quantity - - attr_accessor :item_weight - - attr_accessor :item_description - - attr_accessor :transparency_code_list - - attr_accessor :item_level_seller_inputs_list - - attr_accessor :liquid_volume - - # When true, the item qualifies as hazardous materials (hazmat). Defaults to false. - attr_accessor :is_hazmat - - attr_accessor :dangerous_goods_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_item_id' => :'OrderItemId', - :'quantity' => :'Quantity', - :'item_weight' => :'ItemWeight', - :'item_description' => :'ItemDescription', - :'transparency_code_list' => :'TransparencyCodeList', - :'item_level_seller_inputs_list' => :'ItemLevelSellerInputsList', - :'liquid_volume' => :'LiquidVolume', - :'is_hazmat' => :'IsHazmat', - :'dangerous_goods_details' => :'DangerousGoodsDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_item_id' => :'Object', - :'quantity' => :'Object', - :'item_weight' => :'Object', - :'item_description' => :'Object', - :'transparency_code_list' => :'Object', - :'item_level_seller_inputs_list' => :'Object', - :'liquid_volume' => :'Object', - :'is_hazmat' => :'Object', - :'dangerous_goods_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'item_weight') - self.item_weight = attributes[:'item_weight'] - end - - if attributes.key?(:'item_description') - self.item_description = attributes[:'item_description'] - end - - if attributes.key?(:'transparency_code_list') - self.transparency_code_list = attributes[:'transparency_code_list'] - end - - if attributes.key?(:'item_level_seller_inputs_list') - self.item_level_seller_inputs_list = attributes[:'item_level_seller_inputs_list'] - end - - if attributes.key?(:'liquid_volume') - self.liquid_volume = attributes[:'liquid_volume'] - end - - if attributes.key?(:'is_hazmat') - self.is_hazmat = attributes[:'is_hazmat'] - end - - if attributes.key?(:'dangerous_goods_details') - self.dangerous_goods_details = attributes[:'dangerous_goods_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @order_item_id.nil? - invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @order_item_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_item_id == o.order_item_id && - quantity == o.quantity && - item_weight == o.item_weight && - item_description == o.item_description && - transparency_code_list == o.transparency_code_list && - item_level_seller_inputs_list == o.item_level_seller_inputs_list && - liquid_volume == o.liquid_volume && - is_hazmat == o.is_hazmat && - dangerous_goods_details == o.dangerous_goods_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_item_id, quantity, item_weight, item_description, transparency_code_list, item_level_seller_inputs_list, liquid_volume, is_hazmat, dangerous_goods_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_description.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_description.rb deleted file mode 100644 index eb28e1e..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_description.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The description of the item. - class ItemDescription - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ItemDescription` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ItemDescription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields.rb deleted file mode 100644 index 09ca954..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of item level fields. - class ItemLevelFields - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - attr_accessor :additional_inputs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'Asin', - :'additional_inputs' => :'AdditionalInputs' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'additional_inputs' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ItemLevelFields` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ItemLevelFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'additional_inputs') - self.additional_inputs = attributes[:'additional_inputs'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - if @additional_inputs.nil? - invalid_properties.push('invalid value for "additional_inputs", additional_inputs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asin.nil? - return false if @additional_inputs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - additional_inputs == o.additional_inputs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, additional_inputs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields_list.rb deleted file mode 100644 index d917ad3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_level_fields_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of item level fields. - class ItemLevelFieldsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ItemLevelFieldsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ItemLevelFieldsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_list.rb deleted file mode 100644 index bca58aa..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The list of items you want to include in a shipment. - class ItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_quantity.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_quantity.rb deleted file mode 100644 index cc0fa15..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/item_quantity.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The number of items. - class ItemQuantity - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label.rb deleted file mode 100644 index 0d35fa3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Data for creating a shipping label and dimensions for printing the label. - class Label - attr_accessor :custom_text_for_label - - attr_accessor :dimensions - - attr_accessor :file_contents - - attr_accessor :label_format - - attr_accessor :standard_id_for_label - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'custom_text_for_label' => :'CustomTextForLabel', - :'dimensions' => :'Dimensions', - :'file_contents' => :'FileContents', - :'label_format' => :'LabelFormat', - :'standard_id_for_label' => :'StandardIdForLabel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'custom_text_for_label' => :'Object', - :'dimensions' => :'Object', - :'file_contents' => :'Object', - :'label_format' => :'Object', - :'standard_id_for_label' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Label` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Label`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'custom_text_for_label') - self.custom_text_for_label = attributes[:'custom_text_for_label'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'file_contents') - self.file_contents = attributes[:'file_contents'] - end - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - - if attributes.key?(:'standard_id_for_label') - self.standard_id_for_label = attributes[:'standard_id_for_label'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @dimensions.nil? - invalid_properties.push('invalid value for "dimensions", dimensions cannot be nil.') - end - - if @file_contents.nil? - invalid_properties.push('invalid value for "file_contents", file_contents cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @dimensions.nil? - return false if @file_contents.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - custom_text_for_label == o.custom_text_for_label && - dimensions == o.dimensions && - file_contents == o.file_contents && - label_format == o.label_format && - standard_id_for_label == o.standard_id_for_label - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [custom_text_for_label, dimensions, file_contents, label_format, standard_id_for_label].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_customization.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_customization.rb deleted file mode 100644 index 90187f9..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_customization.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Custom text for shipping labels. - class LabelCustomization - attr_accessor :custom_text_for_label - - attr_accessor :standard_id_for_label - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'custom_text_for_label' => :'CustomTextForLabel', - :'standard_id_for_label' => :'StandardIdForLabel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'custom_text_for_label' => :'Object', - :'standard_id_for_label' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelCustomization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelCustomization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'custom_text_for_label') - self.custom_text_for_label = attributes[:'custom_text_for_label'] - end - - if attributes.key?(:'standard_id_for_label') - self.standard_id_for_label = attributes[:'standard_id_for_label'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - custom_text_for_label == o.custom_text_for_label && - standard_id_for_label == o.standard_id_for_label - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [custom_text_for_label, standard_id_for_label].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimension.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimension.rb deleted file mode 100644 index 6f4834e..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimension.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A label dimension. - class LabelDimension - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelDimension` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelDimension`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimensions.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimensions.rb deleted file mode 100644 index b7c3bc2..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_dimensions.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Dimensions for printing a shipping label. - class LabelDimensions - attr_accessor :length - - attr_accessor :width - - attr_accessor :unit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'Length', - :'width' => :'Width', - :'unit' => :'Unit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Object', - :'width' => :'Object', - :'unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelDimensions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelDimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @length.nil? - invalid_properties.push('invalid value for "length", length cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @length.nil? - return false if @width.nil? - return false if @unit.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length && - width == o.width && - unit == o.unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length, width, unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format.rb deleted file mode 100644 index 0b0075d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class LabelFormat - PDF = 'PDF'.freeze - PNG = 'PNG'.freeze - ZPL203 = 'ZPL203'.freeze - ZPL300 = 'ZPL300'.freeze - SHIPPING_SERVICE_DEFAULT = 'ShippingServiceDefault'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = LabelFormat.constants.select { |c| LabelFormat::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #LabelFormat" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_list.rb deleted file mode 100644 index b9e0211..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of label formats. - class LabelFormatList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option.rb deleted file mode 100644 index 3a8d372..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The label format details and whether to include a packing slip. - class LabelFormatOption - # When true, include a packing slip with the label. - attr_accessor :include_packing_slip_with_label - - attr_accessor :label_format - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_packing_slip_with_label' => :'IncludePackingSlipWithLabel', - :'label_format' => :'LabelFormat' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_packing_slip_with_label' => :'Object', - :'label_format' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatOption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_packing_slip_with_label') - self.include_packing_slip_with_label = attributes[:'include_packing_slip_with_label'] - end - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_packing_slip_with_label == o.include_packing_slip_with_label && - label_format == o.label_format - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_packing_slip_with_label, label_format].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option_request.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option_request.rb deleted file mode 100644 index 9188799..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/label_format_option_request.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Whether to include a packing slip. - class LabelFormatOptionRequest - # When true, include a packing slip with the label. - attr_accessor :include_packing_slip_with_label - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_packing_slip_with_label' => :'IncludePackingSlipWithLabel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_packing_slip_with_label' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatOptionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LabelFormatOptionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_packing_slip_with_label') - self.include_packing_slip_with_label = attributes[:'include_packing_slip_with_label'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_packing_slip_with_label == o.include_packing_slip_with_label - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_packing_slip_with_label].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/length.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/length.rb deleted file mode 100644 index 1d4e598..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/length.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The length. - class Length - # The value in units. - attr_accessor :value - - attr_accessor :unit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'unit' => :'unit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Length` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Length`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - unit == o.unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/liquid_volume.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/liquid_volume.rb deleted file mode 100644 index b4c7d17..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/liquid_volume.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Liquid volume. - class LiquidVolume - # The unit of measurement. - attr_accessor :unit - - # The measurement value. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit' => :'Unit', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::LiquidVolume` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::LiquidVolume`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit.nil? - unit_validator = EnumAttributeValidator.new('Object', ['ML', 'L', 'FL_OZ', 'GAL', 'PT', 'QT', 'C']) - return false unless unit_validator.valid?(@unit) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('Object', ['ML', 'L', 'FL_OZ', 'GAL', 'PT', 'QT', 'C']) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit == o.unit && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/order_item_id.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/order_item_id.rb deleted file mode 100644 index a3e7ba0..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/order_item_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An Amazon-defined identifier for an individual item in an order. - class OrderItemId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::OrderItemId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::OrderItemId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimension.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimension.rb deleted file mode 100644 index 194e3e1..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimension.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A number that represents the given package dimension. - class PackageDimension - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::PackageDimension` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::PackageDimension`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimensions.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimensions.rb deleted file mode 100644 index bca7883..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/package_dimensions.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The dimensions of a package contained in a shipment. - class PackageDimensions - attr_accessor :length - - attr_accessor :width - - attr_accessor :height - - attr_accessor :unit - - attr_accessor :predefined_package_dimensions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'Length', - :'width' => :'Width', - :'height' => :'Height', - :'unit' => :'Unit', - :'predefined_package_dimensions' => :'PredefinedPackageDimensions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Object', - :'width' => :'Object', - :'height' => :'Object', - :'unit' => :'Object', - :'predefined_package_dimensions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::PackageDimensions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::PackageDimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'predefined_package_dimensions') - self.predefined_package_dimensions = attributes[:'predefined_package_dimensions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length && - width == o.width && - height == o.height && - unit == o.unit && - predefined_package_dimensions == o.predefined_package_dimensions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length, width, height, unit, predefined_package_dimensions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/phone_number.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/phone_number.rb deleted file mode 100644 index 8f86b00..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/phone_number.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The phone number. - class PhoneNumber - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::PhoneNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::PhoneNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/postal_code.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/postal_code.rb deleted file mode 100644 index d56ea65..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/postal_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The zip code or postal code. - class PostalCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::PostalCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::PostalCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/predefined_package_dimensions.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/predefined_package_dimensions.rb deleted file mode 100644 index 920167f..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/predefined_package_dimensions.rb +++ /dev/null @@ -1,78 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class PredefinedPackageDimensions - FED_EX_BOX_10KG = 'FedEx_Box_10kg'.freeze - FED_EX_BOX_25KG = 'FedEx_Box_25kg'.freeze - FED_EX_BOX_EXTRA_LARGE_1 = 'FedEx_Box_Extra_Large_1'.freeze - FED_EX_BOX_EXTRA_LARGE_2 = 'FedEx_Box_Extra_Large_2'.freeze - FED_EX_BOX_LARGE_1 = 'FedEx_Box_Large_1'.freeze - FED_EX_BOX_LARGE_2 = 'FedEx_Box_Large_2'.freeze - FED_EX_BOX_MEDIUM_1 = 'FedEx_Box_Medium_1'.freeze - FED_EX_BOX_MEDIUM_2 = 'FedEx_Box_Medium_2'.freeze - FED_EX_BOX_SMALL_1 = 'FedEx_Box_Small_1'.freeze - FED_EX_BOX_SMALL_2 = 'FedEx_Box_Small_2'.freeze - FED_EX_ENVELOPE = 'FedEx_Envelope'.freeze - FED_EX_PADDED_PAK = 'FedEx_Padded_Pak'.freeze - FED_EX_PAK_1 = 'FedEx_Pak_1'.freeze - FED_EX_PAK_2 = 'FedEx_Pak_2'.freeze - FED_EX_TUBE = 'FedEx_Tube'.freeze - FED_EX_XL_PAK = 'FedEx_XL_Pak'.freeze - UPS_BOX_10KG = 'UPS_Box_10kg'.freeze - UPS_BOX_25KG = 'UPS_Box_25kg'.freeze - UPS_EXPRESS_BOX = 'UPS_Express_Box'.freeze - UPS_EXPRESS_BOX_LARGE = 'UPS_Express_Box_Large'.freeze - UPS_EXPRESS_BOX_MEDIUM = 'UPS_Express_Box_Medium'.freeze - UPS_EXPRESS_BOX_SMALL = 'UPS_Express_Box_Small'.freeze - UPS_EXPRESS_ENVELOPE = 'UPS_Express_Envelope'.freeze - UPS_EXPRESS_HARD_PAK = 'UPS_Express_Hard_Pak'.freeze - UPS_EXPRESS_LEGAL_ENVELOPE = 'UPS_Express_Legal_Envelope'.freeze - UPS_EXPRESS_PAK = 'UPS_Express_Pak'.freeze - UPS_EXPRESS_TUBE = 'UPS_Express_Tube'.freeze - UPS_LABORATORY_PAK = 'UPS_Laboratory_Pak'.freeze - UPS_PAD_PAK = 'UPS_Pad_Pak'.freeze - UPS_PALLET = 'UPS_Pallet'.freeze - USPS_CARD = 'USPS_Card'.freeze - USPS_FLAT = 'USPS_Flat'.freeze - USPS_FLAT_RATE_CARDBOARD_ENVELOPE = 'USPS_FlatRateCardboardEnvelope'.freeze - USPS_FLAT_RATE_ENVELOPE = 'USPS_FlatRateEnvelope'.freeze - USPS_FLAT_RATE_GIFT_CARD_ENVELOPE = 'USPS_FlatRateGiftCardEnvelope'.freeze - USPS_FLAT_RATE_LEGAL_ENVELOPE = 'USPS_FlatRateLegalEnvelope'.freeze - USPS_FLAT_RATE_PADDED_ENVELOPE = 'USPS_FlatRatePaddedEnvelope'.freeze - USPS_FLAT_RATE_WINDOW_ENVELOPE = 'USPS_FlatRateWindowEnvelope'.freeze - USPS_LARGE_FLAT_RATE_BOARD_GAME_BOX = 'USPS_LargeFlatRateBoardGameBox'.freeze - USPS_LARGE_FLAT_RATE_BOX = 'USPS_LargeFlatRateBox'.freeze - USPS_LETTER = 'USPS_Letter'.freeze - USPS_MEDIUM_FLAT_RATE_BOX1 = 'USPS_MediumFlatRateBox1'.freeze - USPS_MEDIUM_FLAT_RATE_BOX2 = 'USPS_MediumFlatRateBox2'.freeze - USPS_REGIONAL_RATE_BOX_A1 = 'USPS_RegionalRateBoxA1'.freeze - USPS_REGIONAL_RATE_BOX_A2 = 'USPS_RegionalRateBoxA2'.freeze - USPS_REGIONAL_RATE_BOX_B1 = 'USPS_RegionalRateBoxB1'.freeze - USPS_REGIONAL_RATE_BOX_B2 = 'USPS_RegionalRateBoxB2'.freeze - USPS_REGIONAL_RATE_BOX_C = 'USPS_RegionalRateBoxC'.freeze - USPS_SMALL_FLAT_RATE_BOX = 'USPS_SmallFlatRateBox'.freeze - USPS_SMALL_FLAT_RATE_ENVELOPE = 'USPS_SmallFlatRateEnvelope'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = PredefinedPackageDimensions.constants.select { |c| PredefinedPackageDimensions::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #PredefinedPackageDimensions" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service.rb deleted file mode 100644 index 82e3201..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Information about a rejected shipping service - class RejectedShippingService - # The rejected shipping carrier name. For example, USPS. - attr_accessor :carrier_name - - # The rejected shipping service localized name. For example, FedEx Standard Overnight. - attr_accessor :shipping_service_name - - attr_accessor :shipping_service_id - - # A reason code meant to be consumed programatically. For example, `CARRIER_CANNOT_SHIP_TO_POBOX`. - attr_accessor :rejection_reason_code - - # A localized human readable description of the rejected reason. - attr_accessor :rejection_reason_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carrier_name' => :'CarrierName', - :'shipping_service_name' => :'ShippingServiceName', - :'shipping_service_id' => :'ShippingServiceId', - :'rejection_reason_code' => :'RejectionReasonCode', - :'rejection_reason_message' => :'RejectionReasonMessage' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carrier_name' => :'Object', - :'shipping_service_name' => :'Object', - :'shipping_service_id' => :'Object', - :'rejection_reason_code' => :'Object', - :'rejection_reason_message' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::RejectedShippingService` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::RejectedShippingService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carrier_name') - self.carrier_name = attributes[:'carrier_name'] - end - - if attributes.key?(:'shipping_service_name') - self.shipping_service_name = attributes[:'shipping_service_name'] - end - - if attributes.key?(:'shipping_service_id') - self.shipping_service_id = attributes[:'shipping_service_id'] - end - - if attributes.key?(:'rejection_reason_code') - self.rejection_reason_code = attributes[:'rejection_reason_code'] - end - - if attributes.key?(:'rejection_reason_message') - self.rejection_reason_message = attributes[:'rejection_reason_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carrier_name.nil? - invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') - end - - if @shipping_service_name.nil? - invalid_properties.push('invalid value for "shipping_service_name", shipping_service_name cannot be nil.') - end - - if @shipping_service_id.nil? - invalid_properties.push('invalid value for "shipping_service_id", shipping_service_id cannot be nil.') - end - - if @rejection_reason_code.nil? - invalid_properties.push('invalid value for "rejection_reason_code", rejection_reason_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carrier_name.nil? - return false if @shipping_service_name.nil? - return false if @shipping_service_id.nil? - return false if @rejection_reason_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carrier_name == o.carrier_name && - shipping_service_name == o.shipping_service_name && - shipping_service_id == o.shipping_service_id && - rejection_reason_code == o.rejection_reason_code && - rejection_reason_message == o.rejection_reason_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carrier_name, shipping_service_name, shipping_service_id, rejection_reason_code, rejection_reason_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service_list.rb deleted file mode 100644 index 87d93c3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/rejected_shipping_service_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of services that are for some reason unavailable for this request - class RejectedShippingServiceList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::RejectedShippingServiceList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::RejectedShippingServiceList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/restricted_set_values.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/restricted_set_values.rb deleted file mode 100644 index 889511a..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/restricted_set_values.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The set of fixed values in an additional seller input. - class RestrictedSetValues - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::RestrictedSetValues` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::RestrictedSetValues`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_input_definition.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_input_definition.rb deleted file mode 100644 index c3ce347..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_input_definition.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Specifies characteristics that apply to a seller input. - class SellerInputDefinition - # When true, the additional input field is required. - attr_accessor :is_required - - # The data type of the additional input field. - attr_accessor :data_type - - attr_accessor :constraints - - # The display text for the additional input field. - attr_accessor :input_display_text - - attr_accessor :input_target - - attr_accessor :stored_value - - attr_accessor :restricted_set_values - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_required' => :'IsRequired', - :'data_type' => :'DataType', - :'constraints' => :'Constraints', - :'input_display_text' => :'InputDisplayText', - :'input_target' => :'InputTarget', - :'stored_value' => :'StoredValue', - :'restricted_set_values' => :'RestrictedSetValues' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_required' => :'Object', - :'data_type' => :'Object', - :'constraints' => :'Object', - :'input_display_text' => :'Object', - :'input_target' => :'Object', - :'stored_value' => :'Object', - :'restricted_set_values' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::SellerInputDefinition` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::SellerInputDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_required') - self.is_required = attributes[:'is_required'] - end - - if attributes.key?(:'data_type') - self.data_type = attributes[:'data_type'] - end - - if attributes.key?(:'constraints') - self.constraints = attributes[:'constraints'] - end - - if attributes.key?(:'input_display_text') - self.input_display_text = attributes[:'input_display_text'] - end - - if attributes.key?(:'input_target') - self.input_target = attributes[:'input_target'] - end - - if attributes.key?(:'stored_value') - self.stored_value = attributes[:'stored_value'] - end - - if attributes.key?(:'restricted_set_values') - self.restricted_set_values = attributes[:'restricted_set_values'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_required.nil? - invalid_properties.push('invalid value for "is_required", is_required cannot be nil.') - end - - if @data_type.nil? - invalid_properties.push('invalid value for "data_type", data_type cannot be nil.') - end - - if @constraints.nil? - invalid_properties.push('invalid value for "constraints", constraints cannot be nil.') - end - - if @input_display_text.nil? - invalid_properties.push('invalid value for "input_display_text", input_display_text cannot be nil.') - end - - if @stored_value.nil? - invalid_properties.push('invalid value for "stored_value", stored_value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_required.nil? - return false if @data_type.nil? - return false if @constraints.nil? - return false if @input_display_text.nil? - return false if @stored_value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_required == o.is_required && - data_type == o.data_type && - constraints == o.constraints && - input_display_text == o.input_display_text && - input_target == o.input_target && - stored_value == o.stored_value && - restricted_set_values == o.restricted_set_values - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_required, data_type, constraints, input_display_text, input_target, stored_value, restricted_set_values].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_order_id.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_order_id.rb deleted file mode 100644 index ecccb06..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/seller_order_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A seller-defined order identifier. - class SellerOrderId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::SellerOrderId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::SellerOrderId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment.rb deleted file mode 100644 index e41a4be..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment.rb +++ /dev/null @@ -1,397 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The details of a shipment. Includes the shipment status. - class Shipment - attr_accessor :shipment_id - - attr_accessor :amazon_order_id - - attr_accessor :seller_order_id - - attr_accessor :item_list - - attr_accessor :ship_from_address - - attr_accessor :ship_to_address - - attr_accessor :package_dimensions - - attr_accessor :weight - - attr_accessor :insurance - - attr_accessor :shipping_service - - attr_accessor :label - - attr_accessor :status - - attr_accessor :tracking_id - - attr_accessor :created_date - - attr_accessor :last_updated_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'ShipmentId', - :'amazon_order_id' => :'AmazonOrderId', - :'seller_order_id' => :'SellerOrderId', - :'item_list' => :'ItemList', - :'ship_from_address' => :'ShipFromAddress', - :'ship_to_address' => :'ShipToAddress', - :'package_dimensions' => :'PackageDimensions', - :'weight' => :'Weight', - :'insurance' => :'Insurance', - :'shipping_service' => :'ShippingService', - :'label' => :'Label', - :'status' => :'Status', - :'tracking_id' => :'TrackingId', - :'created_date' => :'CreatedDate', - :'last_updated_date' => :'LastUpdatedDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'amazon_order_id' => :'Object', - :'seller_order_id' => :'Object', - :'item_list' => :'Object', - :'ship_from_address' => :'Object', - :'ship_to_address' => :'Object', - :'package_dimensions' => :'Object', - :'weight' => :'Object', - :'insurance' => :'Object', - :'shipping_service' => :'Object', - :'label' => :'Object', - :'status' => :'Object', - :'tracking_id' => :'Object', - :'created_date' => :'Object', - :'last_updated_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Shipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Shipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'seller_order_id') - self.seller_order_id = attributes[:'seller_order_id'] - end - - if attributes.key?(:'item_list') - self.item_list = attributes[:'item_list'] - end - - if attributes.key?(:'ship_from_address') - self.ship_from_address = attributes[:'ship_from_address'] - end - - if attributes.key?(:'ship_to_address') - self.ship_to_address = attributes[:'ship_to_address'] - end - - if attributes.key?(:'package_dimensions') - self.package_dimensions = attributes[:'package_dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'insurance') - self.insurance = attributes[:'insurance'] - end - - if attributes.key?(:'shipping_service') - self.shipping_service = attributes[:'shipping_service'] - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'tracking_id') - self.tracking_id = attributes[:'tracking_id'] - end - - if attributes.key?(:'created_date') - self.created_date = attributes[:'created_date'] - end - - if attributes.key?(:'last_updated_date') - self.last_updated_date = attributes[:'last_updated_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_id.nil? - invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') - end - - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - if @item_list.nil? - invalid_properties.push('invalid value for "item_list", item_list cannot be nil.') - end - - if @ship_from_address.nil? - invalid_properties.push('invalid value for "ship_from_address", ship_from_address cannot be nil.') - end - - if @ship_to_address.nil? - invalid_properties.push('invalid value for "ship_to_address", ship_to_address cannot be nil.') - end - - if @package_dimensions.nil? - invalid_properties.push('invalid value for "package_dimensions", package_dimensions cannot be nil.') - end - - if @weight.nil? - invalid_properties.push('invalid value for "weight", weight cannot be nil.') - end - - if @insurance.nil? - invalid_properties.push('invalid value for "insurance", insurance cannot be nil.') - end - - if @shipping_service.nil? - invalid_properties.push('invalid value for "shipping_service", shipping_service cannot be nil.') - end - - if @label.nil? - invalid_properties.push('invalid value for "label", label cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_date.nil? - invalid_properties.push('invalid value for "created_date", created_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_id.nil? - return false if @amazon_order_id.nil? - return false if @item_list.nil? - return false if @ship_from_address.nil? - return false if @ship_to_address.nil? - return false if @package_dimensions.nil? - return false if @weight.nil? - return false if @insurance.nil? - return false if @shipping_service.nil? - return false if @label.nil? - return false if @status.nil? - return false if @created_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - amazon_order_id == o.amazon_order_id && - seller_order_id == o.seller_order_id && - item_list == o.item_list && - ship_from_address == o.ship_from_address && - ship_to_address == o.ship_to_address && - package_dimensions == o.package_dimensions && - weight == o.weight && - insurance == o.insurance && - shipping_service == o.shipping_service && - label == o.label && - status == o.status && - tracking_id == o.tracking_id && - created_date == o.created_date && - last_updated_date == o.last_updated_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, amazon_order_id, seller_order_id, item_list, ship_from_address, ship_to_address, package_dimensions, weight, insurance, shipping_service, label, status, tracking_id, created_date, last_updated_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_id.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_id.rb deleted file mode 100644 index abaf52a..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An Amazon-defined shipment identifier. - class ShipmentId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShipmentId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShipmentId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_request_details.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_request_details.rb deleted file mode 100644 index 802c4e1..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_request_details.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Shipment information required for requesting shipping service offers or for creating a shipment. - class ShipmentRequestDetails - attr_accessor :amazon_order_id - - attr_accessor :seller_order_id - - attr_accessor :item_list - - attr_accessor :ship_from_address - - attr_accessor :package_dimensions - - attr_accessor :weight - - attr_accessor :must_arrive_by_date - - attr_accessor :ship_date - - attr_accessor :shipping_service_options - - attr_accessor :label_customization - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_order_id' => :'AmazonOrderId', - :'seller_order_id' => :'SellerOrderId', - :'item_list' => :'ItemList', - :'ship_from_address' => :'ShipFromAddress', - :'package_dimensions' => :'PackageDimensions', - :'weight' => :'Weight', - :'must_arrive_by_date' => :'MustArriveByDate', - :'ship_date' => :'ShipDate', - :'shipping_service_options' => :'ShippingServiceOptions', - :'label_customization' => :'LabelCustomization' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_order_id' => :'Object', - :'seller_order_id' => :'Object', - :'item_list' => :'Object', - :'ship_from_address' => :'Object', - :'package_dimensions' => :'Object', - :'weight' => :'Object', - :'must_arrive_by_date' => :'Object', - :'ship_date' => :'Object', - :'shipping_service_options' => :'Object', - :'label_customization' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShipmentRequestDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShipmentRequestDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'seller_order_id') - self.seller_order_id = attributes[:'seller_order_id'] - end - - if attributes.key?(:'item_list') - self.item_list = attributes[:'item_list'] - end - - if attributes.key?(:'ship_from_address') - self.ship_from_address = attributes[:'ship_from_address'] - end - - if attributes.key?(:'package_dimensions') - self.package_dimensions = attributes[:'package_dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'must_arrive_by_date') - self.must_arrive_by_date = attributes[:'must_arrive_by_date'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'shipping_service_options') - self.shipping_service_options = attributes[:'shipping_service_options'] - end - - if attributes.key?(:'label_customization') - self.label_customization = attributes[:'label_customization'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - if @item_list.nil? - invalid_properties.push('invalid value for "item_list", item_list cannot be nil.') - end - - if @ship_from_address.nil? - invalid_properties.push('invalid value for "ship_from_address", ship_from_address cannot be nil.') - end - - if @package_dimensions.nil? - invalid_properties.push('invalid value for "package_dimensions", package_dimensions cannot be nil.') - end - - if @weight.nil? - invalid_properties.push('invalid value for "weight", weight cannot be nil.') - end - - if @shipping_service_options.nil? - invalid_properties.push('invalid value for "shipping_service_options", shipping_service_options cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_order_id.nil? - return false if @item_list.nil? - return false if @ship_from_address.nil? - return false if @package_dimensions.nil? - return false if @weight.nil? - return false if @shipping_service_options.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_order_id == o.amazon_order_id && - seller_order_id == o.seller_order_id && - item_list == o.item_list && - ship_from_address == o.ship_from_address && - package_dimensions == o.package_dimensions && - weight == o.weight && - must_arrive_by_date == o.must_arrive_by_date && - ship_date == o.ship_date && - shipping_service_options == o.shipping_service_options && - label_customization == o.label_customization - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_order_id, seller_order_id, item_list, ship_from_address, package_dimensions, weight, must_arrive_by_date, ship_date, shipping_service_options, label_customization].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_status.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_status.rb deleted file mode 100644 index e2e42f8..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipment_status.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class ShipmentStatus - PURCHASED = 'Purchased'.freeze - REFUND_PENDING = 'RefundPending'.freeze - REFUND_REJECTED = 'RefundRejected'.freeze - REFUND_APPLIED = 'RefundApplied'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ShipmentStatus.constants.select { |c| ShipmentStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ShipmentStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_offering_filter.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_offering_filter.rb deleted file mode 100644 index d7ed8d3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_offering_filter.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Filter for use when requesting eligible shipping services. - class ShippingOfferingFilter - # When true, include a packing slip with the label. - attr_accessor :include_packing_slip_with_label - - # When true, include complex shipping options. - attr_accessor :include_complex_shipping_options - - attr_accessor :carrier_will_pick_up - - attr_accessor :delivery_experience - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_packing_slip_with_label' => :'IncludePackingSlipWithLabel', - :'include_complex_shipping_options' => :'IncludeComplexShippingOptions', - :'carrier_will_pick_up' => :'CarrierWillPickUp', - :'delivery_experience' => :'DeliveryExperience' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_packing_slip_with_label' => :'Object', - :'include_complex_shipping_options' => :'Object', - :'carrier_will_pick_up' => :'Object', - :'delivery_experience' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingOfferingFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingOfferingFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_packing_slip_with_label') - self.include_packing_slip_with_label = attributes[:'include_packing_slip_with_label'] - end - - if attributes.key?(:'include_complex_shipping_options') - self.include_complex_shipping_options = attributes[:'include_complex_shipping_options'] - end - - if attributes.key?(:'carrier_will_pick_up') - self.carrier_will_pick_up = attributes[:'carrier_will_pick_up'] - end - - if attributes.key?(:'delivery_experience') - self.delivery_experience = attributes[:'delivery_experience'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_packing_slip_with_label == o.include_packing_slip_with_label && - include_complex_shipping_options == o.include_complex_shipping_options && - carrier_will_pick_up == o.carrier_will_pick_up && - delivery_experience == o.delivery_experience - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_packing_slip_with_label, include_complex_shipping_options, carrier_will_pick_up, delivery_experience].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service.rb deleted file mode 100644 index 333ac35..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service.rb +++ /dev/null @@ -1,372 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A shipping service offer made by a carrier. - class ShippingService - # A plain text representation of a carrier's shipping service. For example, \"UPS Ground\" or \"FedEx Standard Overnight\". - attr_accessor :shipping_service_name - - # The name of the carrier. - attr_accessor :carrier_name - - attr_accessor :shipping_service_id - - # An Amazon-defined shipping service offer identifier. - attr_accessor :shipping_service_offer_id - - attr_accessor :ship_date - - attr_accessor :earliest_estimated_delivery_date - - attr_accessor :latest_estimated_delivery_date - - attr_accessor :rate - - attr_accessor :shipping_service_options - - attr_accessor :available_shipping_service_options - - attr_accessor :available_label_formats - - attr_accessor :available_format_options_for_label - - # When true, additional seller inputs are required. - attr_accessor :requires_additional_seller_inputs - - attr_accessor :benefits - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipping_service_name' => :'ShippingServiceName', - :'carrier_name' => :'CarrierName', - :'shipping_service_id' => :'ShippingServiceId', - :'shipping_service_offer_id' => :'ShippingServiceOfferId', - :'ship_date' => :'ShipDate', - :'earliest_estimated_delivery_date' => :'EarliestEstimatedDeliveryDate', - :'latest_estimated_delivery_date' => :'LatestEstimatedDeliveryDate', - :'rate' => :'Rate', - :'shipping_service_options' => :'ShippingServiceOptions', - :'available_shipping_service_options' => :'AvailableShippingServiceOptions', - :'available_label_formats' => :'AvailableLabelFormats', - :'available_format_options_for_label' => :'AvailableFormatOptionsForLabel', - :'requires_additional_seller_inputs' => :'RequiresAdditionalSellerInputs', - :'benefits' => :'Benefits' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipping_service_name' => :'Object', - :'carrier_name' => :'Object', - :'shipping_service_id' => :'Object', - :'shipping_service_offer_id' => :'Object', - :'ship_date' => :'Object', - :'earliest_estimated_delivery_date' => :'Object', - :'latest_estimated_delivery_date' => :'Object', - :'rate' => :'Object', - :'shipping_service_options' => :'Object', - :'available_shipping_service_options' => :'Object', - :'available_label_formats' => :'Object', - :'available_format_options_for_label' => :'Object', - :'requires_additional_seller_inputs' => :'Object', - :'benefits' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingService` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipping_service_name') - self.shipping_service_name = attributes[:'shipping_service_name'] - end - - if attributes.key?(:'carrier_name') - self.carrier_name = attributes[:'carrier_name'] - end - - if attributes.key?(:'shipping_service_id') - self.shipping_service_id = attributes[:'shipping_service_id'] - end - - if attributes.key?(:'shipping_service_offer_id') - self.shipping_service_offer_id = attributes[:'shipping_service_offer_id'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'earliest_estimated_delivery_date') - self.earliest_estimated_delivery_date = attributes[:'earliest_estimated_delivery_date'] - end - - if attributes.key?(:'latest_estimated_delivery_date') - self.latest_estimated_delivery_date = attributes[:'latest_estimated_delivery_date'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - - if attributes.key?(:'shipping_service_options') - self.shipping_service_options = attributes[:'shipping_service_options'] - end - - if attributes.key?(:'available_shipping_service_options') - self.available_shipping_service_options = attributes[:'available_shipping_service_options'] - end - - if attributes.key?(:'available_label_formats') - self.available_label_formats = attributes[:'available_label_formats'] - end - - if attributes.key?(:'available_format_options_for_label') - self.available_format_options_for_label = attributes[:'available_format_options_for_label'] - end - - if attributes.key?(:'requires_additional_seller_inputs') - self.requires_additional_seller_inputs = attributes[:'requires_additional_seller_inputs'] - end - - if attributes.key?(:'benefits') - self.benefits = attributes[:'benefits'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipping_service_name.nil? - invalid_properties.push('invalid value for "shipping_service_name", shipping_service_name cannot be nil.') - end - - if @carrier_name.nil? - invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') - end - - if @shipping_service_id.nil? - invalid_properties.push('invalid value for "shipping_service_id", shipping_service_id cannot be nil.') - end - - if @shipping_service_offer_id.nil? - invalid_properties.push('invalid value for "shipping_service_offer_id", shipping_service_offer_id cannot be nil.') - end - - if @ship_date.nil? - invalid_properties.push('invalid value for "ship_date", ship_date cannot be nil.') - end - - if @rate.nil? - invalid_properties.push('invalid value for "rate", rate cannot be nil.') - end - - if @shipping_service_options.nil? - invalid_properties.push('invalid value for "shipping_service_options", shipping_service_options cannot be nil.') - end - - if @requires_additional_seller_inputs.nil? - invalid_properties.push('invalid value for "requires_additional_seller_inputs", requires_additional_seller_inputs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipping_service_name.nil? - return false if @carrier_name.nil? - return false if @shipping_service_id.nil? - return false if @shipping_service_offer_id.nil? - return false if @ship_date.nil? - return false if @rate.nil? - return false if @shipping_service_options.nil? - return false if @requires_additional_seller_inputs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipping_service_name == o.shipping_service_name && - carrier_name == o.carrier_name && - shipping_service_id == o.shipping_service_id && - shipping_service_offer_id == o.shipping_service_offer_id && - ship_date == o.ship_date && - earliest_estimated_delivery_date == o.earliest_estimated_delivery_date && - latest_estimated_delivery_date == o.latest_estimated_delivery_date && - rate == o.rate && - shipping_service_options == o.shipping_service_options && - available_shipping_service_options == o.available_shipping_service_options && - available_label_formats == o.available_label_formats && - available_format_options_for_label == o.available_format_options_for_label && - requires_additional_seller_inputs == o.requires_additional_seller_inputs && - benefits == o.benefits - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipping_service_name, carrier_name, shipping_service_id, shipping_service_offer_id, ship_date, earliest_estimated_delivery_date, latest_estimated_delivery_date, rate, shipping_service_options, available_shipping_service_options, available_label_formats, available_format_options_for_label, requires_additional_seller_inputs, benefits].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_identifier.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_identifier.rb deleted file mode 100644 index 0e62e67..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_identifier.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # An Amazon-defined shipping service identifier. - class ShippingServiceIdentifier - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_list.rb deleted file mode 100644 index eff926d..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of shipping services offers. - class ShippingServiceList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_options.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_options.rb deleted file mode 100644 index a9b1cf0..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/shipping_service_options.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Extra services provided by a carrier. - class ShippingServiceOptions - attr_accessor :delivery_experience - - attr_accessor :declared_value - - # When true, the carrier will pick up the package. Note: Scheduled carrier pickup is available only using Dynamex (US), DPD (UK), and Royal Mail (UK). - attr_accessor :carrier_will_pick_up - - attr_accessor :carrier_will_pick_up_option - - attr_accessor :label_format - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_experience' => :'DeliveryExperience', - :'declared_value' => :'DeclaredValue', - :'carrier_will_pick_up' => :'CarrierWillPickUp', - :'carrier_will_pick_up_option' => :'CarrierWillPickUpOption', - :'label_format' => :'LabelFormat' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_experience' => :'Object', - :'declared_value' => :'Object', - :'carrier_will_pick_up' => :'Object', - :'carrier_will_pick_up_option' => :'Object', - :'label_format' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::ShippingServiceOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_experience') - self.delivery_experience = attributes[:'delivery_experience'] - end - - if attributes.key?(:'declared_value') - self.declared_value = attributes[:'declared_value'] - end - - if attributes.key?(:'carrier_will_pick_up') - self.carrier_will_pick_up = attributes[:'carrier_will_pick_up'] - end - - if attributes.key?(:'carrier_will_pick_up_option') - self.carrier_will_pick_up_option = attributes[:'carrier_will_pick_up_option'] - end - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @delivery_experience.nil? - invalid_properties.push('invalid value for "delivery_experience", delivery_experience cannot be nil.') - end - - if @carrier_will_pick_up.nil? - invalid_properties.push('invalid value for "carrier_will_pick_up", carrier_will_pick_up cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @delivery_experience.nil? - return false if @carrier_will_pick_up.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_experience == o.delivery_experience && - declared_value == o.declared_value && - carrier_will_pick_up == o.carrier_will_pick_up && - carrier_will_pick_up_option == o.carrier_will_pick_up_option && - label_format == o.label_format - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_experience, declared_value, carrier_will_pick_up, carrier_will_pick_up_option, label_format].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/standard_id_for_label.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/standard_id_for_label.rb deleted file mode 100644 index 9e65b32..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/standard_id_for_label.rb +++ /dev/null @@ -1,29 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class StandardIdForLabel - AMAZON_ORDER_ID = 'AmazonOrderId'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = StandardIdForLabel.constants.select { |c| StandardIdForLabel::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #StandardIdForLabel" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/state_or_province_code.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/state_or_province_code.rb deleted file mode 100644 index 21b501a..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/state_or_province_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The state or province code. This is a required field in Canada, US, and UK marketplaces, and for shipments that originate in China. - class StateOrProvinceCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::StateOrProvinceCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::StateOrProvinceCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier.rb deleted file mode 100644 index 18a2957..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A carrier who is temporarily unavailable, most likely due to a service outage experienced by the carrier. - class TemporarilyUnavailableCarrier - # The name of the carrier. - attr_accessor :carrier_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carrier_name' => :'CarrierName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carrier_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TemporarilyUnavailableCarrier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TemporarilyUnavailableCarrier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carrier_name') - self.carrier_name = attributes[:'carrier_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carrier_name.nil? - invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carrier_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carrier_name == o.carrier_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carrier_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier_list.rb deleted file mode 100644 index d367cd2..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/temporarily_unavailable_carrier_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of temporarily unavailable carriers. - class TemporarilyUnavailableCarrierList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TemporarilyUnavailableCarrierList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TemporarilyUnavailableCarrierList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier.rb deleted file mode 100644 index 01701aa..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A carrier whose terms and conditions have not been accepted by the seller. - class TermsAndConditionsNotAcceptedCarrier - # The name of the carrier. - attr_accessor :carrier_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carrier_name' => :'CarrierName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carrier_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carrier_name') - self.carrier_name = attributes[:'carrier_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carrier_name.nil? - invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carrier_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carrier_name == o.carrier_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carrier_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier_list.rb deleted file mode 100644 index adb0a4f..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/terms_and_conditions_not_accepted_carrier_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # List of carriers whose terms and conditions were not accepted by the seller. - class TermsAndConditionsNotAcceptedCarrierList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrierList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TermsAndConditionsNotAcceptedCarrierList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/timestamp.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/timestamp.rb deleted file mode 100644 index 09806a3..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/timestamp.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # Date-time formatted timestamp. - class Timestamp - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Timestamp` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Timestamp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/tracking_id.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/tracking_id.rb deleted file mode 100644 index 873c0d1..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/tracking_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The shipment tracking identifier provided by the carrier. - class TrackingId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TrackingId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TrackingId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code.rb deleted file mode 100644 index 13e4394..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The transparency code associated with the item. Determine the transparency serial number with: **1D or 2D barcode:** This has a **T** logo. Submit either the 29-character alpha-numeric identifier beginning with **AZ** or **ZA**, or the 38-character Serialized Global Trade Item Number (SGTIN). **2D barcode SN:** Submit the 7- to 20-character serial number barcode, that likely has the prefix **SN**. The serial number is applied to the same side of the packaging as the GTIN (UPC/EAN/ISBN) barcode. **QR code SN:** Submit the URL that the QR code generates. - class TransparencyCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TransparencyCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TransparencyCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code_list.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code_list.rb deleted file mode 100644 index 8a107ff..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/transparency_code_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # A list of transparency codes. - class TransparencyCodeList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::TransparencyCodeList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::TransparencyCodeList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_length.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_length.rb deleted file mode 100644 index dee6d6f..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_length.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class UnitOfLength - INCHES = 'inches'.freeze - CENTIMETERS = 'centimeters'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = UnitOfLength.constants.select { |c| UnitOfLength::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #UnitOfLength" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_weight.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_weight.rb deleted file mode 100644 index de46950..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/unit_of_weight.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - class UnitOfWeight - OZ = 'oz'.freeze - G = 'g'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = UnitOfWeight.constants.select { |c| UnitOfWeight::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #UnitOfWeight" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight.rb deleted file mode 100644 index fddeb3f..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The weight. - class Weight - attr_accessor :value - - attr_accessor :unit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'Value', - :'unit' => :'Unit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::Weight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::Weight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @unit.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - unit == o.unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight_value.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight_value.rb deleted file mode 100644 index 3469c46..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/models/weight_value.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMerchantFulfillmentV0 - # The weight value. - class WeightValue - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMerchantFulfillmentV0::WeightValue` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMerchantFulfillmentV0::WeightValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMerchantFulfillmentV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/version.rb b/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/version.rb deleted file mode 100644 index fe177c4..0000000 --- a/vendor/merchant_fulfillment_v0/lib/sp_merchant_fulfillment_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpMerchantFulfillmentV0 - VERSION = '1.0.0' -end diff --git a/vendor/merchant_fulfillment_v0/sp_merchant_fulfillment_v0.gemspec b/vendor/merchant_fulfillment_v0/sp_merchant_fulfillment_v0.gemspec deleted file mode 100644 index 9dc45ac..0000000 --- a/vendor/merchant_fulfillment_v0/sp_merchant_fulfillment_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Merchant Fulfillment - -#With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_merchant_fulfillment_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_merchant_fulfillment_v0" - s.version = SpMerchantFulfillmentV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Merchant Fulfillment Ruby Gem" - s.description = "With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/messaging/.gitignore b/vendor/messaging/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/messaging/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/messaging/.rspec b/vendor/messaging/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/messaging/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/messaging/.rubocop.yml b/vendor/messaging/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/messaging/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/messaging/.swagger-codegen-ignore b/vendor/messaging/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/messaging/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/messaging/.swagger-codegen/VERSION b/vendor/messaging/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/messaging/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/messaging/Gemfile b/vendor/messaging/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/messaging/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/messaging/README.md b/vendor/messaging/README.md deleted file mode 100644 index e8973ec..0000000 --- a/vendor/messaging/README.md +++ /dev/null @@ -1,288 +0,0 @@ -# sp_messaging - -SpMessaging - the Ruby gem for the Selling Partner API for Messaging - -With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_messaging.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_messaging-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_messaging-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_messaging', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_messaging', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_messaging' - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateConfirmCustomizationDetailsRequest.new # CreateConfirmCustomizationDetailsRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.confirm_customization_details(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->confirm_customization_details: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateAmazonMotorsRequest.new # CreateAmazonMotorsRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_amazon_motors(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_amazon_motors: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateConfirmDeliveryDetailsRequest.new # CreateConfirmDeliveryDetailsRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_confirm_delivery_details(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_confirm_delivery_details: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateConfirmOrderDetailsRequest.new # CreateConfirmOrderDetailsRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_confirm_order_details(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_confirm_order_details: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateConfirmServiceDetailsRequest.new # CreateConfirmServiceDetailsRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_confirm_service_details(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_confirm_service_details: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateDigitalAccessKeyRequest.new # CreateDigitalAccessKeyRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_digital_access_key(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_digital_access_key: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateLegalDisclosureRequest.new # CreateLegalDisclosureRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_legal_disclosure(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_legal_disclosure: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_negative_feedback_removal(amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_negative_feedback_removal: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateUnexpectedProblemRequest.new # CreateUnexpectedProblemRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_unexpected_problem(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_unexpected_problem: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::CreateWarrantyRequest.new # CreateWarrantyRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.create_warranty(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->create_warranty: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.get_attributes(amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->get_attributes: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which you want a list of available message types. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.get_messaging_actions_for_order(amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->get_messaging_actions_for_order: #{e}" -end - -api_instance = SpMessaging::MessagingApi.new -body = SpMessaging::InvoiceRequest.new # InvoiceRequest | This contains the message body for a message. -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This identifies the order for which a message is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - - -begin - result = api_instance.send_invoice(body, amazon_order_id, marketplace_ids) - p result -rescue SpMessaging::ApiError => e - puts "Exception when calling MessagingApi->send_invoice: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpMessaging::MessagingApi* | [**confirm_customization_details**](docs/MessagingApi.md#confirm_customization_details) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/confirmCustomizationDetails | -*SpMessaging::MessagingApi* | [**create_amazon_motors**](docs/MessagingApi.md#create_amazon_motors) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/amazonMotors | -*SpMessaging::MessagingApi* | [**create_confirm_delivery_details**](docs/MessagingApi.md#create_confirm_delivery_details) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/confirmDeliveryDetails | -*SpMessaging::MessagingApi* | [**create_confirm_order_details**](docs/MessagingApi.md#create_confirm_order_details) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/confirmOrderDetails | -*SpMessaging::MessagingApi* | [**create_confirm_service_details**](docs/MessagingApi.md#create_confirm_service_details) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/confirmServiceDetails | -*SpMessaging::MessagingApi* | [**create_digital_access_key**](docs/MessagingApi.md#create_digital_access_key) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/digitalAccessKey | -*SpMessaging::MessagingApi* | [**create_legal_disclosure**](docs/MessagingApi.md#create_legal_disclosure) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure | -*SpMessaging::MessagingApi* | [**create_negative_feedback_removal**](docs/MessagingApi.md#create_negative_feedback_removal) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/negativeFeedbackRemoval | -*SpMessaging::MessagingApi* | [**create_unexpected_problem**](docs/MessagingApi.md#create_unexpected_problem) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/unexpectedProblem | -*SpMessaging::MessagingApi* | [**create_warranty**](docs/MessagingApi.md#create_warranty) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/warranty | -*SpMessaging::MessagingApi* | [**get_attributes**](docs/MessagingApi.md#get_attributes) | **GET** /messaging/v1/orders/{amazonOrderId}/attributes | -*SpMessaging::MessagingApi* | [**get_messaging_actions_for_order**](docs/MessagingApi.md#get_messaging_actions_for_order) | **GET** /messaging/v1/orders/{amazonOrderId} | -*SpMessaging::MessagingApi* | [**send_invoice**](docs/MessagingApi.md#send_invoice) | **POST** /messaging/v1/orders/{amazonOrderId}/messages/invoice | - -## Documentation for Models - - - [SpMessaging::Attachment](docs/Attachment.md) - - [SpMessaging::CreateAmazonMotorsRequest](docs/CreateAmazonMotorsRequest.md) - - [SpMessaging::CreateAmazonMotorsResponse](docs/CreateAmazonMotorsResponse.md) - - [SpMessaging::CreateConfirmCustomizationDetailsRequest](docs/CreateConfirmCustomizationDetailsRequest.md) - - [SpMessaging::CreateConfirmCustomizationDetailsResponse](docs/CreateConfirmCustomizationDetailsResponse.md) - - [SpMessaging::CreateConfirmDeliveryDetailsRequest](docs/CreateConfirmDeliveryDetailsRequest.md) - - [SpMessaging::CreateConfirmDeliveryDetailsResponse](docs/CreateConfirmDeliveryDetailsResponse.md) - - [SpMessaging::CreateConfirmOrderDetailsRequest](docs/CreateConfirmOrderDetailsRequest.md) - - [SpMessaging::CreateConfirmOrderDetailsResponse](docs/CreateConfirmOrderDetailsResponse.md) - - [SpMessaging::CreateConfirmServiceDetailsRequest](docs/CreateConfirmServiceDetailsRequest.md) - - [SpMessaging::CreateConfirmServiceDetailsResponse](docs/CreateConfirmServiceDetailsResponse.md) - - [SpMessaging::CreateDigitalAccessKeyRequest](docs/CreateDigitalAccessKeyRequest.md) - - [SpMessaging::CreateDigitalAccessKeyResponse](docs/CreateDigitalAccessKeyResponse.md) - - [SpMessaging::CreateLegalDisclosureRequest](docs/CreateLegalDisclosureRequest.md) - - [SpMessaging::CreateLegalDisclosureResponse](docs/CreateLegalDisclosureResponse.md) - - [SpMessaging::CreateNegativeFeedbackRemovalResponse](docs/CreateNegativeFeedbackRemovalResponse.md) - - [SpMessaging::CreateUnexpectedProblemRequest](docs/CreateUnexpectedProblemRequest.md) - - [SpMessaging::CreateUnexpectedProblemResponse](docs/CreateUnexpectedProblemResponse.md) - - [SpMessaging::CreateWarrantyRequest](docs/CreateWarrantyRequest.md) - - [SpMessaging::CreateWarrantyResponse](docs/CreateWarrantyResponse.md) - - [SpMessaging::Error](docs/Error.md) - - [SpMessaging::ErrorList](docs/ErrorList.md) - - [SpMessaging::GetAttributesResponse](docs/GetAttributesResponse.md) - - [SpMessaging::GetAttributesResponseBuyer](docs/GetAttributesResponseBuyer.md) - - [SpMessaging::GetMessagingActionResponse](docs/GetMessagingActionResponse.md) - - [SpMessaging::GetMessagingActionResponseEmbedded](docs/GetMessagingActionResponseEmbedded.md) - - [SpMessaging::GetMessagingActionResponseLinks](docs/GetMessagingActionResponseLinks.md) - - [SpMessaging::GetMessagingActionsForOrderResponse](docs/GetMessagingActionsForOrderResponse.md) - - [SpMessaging::GetMessagingActionsForOrderResponseEmbedded](docs/GetMessagingActionsForOrderResponseEmbedded.md) - - [SpMessaging::GetMessagingActionsForOrderResponseLinks](docs/GetMessagingActionsForOrderResponseLinks.md) - - [SpMessaging::GetSchemaResponse](docs/GetSchemaResponse.md) - - [SpMessaging::GetSchemaResponseLinks](docs/GetSchemaResponseLinks.md) - - [SpMessaging::InvoiceRequest](docs/InvoiceRequest.md) - - [SpMessaging::InvoiceResponse](docs/InvoiceResponse.md) - - [SpMessaging::LinkObject](docs/LinkObject.md) - - [SpMessaging::MessagingAction](docs/MessagingAction.md) - - [SpMessaging::Schema](docs/Schema.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/messaging/Rakefile b/vendor/messaging/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/messaging/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/messaging/git_push.sh b/vendor/messaging/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/messaging/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/messaging/lib/sp_messaging.rb b/vendor/messaging/lib/sp_messaging.rb deleted file mode 100644 index 187c7c4..0000000 --- a/vendor/messaging/lib/sp_messaging.rb +++ /dev/null @@ -1,133 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_messaging/api_client' -# require 'sp_messaging/api_error' -# require 'sp_messaging/version' -# require 'sp_messaging/configuration' - -# Models -# -# -# require_relative './sp_messaging/models/attachment' -# -# -# require_relative './sp_messaging/models/create_amazon_motors_request' -# -# -# require_relative './sp_messaging/models/create_amazon_motors_response' -# -# -# require_relative './sp_messaging/models/create_confirm_customization_details_request' -# -# -# require_relative './sp_messaging/models/create_confirm_customization_details_response' -# -# -# require_relative './sp_messaging/models/create_confirm_delivery_details_request' -# -# -# require_relative './sp_messaging/models/create_confirm_delivery_details_response' -# -# -# require_relative './sp_messaging/models/create_confirm_order_details_request' -# -# -# require_relative './sp_messaging/models/create_confirm_order_details_response' -# -# -# require_relative './sp_messaging/models/create_confirm_service_details_request' -# -# -# require_relative './sp_messaging/models/create_confirm_service_details_response' -# -# -# require_relative './sp_messaging/models/create_digital_access_key_request' -# -# -# require_relative './sp_messaging/models/create_digital_access_key_response' -# -# -# require_relative './sp_messaging/models/create_legal_disclosure_request' -# -# -# require_relative './sp_messaging/models/create_legal_disclosure_response' -# -# -# require_relative './sp_messaging/models/create_negative_feedback_removal_response' -# -# -# require_relative './sp_messaging/models/create_unexpected_problem_request' -# -# -# require_relative './sp_messaging/models/create_unexpected_problem_response' -# -# -# require_relative './sp_messaging/models/create_warranty_request' -# -# -# require_relative './sp_messaging/models/create_warranty_response' -# -# -# require_relative './sp_messaging/models/error' -# -# -# require_relative './sp_messaging/models/error_list' -# -# -# require_relative './sp_messaging/models/get_attributes_response' -# -# -# require_relative './sp_messaging/models/get_attributes_response_buyer' -# -# -# require_relative './sp_messaging/models/get_messaging_action_response' -# -# -# require_relative './sp_messaging/models/get_messaging_action_response__embedded' -# -# -# require_relative './sp_messaging/models/get_messaging_action_response__links' -# -# -# require_relative './sp_messaging/models/get_messaging_actions_for_order_response' -# -# -# require_relative './sp_messaging/models/get_messaging_actions_for_order_response__embedded' -# -# -# require_relative './sp_messaging/models/get_messaging_actions_for_order_response__links' -# -# -# require_relative './sp_messaging/models/get_schema_response' -# -# -# require_relative './sp_messaging/models/get_schema_response__links' -# -# -# require_relative './sp_messaging/models/invoice_request' -# -# -# require_relative './sp_messaging/models/invoice_response' -# -# -# require_relative './sp_messaging/models/link_object' -# -# -# require_relative './sp_messaging/models/messaging_action' -# -# -# require_relative './sp_messaging/models/schema' -# - -# APIs -require_relative './sp_messaging/api/messaging_api' diff --git a/vendor/messaging/lib/sp_messaging/api/messaging_api.rb b/vendor/messaging/lib/sp_messaging/api/messaging_api.rb deleted file mode 100644 index 02572a1..0000000 --- a/vendor/messaging/lib/sp_messaging/api/messaging_api.rb +++ /dev/null @@ -1,895 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMessaging - class MessagingApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateConfirmCustomizationDetailsResponse] - def confirm_customization_details(body, marketplace_ids, amazon_order_id, opts = {}) - data = confirm_customization_details_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateConfirmCustomizationDetailsResponse)>] CreateConfirmCustomizationDetailsResponse data, response status code and response headers - def confirm_customization_details_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.confirm_customization_details ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.confirm_customization_details" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.confirm_customization_details" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.confirm_customization_details" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/confirmCustomizationDetails'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#confirm_customization_details\nData: #{data.inspect}" - end - return data - end - # Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateAmazonMotorsResponse] - def create_amazon_motors(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_amazon_motors_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateAmazonMotorsResponse)>] CreateAmazonMotorsResponse data, response status code and response headers - def create_amazon_motors_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_amazon_motors ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_amazon_motors" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_amazon_motors" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_amazon_motors" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/amazonMotors'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_amazon_motors\nData: #{data.inspect}" - end - return data - end - # Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateConfirmDeliveryDetailsResponse] - def create_confirm_delivery_details(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_confirm_delivery_details_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateConfirmDeliveryDetailsResponse)>] CreateConfirmDeliveryDetailsResponse data, response status code and response headers - def create_confirm_delivery_details_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_confirm_delivery_details ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_confirm_delivery_details" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_confirm_delivery_details" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_confirm_delivery_details" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/confirmDeliveryDetails'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_confirm_delivery_details\nData: #{data.inspect}" - end - return data - end - # Sends a message to ask a buyer an order-related question prior to shipping their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateConfirmOrderDetailsResponse] - def create_confirm_order_details(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_confirm_order_details_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message to ask a buyer an order-related question prior to shipping their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateConfirmOrderDetailsResponse)>] CreateConfirmOrderDetailsResponse data, response status code and response headers - def create_confirm_order_details_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_confirm_order_details ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_confirm_order_details" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_confirm_order_details" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_confirm_order_details" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/confirmOrderDetails'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_confirm_order_details\nData: #{data.inspect}" - end - return data - end - # Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateConfirmServiceDetailsResponse] - def create_confirm_service_details(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_confirm_service_details_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateConfirmServiceDetailsResponse)>] CreateConfirmServiceDetailsResponse data, response status code and response headers - def create_confirm_service_details_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_confirm_service_details ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_confirm_service_details" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_confirm_service_details" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_confirm_service_details" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/confirmServiceDetails'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_confirm_service_details\nData: #{data.inspect}" - end - return data - end - # Sends a buyer a message to share a digital access key that is required to utilize digital content in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateDigitalAccessKeyResponse] - def create_digital_access_key(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_digital_access_key_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a buyer a message to share a digital access key that is required to utilize digital content in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateDigitalAccessKeyResponse)>] CreateDigitalAccessKeyResponse data, response status code and response headers - def create_digital_access_key_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_digital_access_key ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_digital_access_key" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_digital_access_key" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_digital_access_key" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/digitalAccessKey'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_digital_access_key\nData: #{data.inspect}" - end - return data - end - # Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer. This message should only be used to deliver documents that are required by law. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateLegalDisclosureResponse] - def create_legal_disclosure(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_legal_disclosure_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer. This message should only be used to deliver documents that are required by law. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateLegalDisclosureResponse)>] CreateLegalDisclosureResponse data, response status code and response headers - def create_legal_disclosure_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_legal_disclosure ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_legal_disclosure" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_legal_disclosure" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_legal_disclosure" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_legal_disclosure\nData: #{data.inspect}" - end - return data - end - # Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be sent after the seller has resolved the buyer's problem. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [CreateNegativeFeedbackRemovalResponse] - def create_negative_feedback_removal(amazon_order_id, marketplace_ids, opts = {}) - data = create_negative_feedback_removal_with_http_info(amazon_order_id, marketplace_ids, opts) - return data - end - - # Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be sent after the seller has resolved the buyer's problem. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateNegativeFeedbackRemovalResponse)>] CreateNegativeFeedbackRemovalResponse data, response status code and response headers - def create_negative_feedback_removal_with_http_info(amazon_order_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_negative_feedback_removal ...' - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_negative_feedback_removal" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_negative_feedback_removal" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/negativeFeedbackRemoval'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_negative_feedback_removal\nData: #{data.inspect}" - end - return data - end - # Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateUnexpectedProblemResponse] - def create_unexpected_problem(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_unexpected_problem_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateUnexpectedProblemResponse)>] CreateUnexpectedProblemResponse data, response status code and response headers - def create_unexpected_problem_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_unexpected_problem ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_unexpected_problem" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_unexpected_problem" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_unexpected_problem" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/unexpectedProblem'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_unexpected_problem\nData: #{data.inspect}" - end - return data - end - # Sends a message to a buyer to provide details about warranty information on a purchase in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [CreateWarrantyResponse] - def create_warranty(body, marketplace_ids, amazon_order_id, opts = {}) - data = create_warranty_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message to a buyer to provide details about warranty information on a purchase in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateWarrantyResponse)>] CreateWarrantyResponse data, response status code and response headers - def create_warranty_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.create_warranty ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.create_warranty" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.create_warranty" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.create_warranty" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/warranty'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#create_warranty\nData: #{data.inspect}" - end - return data - end - # Returns a response containing attributes related to an order. This includes buyer preferences. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [GetAttributesResponse] - def get_attributes(amazon_order_id, marketplace_ids, opts = {}) - data = get_attributes_with_http_info(amazon_order_id, marketplace_ids, opts) - return data - end - - # Returns a response containing attributes related to an order. This includes buyer preferences. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [Array<(GetAttributesResponse)>] GetAttributesResponse data, response status code and response headers - def get_attributes_with_http_info(amazon_order_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.get_attributes ...' - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.get_attributes" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.get_attributes" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/attributes'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#get_attributes\nData: #{data.inspect}" - end - return data - end - # Returns a list of message types that are available for an order that you specify. A message type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a message. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which you want a list of available message types. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [GetMessagingActionsForOrderResponse] - def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, opts = {}) - data = get_messaging_actions_for_order_with_http_info(amazon_order_id, marketplace_ids, opts) - return data - end - - # Returns a list of message types that are available for an order that you specify. A message type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a message. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which you want a list of available message types. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param [Hash] opts the optional parameters - # @return [Array<(GetMessagingActionsForOrderResponse)>] GetMessagingActionsForOrderResponse data, response status code and response headers - def get_messaging_actions_for_order_with_http_info(amazon_order_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.get_messaging_actions_for_order ...' - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.get_messaging_actions_for_order" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.get_messaging_actions_for_order" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#get_messaging_actions_for_order\nData: #{data.inspect}" - end - return data - end - # Sends a message providing the buyer an invoice - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [InvoiceResponse] - def send_invoice(body, marketplace_ids, amazon_order_id, opts = {}) - data = send_invoice_with_http_info(body, marketplace_ids, amazon_order_id, opts) - return data - end - - # Sends a message providing the buyer an invoice - # @param body This contains the message body for a message. - # @param marketplace_ids A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. - # @param amazon_order_id An Amazon order identifier. This identifies the order for which a message is sent. - # @param [Hash] opts the optional parameters - # @return [Array<(InvoiceResponse)>] InvoiceResponse data, response status code and response headers - def send_invoice_with_http_info(body, marketplace_ids, amazon_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: MessagingApi.send_invoice ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling MessagingApi.send_invoice" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling MessagingApi.send_invoice" - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling MessagingApi.send_invoice" - end - # resource path - local_var_path = '/messaging/v1/orders/{amazonOrderId}/messages/invoice'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: MessagingApi#send_invoice\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/messaging/lib/sp_messaging/api_client.rb b/vendor/messaging/lib/sp_messaging/api_client.rb deleted file mode 100644 index 0b02b60..0000000 --- a/vendor/messaging/lib/sp_messaging/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpMessaging - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpMessaging.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/messaging/lib/sp_messaging/api_error.rb b/vendor/messaging/lib/sp_messaging/api_error.rb deleted file mode 100644 index 6127072..0000000 --- a/vendor/messaging/lib/sp_messaging/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMessaging - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/messaging/lib/sp_messaging/configuration.rb b/vendor/messaging/lib/sp_messaging/configuration.rb deleted file mode 100644 index 8484fa8..0000000 --- a/vendor/messaging/lib/sp_messaging/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpMessaging - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/attachment.rb b/vendor/messaging/lib/sp_messaging/models/attachment.rb deleted file mode 100644 index 7cbba21..0000000 --- a/vendor/messaging/lib/sp_messaging/models/attachment.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # Represents a file that was uploaded to a destination that was created by the Uploads API [`createUploadDestinationForResource`](https://developer-docs.amazon.com/sp-api/docs/uploads-api-reference#post-uploads2020-11-01uploaddestinationsresource) operation. - class Attachment - # The identifier for the upload destination. To retrieve this value, call the Uploads API [`createUploadDestinationForResource`](https://developer-docs.amazon.com/sp-api/docs/uploads-api-reference#post-uploads2020-11-01uploaddestinationsresource) operation. - attr_accessor :upload_destination_id - - # The name of the file, including the extension. This is the file name that will appear in the message. This does not need to match the file name of the file that you uploaded. - attr_accessor :file_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'upload_destination_id' => :'uploadDestinationId', - :'file_name' => :'fileName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'upload_destination_id' => :'Object', - :'file_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::Attachment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::Attachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'upload_destination_id') - self.upload_destination_id = attributes[:'upload_destination_id'] - end - - if attributes.key?(:'file_name') - self.file_name = attributes[:'file_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @upload_destination_id.nil? - invalid_properties.push('invalid value for "upload_destination_id", upload_destination_id cannot be nil.') - end - - if @file_name.nil? - invalid_properties.push('invalid value for "file_name", file_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @upload_destination_id.nil? - return false if @file_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - upload_destination_id == o.upload_destination_id && - file_name == o.file_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [upload_destination_id, file_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_request.rb b/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_request.rb deleted file mode 100644 index 821c6e7..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createAmazonMotors operation. - class CreateAmazonMotorsRequest - # Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachments' => :'attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateAmazonMotorsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateAmazonMotorsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_response.rb b/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_response.rb deleted file mode 100644 index e46537d..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_amazon_motors_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createAmazonMotors operation. - class CreateAmazonMotorsResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateAmazonMotorsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateAmazonMotorsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_request.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_request.rb deleted file mode 100644 index c06d1b3..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the confirmCustomizationDetails operation. - class CreateConfirmCustomizationDetailsRequest - # The text to be sent to the buyer. Only links related to customization details are allowed. Do not include HTML or email addresses. The text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :text - - # Attachments to include in the message to the buyer. - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text', - :'attachments' => :'attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object', - :'attachments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmCustomizationDetailsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmCustomizationDetailsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_response.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_response.rb deleted file mode 100644 index d3293eb..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_customization_details_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the confirmCustomizationDetails operation. - class CreateConfirmCustomizationDetailsResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmCustomizationDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmCustomizationDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_request.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_request.rb deleted file mode 100644 index 9fdc6f4..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_request.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createConfirmDeliveryDetails operation. - class CreateConfirmDeliveryDetailsRequest - # The text to be sent to the buyer. Only links related to order delivery are allowed. Do not include HTML or email addresses. The text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :text - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmDeliveryDetailsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmDeliveryDetailsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_response.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_response.rb deleted file mode 100644 index a041681..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_delivery_details_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createConfirmDeliveryDetails operation. - class CreateConfirmDeliveryDetailsResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmDeliveryDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmDeliveryDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_request.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_request.rb deleted file mode 100644 index 3bd96ef..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_request.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createConfirmOrderDetails operation. - class CreateConfirmOrderDetailsRequest - # The text to be sent to the buyer. Only links related to order completion are allowed. Do not include HTML or email addresses. The text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :text - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmOrderDetailsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmOrderDetailsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_response.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_response.rb deleted file mode 100644 index 1f8100e..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_order_details_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createConfirmOrderDetails operation. - class CreateConfirmOrderDetailsResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmOrderDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmOrderDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_request.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_request.rb deleted file mode 100644 index 1657b7f..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_request.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createConfirmServiceDetails operation. - class CreateConfirmServiceDetailsRequest - # The text to be sent to the buyer. Only links related to Home Service calls are allowed. Do not include HTML or email addresses. The text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :text - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmServiceDetailsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmServiceDetailsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_response.rb b/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_response.rb deleted file mode 100644 index 13947cf..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_confirm_service_details_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createConfirmServiceDetails operation. - class CreateConfirmServiceDetailsResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateConfirmServiceDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateConfirmServiceDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_request.rb b/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_request.rb deleted file mode 100644 index 69cf519..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the `createDigitalAccessKey` operation. - class CreateDigitalAccessKeyRequest - # The text that is sent to the buyer. Only links that are related to the digital access key are allowed. Do not include HTML or email addresses. The text must be written in the buyer's preferred language, which you can retrieve from the `GetAttributes` operation. - attr_accessor :text - - # Attachments that you want to include in the message to the buyer. - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text', - :'attachments' => :'attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object', - :'attachments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateDigitalAccessKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateDigitalAccessKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_response.rb b/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_response.rb deleted file mode 100644 index 6b3564a..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_digital_access_key_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the `createDigitalAccessKey` operation. - class CreateDigitalAccessKeyResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateDigitalAccessKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateDigitalAccessKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_request.rb b/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_request.rb deleted file mode 100644 index 25ee41a..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createLegalDisclosure operation. - class CreateLegalDisclosureRequest - # Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachments' => :'attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateLegalDisclosureRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateLegalDisclosureRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_response.rb b/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_response.rb deleted file mode 100644 index ac82009..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_legal_disclosure_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createLegalDisclosure operation. - class CreateLegalDisclosureResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateLegalDisclosureResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateLegalDisclosureResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_negative_feedback_removal_response.rb b/vendor/messaging/lib/sp_messaging/models/create_negative_feedback_removal_response.rb deleted file mode 100644 index 5ed06d9..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_negative_feedback_removal_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createNegativeFeedbackRemoval operation. - class CreateNegativeFeedbackRemovalResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateNegativeFeedbackRemovalResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateNegativeFeedbackRemovalResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_request.rb b/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_request.rb deleted file mode 100644 index 7168b76..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_request.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createUnexpectedProblem operation. - class CreateUnexpectedProblemRequest - # The text to be sent to the buyer. Only links related to unexpected problem calls are allowed. Do not include HTML or email addresses. The text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :text - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateUnexpectedProblemRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateUnexpectedProblemRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_response.rb b/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_response.rb deleted file mode 100644 index a24d58b..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_unexpected_problem_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createUnexpectedProblem operation. - class CreateUnexpectedProblemResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateUnexpectedProblemResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateUnexpectedProblemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_warranty_request.rb b/vendor/messaging/lib/sp_messaging/models/create_warranty_request.rb deleted file mode 100644 index 98614cd..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_warranty_request.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the createWarranty operation. - class CreateWarrantyRequest - # Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation. - attr_accessor :attachments - - # The start date of the warranty coverage to include in the message to the buyer. - attr_accessor :coverage_start_date - - # The end date of the warranty coverage to include in the message to the buyer. - attr_accessor :coverage_end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachments' => :'attachments', - :'coverage_start_date' => :'coverageStartDate', - :'coverage_end_date' => :'coverageEndDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachments' => :'Object', - :'coverage_start_date' => :'Object', - :'coverage_end_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateWarrantyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateWarrantyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - - if attributes.key?(:'coverage_start_date') - self.coverage_start_date = attributes[:'coverage_start_date'] - end - - if attributes.key?(:'coverage_end_date') - self.coverage_end_date = attributes[:'coverage_end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachments == o.attachments && - coverage_start_date == o.coverage_start_date && - coverage_end_date == o.coverage_end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachments, coverage_start_date, coverage_end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/create_warranty_response.rb b/vendor/messaging/lib/sp_messaging/models/create_warranty_response.rb deleted file mode 100644 index 4cd1729..0000000 --- a/vendor/messaging/lib/sp_messaging/models/create_warranty_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the createWarranty operation. - class CreateWarrantyResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::CreateWarrantyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::CreateWarrantyResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/error.rb b/vendor/messaging/lib/sp_messaging/models/error.rb deleted file mode 100644 index 41ef966..0000000 --- a/vendor/messaging/lib/sp_messaging/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/error_list.rb b/vendor/messaging/lib/sp_messaging/models/error_list.rb deleted file mode 100644 index 08b4c71..0000000 --- a/vendor/messaging/lib/sp_messaging/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_attributes_response.rb b/vendor/messaging/lib/sp_messaging/models/get_attributes_response.rb deleted file mode 100644 index 8b4c18b..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_attributes_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the GetAttributes operation. - class GetAttributesResponse - attr_accessor :buyer - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer' => :'buyer', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetAttributesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetAttributesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer') - self.buyer = attributes[:'buyer'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer == o.buyer && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_attributes_response_buyer.rb b/vendor/messaging/lib/sp_messaging/models/get_attributes_response_buyer.rb deleted file mode 100644 index 4260cb4..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_attributes_response_buyer.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The list of attributes related to the buyer. - class GetAttributesResponseBuyer - # The buyer's language of preference, indicated with a locale-specific language tag. Examples: \"en-US\", \"zh-CN\", and \"en-GB\". - attr_accessor :locale - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'locale' => :'locale' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'locale' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetAttributesResponseBuyer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetAttributesResponseBuyer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'locale') - self.locale = attributes[:'locale'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - locale == o.locale - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [locale].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response.rb deleted file mode 100644 index 63a00c2..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # Describes a messaging action that can be taken for an order. Provides a JSON Hypertext Application Language (HAL) link to the JSON schema document that describes the expected input. - class GetMessagingActionResponse - attr_accessor :_links - - attr_accessor :_embedded - - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'_embedded' => :'_embedded', - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'_embedded' => :'Object', - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'_embedded') - self._embedded = attributes[:'_embedded'] - end - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - _embedded == o._embedded && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, _embedded, payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__embedded.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__embedded.rb deleted file mode 100644 index 1df54c6..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__embedded.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The embedded response associated with the messaging action. - class GetMessagingActionResponseEmbedded - attr_accessor :schema - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'schema' => :'schema' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'schema' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionResponseEmbedded` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionResponseEmbedded`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'schema') - self.schema = attributes[:'schema'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - schema == o.schema - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [schema].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__links.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__links.rb deleted file mode 100644 index e003ce8..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_action_response__links.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The links response that is associated with the messaging action. - class GetMessagingActionResponseLinks - attr_accessor :_self - - attr_accessor :schema - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self', - :'schema' => :'schema' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object', - :'schema' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - - if attributes.key?(:'schema') - self.schema = attributes[:'schema'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - if @schema.nil? - invalid_properties.push('invalid value for "schema", schema cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - return false if @schema.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self && - schema == o.schema - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self, schema].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response.rb deleted file mode 100644 index 9b62133..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the `getMessagingActionsForOrder` operation. - class GetMessagingActionsForOrderResponse - attr_accessor :_links - - attr_accessor :_embedded - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'_embedded' => :'_embedded', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'_embedded' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'_embedded') - self._embedded = attributes[:'_embedded'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - _embedded == o._embedded && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, _embedded, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__embedded.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__embedded.rb deleted file mode 100644 index 8c4f150..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__embedded.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The messaging actions response that is associated with the specified `amazonOrderId`. - class GetMessagingActionsForOrderResponseEmbedded - attr_accessor :actions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'actions' => :'actions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'actions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponseEmbedded` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponseEmbedded`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'actions') - if (value = attributes[:'actions']).is_a?(Array) - self.actions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @actions.nil? - invalid_properties.push('invalid value for "actions", actions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @actions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - actions == o.actions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [actions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__links.rb b/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__links.rb deleted file mode 100644 index 82eb217..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_messaging_actions_for_order_response__links.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The links response that is associated with the specified `amazonOrderId`. - class GetMessagingActionsForOrderResponseLinks - attr_accessor :_self - - # Eligible actions for the specified amazonOrderId. - attr_accessor :actions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self', - :'actions' => :'actions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object', - :'actions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetMessagingActionsForOrderResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - - if attributes.key?(:'actions') - if (value = attributes[:'actions']).is_a?(Array) - self.actions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - if @actions.nil? - invalid_properties.push('invalid value for "actions", actions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - return false if @actions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self && - actions == o.actions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self, actions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_schema_response.rb b/vendor/messaging/lib/sp_messaging/models/get_schema_response.rb deleted file mode 100644 index c75e86f..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_schema_response.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The `GET` request schema response. - class GetSchemaResponse - attr_accessor :_links - - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetSchemaResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetSchemaResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/get_schema_response__links.rb b/vendor/messaging/lib/sp_messaging/models/get_schema_response__links.rb deleted file mode 100644 index 2912ae8..0000000 --- a/vendor/messaging/lib/sp_messaging/models/get_schema_response__links.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The links response that is associated with the object. - class GetSchemaResponseLinks - attr_accessor :_self - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::GetSchemaResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::GetSchemaResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/invoice_request.rb b/vendor/messaging/lib/sp_messaging/models/invoice_request.rb deleted file mode 100644 index 9469645..0000000 --- a/vendor/messaging/lib/sp_messaging/models/invoice_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The request schema for the `sendInvoice` operation. - class InvoiceRequest - # Attachments to include in the message to the buyer. - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachments' => :'attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::InvoiceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::InvoiceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/invoice_response.rb b/vendor/messaging/lib/sp_messaging/models/invoice_response.rb deleted file mode 100644 index a0bcb57..0000000 --- a/vendor/messaging/lib/sp_messaging/models/invoice_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # The response schema for the sendInvoice operation. - class InvoiceResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::InvoiceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::InvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/link_object.rb b/vendor/messaging/lib/sp_messaging/models/link_object.rb deleted file mode 100644 index 4345044..0000000 --- a/vendor/messaging/lib/sp_messaging/models/link_object.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # A Link object. - class LinkObject - # A URI for this object. - attr_accessor :href - - # An identifier for this object. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'href' => :'href', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'href' => :'Object', - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::LinkObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::LinkObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'href') - self.href = attributes[:'href'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @href.nil? - invalid_properties.push('invalid value for "href", href cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @href.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - href == o.href && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [href, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/messaging_action.rb b/vendor/messaging/lib/sp_messaging/models/messaging_action.rb deleted file mode 100644 index 0feaf1b..0000000 --- a/vendor/messaging/lib/sp_messaging/models/messaging_action.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # A simple object containing the name of the template. - class MessagingAction - # The name of the template. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::MessagingAction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::MessagingAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/models/schema.rb b/vendor/messaging/lib/sp_messaging/models/schema.rb deleted file mode 100644 index de64db2..0000000 --- a/vendor/messaging/lib/sp_messaging/models/schema.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpMessaging - # A JSON schema document describing the expected payload of the action. This object can be validated against http://json-schema.org/draft-04/schema. - class Schema - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpMessaging::Schema` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpMessaging::Schema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpMessaging.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/messaging/lib/sp_messaging/version.rb b/vendor/messaging/lib/sp_messaging/version.rb deleted file mode 100644 index e6158af..0000000 --- a/vendor/messaging/lib/sp_messaging/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpMessaging - VERSION = '1.0.0' -end diff --git a/vendor/messaging/sp_messaging.gemspec b/vendor/messaging/sp_messaging.gemspec deleted file mode 100644 index 7968770..0000000 --- a/vendor/messaging/sp_messaging.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Messaging - -#With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_messaging/version" - -Gem::Specification.new do |s| - s.name = "sp_messaging" - s.version = SpMessaging::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Messaging Ruby Gem" - s.description = "With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/notifications/.gitignore b/vendor/notifications/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/notifications/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/notifications/.rspec b/vendor/notifications/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/notifications/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/notifications/.rubocop.yml b/vendor/notifications/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/notifications/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/notifications/.swagger-codegen-ignore b/vendor/notifications/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/notifications/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/notifications/.swagger-codegen/VERSION b/vendor/notifications/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/notifications/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/notifications/Gemfile b/vendor/notifications/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/notifications/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/notifications/README.md b/vendor/notifications/README.md deleted file mode 100644 index 01236cb..0000000 --- a/vendor/notifications/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# sp_notifications - -SpNotifications - the Ruby gem for the Selling Partner API for Notifications - -The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_notifications.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_notifications-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_notifications-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_notifications', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_notifications', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_notifications' - -api_instance = SpNotifications::NotificationsApi.new -body = SpNotifications::CreateDestinationRequest.new # CreateDestinationRequest | - - -begin - result = api_instance.create_destination(body) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->create_destination: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -body = SpNotifications::CreateSubscriptionRequest.new # CreateSubscriptionRequest | -notification_type = 'notification_type_example' # String | The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - - -begin - result = api_instance.create_subscription(body, notification_type) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->create_subscription: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -destination_id = 'destination_id_example' # String | The identifier for the destination that you want to delete. - - -begin - result = api_instance.delete_destination(destination_id) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->delete_destination: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -subscription_id = 'subscription_id_example' # String | The identifier for the subscription that you want to delete. -notification_type = 'notification_type_example' # String | The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - - -begin - result = api_instance.delete_subscription_by_id(subscription_id, notification_type) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->delete_subscription_by_id: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -destination_id = 'destination_id_example' # String | The identifier generated when you created the destination. - - -begin - result = api_instance.get_destination(destination_id) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->get_destination: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new - -begin - result = api_instance.get_destinations - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->get_destinations: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -notification_type = 'notification_type_example' # String | The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). -opts = { - payload_version: 'payload_version_example' # String | The version of the payload object to be used in the notification. -} - -begin - result = api_instance.get_subscription(notification_type, opts) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->get_subscription: #{e}" -end - -api_instance = SpNotifications::NotificationsApi.new -subscription_id = 'subscription_id_example' # String | The identifier for the subscription that you want to get. -notification_type = 'notification_type_example' # String | The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - - -begin - result = api_instance.get_subscription_by_id(subscription_id, notification_type) - p result -rescue SpNotifications::ApiError => e - puts "Exception when calling NotificationsApi->get_subscription_by_id: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpNotifications::NotificationsApi* | [**create_destination**](docs/NotificationsApi.md#create_destination) | **POST** /notifications/v1/destinations | -*SpNotifications::NotificationsApi* | [**create_subscription**](docs/NotificationsApi.md#create_subscription) | **POST** /notifications/v1/subscriptions/{notificationType} | -*SpNotifications::NotificationsApi* | [**delete_destination**](docs/NotificationsApi.md#delete_destination) | **DELETE** /notifications/v1/destinations/{destinationId} | -*SpNotifications::NotificationsApi* | [**delete_subscription_by_id**](docs/NotificationsApi.md#delete_subscription_by_id) | **DELETE** /notifications/v1/subscriptions/{notificationType}/{subscriptionId} | -*SpNotifications::NotificationsApi* | [**get_destination**](docs/NotificationsApi.md#get_destination) | **GET** /notifications/v1/destinations/{destinationId} | -*SpNotifications::NotificationsApi* | [**get_destinations**](docs/NotificationsApi.md#get_destinations) | **GET** /notifications/v1/destinations | -*SpNotifications::NotificationsApi* | [**get_subscription**](docs/NotificationsApi.md#get_subscription) | **GET** /notifications/v1/subscriptions/{notificationType} | -*SpNotifications::NotificationsApi* | [**get_subscription_by_id**](docs/NotificationsApi.md#get_subscription_by_id) | **GET** /notifications/v1/subscriptions/{notificationType}/{subscriptionId} | - -## Documentation for Models - - - [SpNotifications::AggregationFilter](docs/AggregationFilter.md) - - [SpNotifications::AggregationSettings](docs/AggregationSettings.md) - - [SpNotifications::AggregationTimePeriod](docs/AggregationTimePeriod.md) - - [SpNotifications::CreateDestinationRequest](docs/CreateDestinationRequest.md) - - [SpNotifications::CreateDestinationResponse](docs/CreateDestinationResponse.md) - - [SpNotifications::CreateSubscriptionRequest](docs/CreateSubscriptionRequest.md) - - [SpNotifications::CreateSubscriptionResponse](docs/CreateSubscriptionResponse.md) - - [SpNotifications::DeleteDestinationResponse](docs/DeleteDestinationResponse.md) - - [SpNotifications::DeleteSubscriptionByIdResponse](docs/DeleteSubscriptionByIdResponse.md) - - [SpNotifications::Destination](docs/Destination.md) - - [SpNotifications::DestinationList](docs/DestinationList.md) - - [SpNotifications::DestinationResource](docs/DestinationResource.md) - - [SpNotifications::DestinationResourceSpecification](docs/DestinationResourceSpecification.md) - - [SpNotifications::Error](docs/Error.md) - - [SpNotifications::ErrorList](docs/ErrorList.md) - - [SpNotifications::EventBridgeResource](docs/EventBridgeResource.md) - - [SpNotifications::EventBridgeResourceSpecification](docs/EventBridgeResourceSpecification.md) - - [SpNotifications::EventFilter](docs/EventFilter.md) - - [SpNotifications::GetDestinationResponse](docs/GetDestinationResponse.md) - - [SpNotifications::GetDestinationsResponse](docs/GetDestinationsResponse.md) - - [SpNotifications::GetSubscriptionByIdResponse](docs/GetSubscriptionByIdResponse.md) - - [SpNotifications::GetSubscriptionResponse](docs/GetSubscriptionResponse.md) - - [SpNotifications::MarketplaceFilter](docs/MarketplaceFilter.md) - - [SpNotifications::MarketplaceIds](docs/MarketplaceIds.md) - - [SpNotifications::OrderChangeTypeEnum](docs/OrderChangeTypeEnum.md) - - [SpNotifications::OrderChangeTypeFilter](docs/OrderChangeTypeFilter.md) - - [SpNotifications::OrderChangeTypes](docs/OrderChangeTypes.md) - - [SpNotifications::ProcessingDirective](docs/ProcessingDirective.md) - - [SpNotifications::SqsResource](docs/SqsResource.md) - - [SpNotifications::Subscription](docs/Subscription.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/notifications/Rakefile b/vendor/notifications/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/notifications/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/notifications/git_push.sh b/vendor/notifications/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/notifications/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/notifications/lib/sp_notifications.rb b/vendor/notifications/lib/sp_notifications.rb deleted file mode 100644 index fb0b829..0000000 --- a/vendor/notifications/lib/sp_notifications.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_notifications/api_client' -# require 'sp_notifications/api_error' -# require 'sp_notifications/version' -# require 'sp_notifications/configuration' - -# Models -# -# -# require_relative './sp_notifications/models/aggregation_filter' -# -# -# require_relative './sp_notifications/models/aggregation_settings' -# -# -# require_relative './sp_notifications/models/aggregation_time_period' -# -# -# require_relative './sp_notifications/models/create_destination_request' -# -# -# require_relative './sp_notifications/models/create_destination_response' -# -# -# require_relative './sp_notifications/models/create_subscription_request' -# -# -# require_relative './sp_notifications/models/create_subscription_response' -# -# -# require_relative './sp_notifications/models/delete_destination_response' -# -# -# require_relative './sp_notifications/models/delete_subscription_by_id_response' -# -# -# require_relative './sp_notifications/models/destination' -# -# -# require_relative './sp_notifications/models/destination_list' -# -# -# require_relative './sp_notifications/models/destination_resource' -# -# -# require_relative './sp_notifications/models/destination_resource_specification' -# -# -# require_relative './sp_notifications/models/error' -# -# -# require_relative './sp_notifications/models/error_list' -# -# -# require_relative './sp_notifications/models/event_bridge_resource' -# -# -# require_relative './sp_notifications/models/event_bridge_resource_specification' -# -# -# require_relative './sp_notifications/models/event_filter' -# -# -# require_relative './sp_notifications/models/get_destination_response' -# -# -# require_relative './sp_notifications/models/get_destinations_response' -# -# -# require_relative './sp_notifications/models/get_subscription_by_id_response' -# -# -# require_relative './sp_notifications/models/get_subscription_response' -# -# -# require_relative './sp_notifications/models/marketplace_filter' -# -# -# require_relative './sp_notifications/models/marketplace_ids' -# -# -# require_relative './sp_notifications/models/order_change_type_enum' -# -# -# require_relative './sp_notifications/models/order_change_type_filter' -# -# -# require_relative './sp_notifications/models/order_change_types' -# -# -# require_relative './sp_notifications/models/processing_directive' -# -# -# require_relative './sp_notifications/models/sqs_resource' -# -# -# require_relative './sp_notifications/models/subscription' -# - -# APIs -require_relative './sp_notifications/api/notifications_api' diff --git a/vendor/notifications/lib/sp_notifications/api/notifications_api.rb b/vendor/notifications/lib/sp_notifications/api/notifications_api.rb deleted file mode 100644 index 7f63196..0000000 --- a/vendor/notifications/lib/sp_notifications/api/notifications_api.rb +++ /dev/null @@ -1,473 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpNotifications - class NotificationsApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Creates a destination resource to receive notifications. The `createDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param [Hash] opts the optional parameters - # @return [CreateDestinationResponse] - def create_destination(body, opts = {}) - data = create_destination_with_http_info(body, opts) - return data - end - - # Creates a destination resource to receive notifications. The `createDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(CreateDestinationResponse)>] CreateDestinationResponse data, response status code and response headers - def create_destination_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.create_destination ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling NotificationsApi.create_destination" - end - # resource path - local_var_path = '/notifications/v1/destinations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#create_destination\nData: #{data.inspect}" - end - return data - end - # Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the `createDestination` operation. In cases where the specified notification type supports multiple payload versions, you can utilize this API to subscribe to a different payload version if you already have an existing subscription for a different payload version. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [CreateSubscriptionResponse] - def create_subscription(body, notification_type, opts = {}) - data = create_subscription_with_http_info(body, notification_type, opts) - return data - end - - # Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the `createDestination` operation. In cases where the specified notification type supports multiple payload versions, you can utilize this API to subscribe to a different payload version if you already have an existing subscription for a different payload version. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [Array<(CreateSubscriptionResponse)>] CreateSubscriptionResponse data, response status code and response headers - def create_subscription_with_http_info(body, notification_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.create_subscription ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling NotificationsApi.create_subscription" - end - # verify the required parameter 'notification_type' is set - if @api_client.config.client_side_validation && notification_type.nil? - fail ArgumentError, "Missing the required parameter 'notification_type' when calling NotificationsApi.create_subscription" - end - # resource path - local_var_path = '/notifications/v1/subscriptions/{notificationType}'.sub('{' + 'notificationType' + '}', notification_type.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#create_subscription\nData: #{data.inspect}" - end - return data - end - # Deletes the destination that you specify. The `deleteDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param destination_id The identifier for the destination that you want to delete. - # @param [Hash] opts the optional parameters - # @return [DeleteDestinationResponse] - def delete_destination(destination_id, opts = {}) - data = delete_destination_with_http_info(destination_id, opts) - return data - end - - # Deletes the destination that you specify. The `deleteDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param destination_id The identifier for the destination that you want to delete. - # @param [Hash] opts the optional parameters - # @return [Array<(DeleteDestinationResponse)>] DeleteDestinationResponse data, response status code and response headers - def delete_destination_with_http_info(destination_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.delete_destination ...' - end - # verify the required parameter 'destination_id' is set - if @api_client.config.client_side_validation && destination_id.nil? - fail ArgumentError, "Missing the required parameter 'destination_id' when calling NotificationsApi.delete_destination" - end - # resource path - local_var_path = '/notifications/v1/destinations/{destinationId}'.sub('{' + 'destinationId' + '}', destination_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#delete_destination\nData: #{data.inspect}" - end - return data - end - # Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The `deleteSubscriptionById` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param subscription_id The identifier for the subscription that you want to delete. - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [DeleteSubscriptionByIdResponse] - def delete_subscription_by_id(subscription_id, notification_type, opts = {}) - data = delete_subscription_by_id_with_http_info(subscription_id, notification_type, opts) - return data - end - - # Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The `deleteSubscriptionById` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param subscription_id The identifier for the subscription that you want to delete. - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [Array<(DeleteSubscriptionByIdResponse)>] DeleteSubscriptionByIdResponse data, response status code and response headers - def delete_subscription_by_id_with_http_info(subscription_id, notification_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.delete_subscription_by_id ...' - end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling NotificationsApi.delete_subscription_by_id" - end - # verify the required parameter 'notification_type' is set - if @api_client.config.client_side_validation && notification_type.nil? - fail ArgumentError, "Missing the required parameter 'notification_type' when calling NotificationsApi.delete_subscription_by_id" - end - # resource path - local_var_path = '/notifications/v1/subscriptions/{notificationType}/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'notificationType' + '}', notification_type.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Operation Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#delete_subscription_by_id\nData: #{data.inspect}" - end - return data - end - # Returns information about the destination that you specify. The `getDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param destination_id The identifier generated when you created the destination. - # @param [Hash] opts the optional parameters - # @return [GetDestinationResponse] - def get_destination(destination_id, opts = {}) - data = get_destination_with_http_info(destination_id, opts) - return data - end - - # Returns information about the destination that you specify. The `getDestination` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param destination_id The identifier generated when you created the destination. - # @param [Hash] opts the optional parameters - # @return [Array<(GetDestinationResponse)>] GetDestinationResponse data, response status code and response headers - def get_destination_with_http_info(destination_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.get_destination ...' - end - # verify the required parameter 'destination_id' is set - if @api_client.config.client_side_validation && destination_id.nil? - fail ArgumentError, "Missing the required parameter 'destination_id' when calling NotificationsApi.get_destination" - end - # resource path - local_var_path = '/notifications/v1/destinations/{destinationId}'.sub('{' + 'destinationId' + '}', destination_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#get_destination\nData: #{data.inspect}" - end - return data - end - # Returns information about all destinations. The `getDestinations` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [GetDestinationsResponse] - def get_destinations(opts = {}) - data = get_destinations_with_http_info(opts) - return data - end - - # Returns information about all destinations. The `getDestinations` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [Array<(GetDestinationsResponse)>] GetDestinationsResponse data, response status code and response headers - def get_destinations_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.get_destinations ...' - end - # resource path - local_var_path = '/notifications/v1/destinations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#get_destinations\nData: #{data.inspect}" - end - return data - end - # Returns information about subscription of the specified notification type and payload version. `payloadVersion` is an optional parameter. When `payloadVersion` is not provided, it will return latest payload version subscription's information. You can use this API to get subscription information when you do not have a subscription identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @option opts [String] :payload_version The version of the payload object to be used in the notification. - # @return [GetSubscriptionResponse] - def get_subscription(notification_type, opts = {}) - data = get_subscription_with_http_info(notification_type, opts) - return data - end - - # Returns information about subscription of the specified notification type and payload version. `payloadVersion` is an optional parameter. When `payloadVersion` is not provided, it will return latest payload version subscription's information. You can use this API to get subscription information when you do not have a subscription identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @option opts [String] :payload_version The version of the payload object to be used in the notification. - # @return [Array<(GetSubscriptionResponse)>] GetSubscriptionResponse data, response status code and response headers - def get_subscription_with_http_info(notification_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.get_subscription ...' - end - # verify the required parameter 'notification_type' is set - if @api_client.config.client_side_validation && notification_type.nil? - fail ArgumentError, "Missing the required parameter 'notification_type' when calling NotificationsApi.get_subscription" - end - # resource path - local_var_path = '/notifications/v1/subscriptions/{notificationType}'.sub('{' + 'notificationType' + '}', notification_type.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'payloadVersion'] = opts[:'payload_version'] if !opts[:'payload_version'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#get_subscription\nData: #{data.inspect}" - end - return data - end - # Returns information about a subscription for the specified notification type. The `getSubscriptionById` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param subscription_id The identifier for the subscription that you want to get. - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [GetSubscriptionByIdResponse] - def get_subscription_by_id(subscription_id, notification_type, opts = {}) - data = get_subscription_by_id_with_http_info(subscription_id, notification_type, opts) - return data - end - - # Returns information about a subscription for the specified notification type. The `getSubscriptionById` operation is grantless. For more information, refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param subscription_id The identifier for the subscription that you want to get. - # @param notification_type The type of notification. For more information about notification types, refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values). - # @param [Hash] opts the optional parameters - # @return [Array<(GetSubscriptionByIdResponse)>] GetSubscriptionByIdResponse data, response status code and response headers - def get_subscription_by_id_with_http_info(subscription_id, notification_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: NotificationsApi.get_subscription_by_id ...' - end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling NotificationsApi.get_subscription_by_id" - end - # verify the required parameter 'notification_type' is set - if @api_client.config.client_side_validation && notification_type.nil? - fail ArgumentError, "Missing the required parameter 'notification_type' when calling NotificationsApi.get_subscription_by_id" - end - # resource path - local_var_path = '/notifications/v1/subscriptions/{notificationType}/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'notificationType' + '}', notification_type.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'Successful Response']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: NotificationsApi#get_subscription_by_id\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/api_client.rb b/vendor/notifications/lib/sp_notifications/api_client.rb deleted file mode 100644 index 8c7f327..0000000 --- a/vendor/notifications/lib/sp_notifications/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpNotifications - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpNotifications.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/api_error.rb b/vendor/notifications/lib/sp_notifications/api_error.rb deleted file mode 100644 index e53ce04..0000000 --- a/vendor/notifications/lib/sp_notifications/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpNotifications - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/configuration.rb b/vendor/notifications/lib/sp_notifications/configuration.rb deleted file mode 100644 index bff7324..0000000 --- a/vendor/notifications/lib/sp_notifications/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpNotifications - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/aggregation_filter.rb b/vendor/notifications/lib/sp_notifications/models/aggregation_filter.rb deleted file mode 100644 index 5969fd6..0000000 --- a/vendor/notifications/lib/sp_notifications/models/aggregation_filter.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A filter used to select the aggregation time period at which to send notifications (for example: limit to one notification every five minutes for high frequency notifications). - class AggregationFilter - attr_accessor :aggregation_settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'aggregation_settings' => :'aggregationSettings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'aggregation_settings' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::AggregationFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::AggregationFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'aggregation_settings') - self.aggregation_settings = attributes[:'aggregation_settings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - aggregation_settings == o.aggregation_settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [aggregation_settings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/aggregation_settings.rb b/vendor/notifications/lib/sp_notifications/models/aggregation_settings.rb deleted file mode 100644 index 8d8a067..0000000 --- a/vendor/notifications/lib/sp_notifications/models/aggregation_settings.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A container that holds all of the necessary properties to configure the aggregation of notifications. - class AggregationSettings - attr_accessor :aggregation_time_period - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'aggregation_time_period' => :'aggregationTimePeriod' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'aggregation_time_period' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::AggregationSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::AggregationSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'aggregation_time_period') - self.aggregation_time_period = attributes[:'aggregation_time_period'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @aggregation_time_period.nil? - invalid_properties.push('invalid value for "aggregation_time_period", aggregation_time_period cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @aggregation_time_period.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - aggregation_time_period == o.aggregation_time_period - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [aggregation_time_period].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/aggregation_time_period.rb b/vendor/notifications/lib/sp_notifications/models/aggregation_time_period.rb deleted file mode 100644 index 751d470..0000000 --- a/vendor/notifications/lib/sp_notifications/models/aggregation_time_period.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - class AggregationTimePeriod - FIVE_MINUTES = 'FiveMinutes'.freeze - TEN_MINUTES = 'TenMinutes'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AggregationTimePeriod.constants.select { |c| AggregationTimePeriod::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AggregationTimePeriod" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/create_destination_request.rb b/vendor/notifications/lib/sp_notifications/models/create_destination_request.rb deleted file mode 100644 index 0b4abb1..0000000 --- a/vendor/notifications/lib/sp_notifications/models/create_destination_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The request schema for the `createDestination` operation. - class CreateDestinationRequest - attr_accessor :resource_specification - - # A developer-defined name to help identify this destination. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_specification' => :'resourceSpecification', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_specification' => :'Object', - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::CreateDestinationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::CreateDestinationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_specification') - self.resource_specification = attributes[:'resource_specification'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @resource_specification.nil? - invalid_properties.push('invalid value for "resource_specification", resource_specification cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @resource_specification.nil? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_specification == o.resource_specification && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_specification, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/create_destination_response.rb b/vendor/notifications/lib/sp_notifications/models/create_destination_response.rb deleted file mode 100644 index badfddb..0000000 --- a/vendor/notifications/lib/sp_notifications/models/create_destination_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the createDestination operation. - class CreateDestinationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::CreateDestinationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::CreateDestinationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/create_subscription_request.rb b/vendor/notifications/lib/sp_notifications/models/create_subscription_request.rb deleted file mode 100644 index f9029ff..0000000 --- a/vendor/notifications/lib/sp_notifications/models/create_subscription_request.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The request schema for the `createSubscription` operation. - class CreateSubscriptionRequest - # The version of the payload object to be used in the notification. - attr_accessor :payload_version - - # The identifier for the destination where notifications will be delivered. - attr_accessor :destination_id - - attr_accessor :processing_directive - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload_version' => :'payloadVersion', - :'destination_id' => :'destinationId', - :'processing_directive' => :'processingDirective' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload_version' => :'Object', - :'destination_id' => :'Object', - :'processing_directive' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::CreateSubscriptionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::CreateSubscriptionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload_version') - self.payload_version = attributes[:'payload_version'] - end - - if attributes.key?(:'destination_id') - self.destination_id = attributes[:'destination_id'] - end - - if attributes.key?(:'processing_directive') - self.processing_directive = attributes[:'processing_directive'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payload_version.nil? - invalid_properties.push('invalid value for "payload_version", payload_version cannot be nil.') - end - - if @destination_id.nil? - invalid_properties.push('invalid value for "destination_id", destination_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payload_version.nil? - return false if @destination_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload_version == o.payload_version && - destination_id == o.destination_id && - processing_directive == o.processing_directive - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload_version, destination_id, processing_directive].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/create_subscription_response.rb b/vendor/notifications/lib/sp_notifications/models/create_subscription_response.rb deleted file mode 100644 index 0bc3033..0000000 --- a/vendor/notifications/lib/sp_notifications/models/create_subscription_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `createSubscription` operation. - class CreateSubscriptionResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::CreateSubscriptionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::CreateSubscriptionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/delete_destination_response.rb b/vendor/notifications/lib/sp_notifications/models/delete_destination_response.rb deleted file mode 100644 index 3a79092..0000000 --- a/vendor/notifications/lib/sp_notifications/models/delete_destination_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `deleteDestination` operation. - class DeleteDestinationResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::DeleteDestinationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::DeleteDestinationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/delete_subscription_by_id_response.rb b/vendor/notifications/lib/sp_notifications/models/delete_subscription_by_id_response.rb deleted file mode 100644 index 9511111..0000000 --- a/vendor/notifications/lib/sp_notifications/models/delete_subscription_by_id_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `deleteSubscriptionById` operation. - class DeleteSubscriptionByIdResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::DeleteSubscriptionByIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::DeleteSubscriptionByIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/destination.rb b/vendor/notifications/lib/sp_notifications/models/destination.rb deleted file mode 100644 index cf4a3d0..0000000 --- a/vendor/notifications/lib/sp_notifications/models/destination.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # Information about the destination created when you call the `createDestination` operation. - class Destination - # The developer-defined name for this destination. - attr_accessor :name - - # The destination identifier generated when you created the destination. - attr_accessor :destination_id - - attr_accessor :resource - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'destination_id' => :'destinationId', - :'resource' => :'resource' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'destination_id' => :'Object', - :'resource' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::Destination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::Destination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'destination_id') - self.destination_id = attributes[:'destination_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @destination_id.nil? - invalid_properties.push('invalid value for "destination_id", destination_id cannot be nil.') - end - - if @resource.nil? - invalid_properties.push('invalid value for "resource", resource cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @destination_id.nil? - return false if @resource.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - destination_id == o.destination_id && - resource == o.resource - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, destination_id, resource].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/destination_list.rb b/vendor/notifications/lib/sp_notifications/models/destination_list.rb deleted file mode 100644 index c337a46..0000000 --- a/vendor/notifications/lib/sp_notifications/models/destination_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A list of destinations. - class DestinationList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::DestinationList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::DestinationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/destination_resource.rb b/vendor/notifications/lib/sp_notifications/models/destination_resource.rb deleted file mode 100644 index 42a6a17..0000000 --- a/vendor/notifications/lib/sp_notifications/models/destination_resource.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The destination resource types. - class DestinationResource - attr_accessor :sqs - - attr_accessor :event_bridge - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sqs' => :'sqs', - :'event_bridge' => :'eventBridge' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'sqs' => :'Object', - :'event_bridge' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::DestinationResource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::DestinationResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sqs') - self.sqs = attributes[:'sqs'] - end - - if attributes.key?(:'event_bridge') - self.event_bridge = attributes[:'event_bridge'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sqs == o.sqs && - event_bridge == o.event_bridge - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sqs, event_bridge].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/destination_resource_specification.rb b/vendor/notifications/lib/sp_notifications/models/destination_resource_specification.rb deleted file mode 100644 index a060bea..0000000 --- a/vendor/notifications/lib/sp_notifications/models/destination_resource_specification.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The information required to create a destination resource. Applications should use one resource type (sqs or eventBridge) per destination. - class DestinationResourceSpecification - attr_accessor :sqs - - attr_accessor :event_bridge - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sqs' => :'sqs', - :'event_bridge' => :'eventBridge' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'sqs' => :'Object', - :'event_bridge' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::DestinationResourceSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::DestinationResourceSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sqs') - self.sqs = attributes[:'sqs'] - end - - if attributes.key?(:'event_bridge') - self.event_bridge = attributes[:'event_bridge'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sqs == o.sqs && - event_bridge == o.event_bridge - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sqs, event_bridge].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/error.rb b/vendor/notifications/lib/sp_notifications/models/error.rb deleted file mode 100644 index bda1eef..0000000 --- a/vendor/notifications/lib/sp_notifications/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # An error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/error_list.rb b/vendor/notifications/lib/sp_notifications/models/error_list.rb deleted file mode 100644 index a84cb11..0000000 --- a/vendor/notifications/lib/sp_notifications/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/event_bridge_resource.rb b/vendor/notifications/lib/sp_notifications/models/event_bridge_resource.rb deleted file mode 100644 index ae65910..0000000 --- a/vendor/notifications/lib/sp_notifications/models/event_bridge_resource.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The Amazon EventBridge destination. - class EventBridgeResource - # The name of the partner event source associated with the destination. - attr_accessor :name - - # The AWS region in which you receive the notifications. For AWS regions that are supported in Amazon EventBridge, refer to [Amazon EventBridge endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/ev.html). - attr_accessor :region - - # The identifier for the AWS account that is responsible for charges related to receiving notifications. - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'region' => :'region', - :'account_id' => :'accountId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'region' => :'Object', - :'account_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::EventBridgeResource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::EventBridgeResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @region.nil? - invalid_properties.push('invalid value for "region", region cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @region.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - region == o.region && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, region, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/event_bridge_resource_specification.rb b/vendor/notifications/lib/sp_notifications/models/event_bridge_resource_specification.rb deleted file mode 100644 index 6153c48..0000000 --- a/vendor/notifications/lib/sp_notifications/models/event_bridge_resource_specification.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The information required to create an Amazon EventBridge destination. - class EventBridgeResourceSpecification - # The AWS region in which you will be receiving the notifications. - attr_accessor :region - - # The identifier for the AWS account that is responsible for charges related to receiving notifications. - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'region' => :'region', - :'account_id' => :'accountId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'region' => :'Object', - :'account_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::EventBridgeResourceSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::EventBridgeResourceSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @region.nil? - invalid_properties.push('invalid value for "region", region cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @region.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - region == o.region && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [region, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/event_filter.rb b/vendor/notifications/lib/sp_notifications/models/event_filter.rb deleted file mode 100644 index c276bc8..0000000 --- a/vendor/notifications/lib/sp_notifications/models/event_filter.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A `notificationType` specific filter. This object contains all of the currently available filters and properties that you can use to define a `notificationType` specific filter. - class EventFilter - attr_accessor :marketplace_ids - - attr_accessor :order_change_types - - # An `eventFilterType` value that is supported by the specific `notificationType`. This is used by the subscription service to determine the type of event filter. Refer to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values) to determine if an `eventFilterType` is supported. - attr_accessor :event_filter_type - - attr_accessor :aggregation_settings - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_ids' => :'marketplaceIds', - :'order_change_types' => :'orderChangeTypes', - :'event_filter_type' => :'eventFilterType', - :'aggregation_settings' => :'aggregationSettings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_ids' => :'', - :'order_change_types' => :'', - :'event_filter_type' => :'', - :'aggregation_settings' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::EventFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::EventFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'marketplace_ids') - self.marketplace_ids = attributes[:'marketplace_ids'] - end - - if attributes.key?(:'order_change_types') - self.order_change_types = attributes[:'order_change_types'] - end - - if attributes.key?(:'event_filter_type') - self.event_filter_type = attributes[:'event_filter_type'] - end - - if attributes.key?(:'aggregation_settings') - self.aggregation_settings = attributes[:'aggregation_settings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @event_filter_type.nil? - invalid_properties.push('invalid value for "event_filter_type", event_filter_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_filter_type.nil? - event_filter_type_validator = EnumAttributeValidator.new('', ['ANY_OFFER_CHANGED', 'ORDER_CHANGE']) - return false unless event_filter_type_validator.valid?(@event_filter_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] event_filter_type Object to be assigned - def event_filter_type=(event_filter_type) - validator = EnumAttributeValidator.new('', ['ANY_OFFER_CHANGED', 'ORDER_CHANGE']) - unless validator.valid?(event_filter_type) - fail ArgumentError, "invalid value for \"event_filter_type\", must be one of #{validator.allowable_values}." - end - @event_filter_type = event_filter_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_ids == o.marketplace_ids && - order_change_types == o.order_change_types && - event_filter_type == o.event_filter_type && - aggregation_settings == o.aggregation_settings && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_ids, order_change_types, event_filter_type, aggregation_settings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/get_destination_response.rb b/vendor/notifications/lib/sp_notifications/models/get_destination_response.rb deleted file mode 100644 index 0e52bf9..0000000 --- a/vendor/notifications/lib/sp_notifications/models/get_destination_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `getDestination` operation. - class GetDestinationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::GetDestinationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::GetDestinationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/get_destinations_response.rb b/vendor/notifications/lib/sp_notifications/models/get_destinations_response.rb deleted file mode 100644 index 037da66..0000000 --- a/vendor/notifications/lib/sp_notifications/models/get_destinations_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `getDestinations` operation. - class GetDestinationsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::GetDestinationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::GetDestinationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/get_subscription_by_id_response.rb b/vendor/notifications/lib/sp_notifications/models/get_subscription_by_id_response.rb deleted file mode 100644 index 5422e9c..0000000 --- a/vendor/notifications/lib/sp_notifications/models/get_subscription_by_id_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `getSubscriptionById` operation. - class GetSubscriptionByIdResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::GetSubscriptionByIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::GetSubscriptionByIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/get_subscription_response.rb b/vendor/notifications/lib/sp_notifications/models/get_subscription_response.rb deleted file mode 100644 index 101aec3..0000000 --- a/vendor/notifications/lib/sp_notifications/models/get_subscription_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The response schema for the `getSubscription` operation. - class GetSubscriptionResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::GetSubscriptionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::GetSubscriptionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/marketplace_filter.rb b/vendor/notifications/lib/sp_notifications/models/marketplace_filter.rb deleted file mode 100644 index e4f766d..0000000 --- a/vendor/notifications/lib/sp_notifications/models/marketplace_filter.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # An event filter to customize your subscription to send notifications for only the specified `marketplaceId`s. - class MarketplaceFilter - attr_accessor :marketplace_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_ids' => :'marketplaceIds' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_ids' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::MarketplaceFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::MarketplaceFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_ids') - self.marketplace_ids = attributes[:'marketplace_ids'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_ids == o.marketplace_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/marketplace_ids.rb b/vendor/notifications/lib/sp_notifications/models/marketplace_ids.rb deleted file mode 100644 index b09c1bb..0000000 --- a/vendor/notifications/lib/sp_notifications/models/marketplace_ids.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A list of marketplace identifiers to subscribe to (for example: ATVPDKIKX0DER). To receive notifications in every marketplace, do not provide this list. - class MarketplaceIds - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::MarketplaceIds` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::MarketplaceIds`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/order_change_type_enum.rb b/vendor/notifications/lib/sp_notifications/models/order_change_type_enum.rb deleted file mode 100644 index 396bddc..0000000 --- a/vendor/notifications/lib/sp_notifications/models/order_change_type_enum.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - class OrderChangeTypeEnum - ORDER_STATUS_CHANGE = 'OrderStatusChange'.freeze - BUYER_REQUESTED_CHANGE = 'BuyerRequestedChange'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = OrderChangeTypeEnum.constants.select { |c| OrderChangeTypeEnum::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OrderChangeTypeEnum" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/order_change_type_filter.rb b/vendor/notifications/lib/sp_notifications/models/order_change_type_filter.rb deleted file mode 100644 index 99cdc35..0000000 --- a/vendor/notifications/lib/sp_notifications/models/order_change_type_filter.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # An event filter to customize your subscription to send notifications for only the specified `orderChangeType`. - class OrderChangeTypeFilter - attr_accessor :order_change_types - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_change_types' => :'orderChangeTypes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_change_types' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::OrderChangeTypeFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::OrderChangeTypeFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_change_types') - self.order_change_types = attributes[:'order_change_types'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_change_types == o.order_change_types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_change_types].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/order_change_types.rb b/vendor/notifications/lib/sp_notifications/models/order_change_types.rb deleted file mode 100644 index 5d3345e..0000000 --- a/vendor/notifications/lib/sp_notifications/models/order_change_types.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # A list of order change types to subscribe to (for example: `BuyerRequestedChange`). To receive notifications of all change types, do not provide this list. - class OrderChangeTypes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::OrderChangeTypes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::OrderChangeTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/processing_directive.rb b/vendor/notifications/lib/sp_notifications/models/processing_directive.rb deleted file mode 100644 index b4aefe2..0000000 --- a/vendor/notifications/lib/sp_notifications/models/processing_directive.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # Additional information passed to the subscription to control the processing of notifications. For example, you can use an `eventFilter` to customize your subscription to send notifications for only the specified `marketplaceId`s, or select the aggregation time period at which to send notifications (for example: limit to one notification every five minutes for high frequency notifications). The specific features available vary depending on the `notificationType`. This feature is currently only supported by the `ANY_OFFER_CHANGED` and `ORDER_CHANGE` `notificationType`s. - class ProcessingDirective - attr_accessor :event_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_filter' => :'eventFilter' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_filter' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::ProcessingDirective` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::ProcessingDirective`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_filter') - self.event_filter = attributes[:'event_filter'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_filter == o.event_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_filter].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/sqs_resource.rb b/vendor/notifications/lib/sp_notifications/models/sqs_resource.rb deleted file mode 100644 index a6e8760..0000000 --- a/vendor/notifications/lib/sp_notifications/models/sqs_resource.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # The information required to create an Amazon Simple Queue Service (Amazon SQS) queue destination. - class SqsResource - # The Amazon Resource Name (ARN) associated with the SQS queue. - attr_accessor :arn - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'arn' => :'arn' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'arn' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::SqsResource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::SqsResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'arn') - self.arn = attributes[:'arn'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @arn.nil? - invalid_properties.push('invalid value for "arn", arn cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @arn.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - arn == o.arn - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [arn].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/models/subscription.rb b/vendor/notifications/lib/sp_notifications/models/subscription.rb deleted file mode 100644 index dce7ed8..0000000 --- a/vendor/notifications/lib/sp_notifications/models/subscription.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpNotifications - # Information about the subscription. - class Subscription - # The subscription identifier generated when the subscription is created. - attr_accessor :subscription_id - - # The version of the payload object to be used in the notification. - attr_accessor :payload_version - - # The identifier for the destination where notifications will be delivered. - attr_accessor :destination_id - - attr_accessor :processing_directive - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'subscription_id' => :'subscriptionId', - :'payload_version' => :'payloadVersion', - :'destination_id' => :'destinationId', - :'processing_directive' => :'processingDirective' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'subscription_id' => :'Object', - :'payload_version' => :'Object', - :'destination_id' => :'Object', - :'processing_directive' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpNotifications::Subscription` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpNotifications::Subscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'subscription_id') - self.subscription_id = attributes[:'subscription_id'] - end - - if attributes.key?(:'payload_version') - self.payload_version = attributes[:'payload_version'] - end - - if attributes.key?(:'destination_id') - self.destination_id = attributes[:'destination_id'] - end - - if attributes.key?(:'processing_directive') - self.processing_directive = attributes[:'processing_directive'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @subscription_id.nil? - invalid_properties.push('invalid value for "subscription_id", subscription_id cannot be nil.') - end - - if @payload_version.nil? - invalid_properties.push('invalid value for "payload_version", payload_version cannot be nil.') - end - - if @destination_id.nil? - invalid_properties.push('invalid value for "destination_id", destination_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @subscription_id.nil? - return false if @payload_version.nil? - return false if @destination_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - subscription_id == o.subscription_id && - payload_version == o.payload_version && - destination_id == o.destination_id && - processing_directive == o.processing_directive - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [subscription_id, payload_version, destination_id, processing_directive].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpNotifications.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/notifications/lib/sp_notifications/version.rb b/vendor/notifications/lib/sp_notifications/version.rb deleted file mode 100644 index efe761f..0000000 --- a/vendor/notifications/lib/sp_notifications/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpNotifications - VERSION = '1.0.0' -end diff --git a/vendor/notifications/sp_notifications.gemspec b/vendor/notifications/sp_notifications.gemspec deleted file mode 100644 index a52937d..0000000 --- a/vendor/notifications/sp_notifications.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Notifications - -#The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_notifications/version" - -Gem::Specification.new do |s| - s.name = "sp_notifications" - s.version = SpNotifications::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Notifications Ruby Gem" - s.description = "The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, refer to the [Notifications Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide)." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/product_fees_v0/.gitignore b/vendor/product_fees_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/product_fees_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/product_fees_v0/.rspec b/vendor/product_fees_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/product_fees_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/product_fees_v0/.rubocop.yml b/vendor/product_fees_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/product_fees_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/product_fees_v0/.swagger-codegen-ignore b/vendor/product_fees_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/product_fees_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/product_fees_v0/.swagger-codegen/VERSION b/vendor/product_fees_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/product_fees_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/product_fees_v0/Gemfile b/vendor/product_fees_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/product_fees_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/product_fees_v0/README.md b/vendor/product_fees_v0/README.md deleted file mode 100644 index 631e736..0000000 --- a/vendor/product_fees_v0/README.md +++ /dev/null @@ -1,134 +0,0 @@ -# sp_product_fees_v0 - -SpProductFeesV0 - the Ruby gem for the Selling Partner API for Product Fees - -The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_product_fees_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_product_fees_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_product_fees_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_product_fees_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_product_fees_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_product_fees_v0' - -api_instance = SpProductFeesV0::FeesApi.new -body = SpProductFeesV0::GetMyFeesEstimateRequest.new # GetMyFeesEstimateRequest | -asin = 'asin_example' # String | The Amazon Standard Identification Number (ASIN) of the item. - - -begin - result = api_instance.get_my_fees_estimate_for_asin(body, asin) - p result -rescue SpProductFeesV0::ApiError => e - puts "Exception when calling FeesApi->get_my_fees_estimate_for_asin: #{e}" -end - -api_instance = SpProductFeesV0::FeesApi.new -body = SpProductFeesV0::GetMyFeesEstimateRequest.new # GetMyFeesEstimateRequest | -seller_sku = 'seller_sku_example' # String | Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - - -begin - result = api_instance.get_my_fees_estimate_for_sku(body, seller_sku) - p result -rescue SpProductFeesV0::ApiError => e - puts "Exception when calling FeesApi->get_my_fees_estimate_for_sku: #{e}" -end - -api_instance = SpProductFeesV0::FeesApi.new -body = [SpProductFeesV0::FeesEstimateByIdRequest.new] # Array | - - -begin - result = api_instance.get_my_fees_estimates(body) - p result -rescue SpProductFeesV0::ApiError => e - puts "Exception when calling FeesApi->get_my_fees_estimates: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpProductFeesV0::FeesApi* | [**get_my_fees_estimate_for_asin**](docs/FeesApi.md#get_my_fees_estimate_for_asin) | **POST** /products/fees/v0/items/{Asin}/feesEstimate | -*SpProductFeesV0::FeesApi* | [**get_my_fees_estimate_for_sku**](docs/FeesApi.md#get_my_fees_estimate_for_sku) | **POST** /products/fees/v0/listings/{SellerSKU}/feesEstimate | -*SpProductFeesV0::FeesApi* | [**get_my_fees_estimates**](docs/FeesApi.md#get_my_fees_estimates) | **POST** /products/fees/v0/feesEstimate | - -## Documentation for Models - - - [SpProductFeesV0::Error](docs/Error.md) - - [SpProductFeesV0::ErrorList](docs/ErrorList.md) - - [SpProductFeesV0::FeeDetail](docs/FeeDetail.md) - - [SpProductFeesV0::FeeDetailList](docs/FeeDetailList.md) - - [SpProductFeesV0::FeesEstimate](docs/FeesEstimate.md) - - [SpProductFeesV0::FeesEstimateByIdRequest](docs/FeesEstimateByIdRequest.md) - - [SpProductFeesV0::FeesEstimateError](docs/FeesEstimateError.md) - - [SpProductFeesV0::FeesEstimateErrorDetail](docs/FeesEstimateErrorDetail.md) - - [SpProductFeesV0::FeesEstimateIdentifier](docs/FeesEstimateIdentifier.md) - - [SpProductFeesV0::FeesEstimateRequest](docs/FeesEstimateRequest.md) - - [SpProductFeesV0::FeesEstimateResult](docs/FeesEstimateResult.md) - - [SpProductFeesV0::GetMyFeesEstimateRequest](docs/GetMyFeesEstimateRequest.md) - - [SpProductFeesV0::GetMyFeesEstimateResponse](docs/GetMyFeesEstimateResponse.md) - - [SpProductFeesV0::GetMyFeesEstimateResult](docs/GetMyFeesEstimateResult.md) - - [SpProductFeesV0::GetMyFeesEstimatesErrorList](docs/GetMyFeesEstimatesErrorList.md) - - [SpProductFeesV0::GetMyFeesEstimatesRequest](docs/GetMyFeesEstimatesRequest.md) - - [SpProductFeesV0::GetMyFeesEstimatesResponse](docs/GetMyFeesEstimatesResponse.md) - - [SpProductFeesV0::IdType](docs/IdType.md) - - [SpProductFeesV0::IncludedFeeDetail](docs/IncludedFeeDetail.md) - - [SpProductFeesV0::IncludedFeeDetailList](docs/IncludedFeeDetailList.md) - - [SpProductFeesV0::MoneyType](docs/MoneyType.md) - - [SpProductFeesV0::OptionalFulfillmentProgram](docs/OptionalFulfillmentProgram.md) - - [SpProductFeesV0::Points](docs/Points.md) - - [SpProductFeesV0::PriceToEstimateFees](docs/PriceToEstimateFees.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/product_fees_v0/Rakefile b/vendor/product_fees_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/product_fees_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/product_fees_v0/git_push.sh b/vendor/product_fees_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/product_fees_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0.rb deleted file mode 100644 index a5f07de..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0.rb +++ /dev/null @@ -1,94 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_product_fees_v0/api_client' -# require 'sp_product_fees_v0/api_error' -# require 'sp_product_fees_v0/version' -# require 'sp_product_fees_v0/configuration' - -# Models -# -# -# require_relative './sp_product_fees_v0/models/error' -# -# -# require_relative './sp_product_fees_v0/models/error_list' -# -# -# require_relative './sp_product_fees_v0/models/fee_detail' -# -# -# require_relative './sp_product_fees_v0/models/fee_detail_list' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_by_id_request' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_error' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_error_detail' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_identifier' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_request' -# -# -# require_relative './sp_product_fees_v0/models/fees_estimate_result' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimate_request' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimate_response' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimate_result' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimates_error_list' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimates_request' -# -# -# require_relative './sp_product_fees_v0/models/get_my_fees_estimates_response' -# -# -# require_relative './sp_product_fees_v0/models/id_type' -# -# -# require_relative './sp_product_fees_v0/models/included_fee_detail' -# -# -# require_relative './sp_product_fees_v0/models/included_fee_detail_list' -# -# -# require_relative './sp_product_fees_v0/models/money_type' -# -# -# require_relative './sp_product_fees_v0/models/optional_fulfillment_program' -# -# -# require_relative './sp_product_fees_v0/models/points' -# -# -# require_relative './sp_product_fees_v0/models/price_to_estimate_fees' -# - -# APIs -require_relative './sp_product_fees_v0/api/fees_api' diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/api/fees_api.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/api/fees_api.rb deleted file mode 100644 index 0474934..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/api/fees_api.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductFeesV0 - class FeesApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item's price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item's catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @return [GetMyFeesEstimateResponse] - def get_my_fees_estimate_for_asin(body, asin, opts = {}) - data = get_my_fees_estimate_for_asin_with_http_info(body, asin, opts) - return data - end - - # Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item's price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item's catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @return [Array<(GetMyFeesEstimateResponse)>] GetMyFeesEstimateResponse data, response status code and response headers - def get_my_fees_estimate_for_asin_with_http_info(body, asin, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FeesApi.get_my_fees_estimate_for_asin ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FeesApi.get_my_fees_estimate_for_asin" - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling FeesApi.get_my_fees_estimate_for_asin" - end - # resource path - local_var_path = '/products/fees/v0/items/{Asin}/feesEstimate'.sub('{' + 'Asin' + '}', asin.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FeesApi#get_my_fees_estimate_for_asin\nData: #{data.inspect}" - end - return data - end - # Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item's price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they've sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @param [Hash] opts the optional parameters - # @return [GetMyFeesEstimateResponse] - def get_my_fees_estimate_for_sku(body, seller_sku, opts = {}) - data = get_my_fees_estimate_for_sku_with_http_info(body, seller_sku, opts) - return data - end - - # Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item's price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they've sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @param [Hash] opts the optional parameters - # @return [Array<(GetMyFeesEstimateResponse)>] GetMyFeesEstimateResponse data, response status code and response headers - def get_my_fees_estimate_for_sku_with_http_info(body, seller_sku, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FeesApi.get_my_fees_estimate_for_sku ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FeesApi.get_my_fees_estimate_for_sku" - end - # verify the required parameter 'seller_sku' is set - if @api_client.config.client_side_validation && seller_sku.nil? - fail ArgumentError, "Missing the required parameter 'seller_sku' when calling FeesApi.get_my_fees_estimate_for_sku" - end - # resource path - local_var_path = '/products/fees/v0/listings/{SellerSKU}/feesEstimate'.sub('{' + 'SellerSKU' + '}', seller_sku.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FeesApi#get_my_fees_estimate_for_sku\nData: #{data.inspect}" - end - return data - end - # Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param [Hash] opts the optional parameters - # @return [GetMyFeesEstimatesResponse] - def get_my_fees_estimates(body, opts = {}) - data = get_my_fees_estimates_with_http_info(body, opts) - return data - end - - # Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param [Hash] opts the optional parameters - # @return [Array<(GetMyFeesEstimatesResponse)>] GetMyFeesEstimatesResponse data, response status code and response headers - def get_my_fees_estimates_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FeesApi.get_my_fees_estimates ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FeesApi.get_my_fees_estimates" - end - # resource path - local_var_path = '/products/fees/v0/feesEstimate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FeesApi#get_my_fees_estimates\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/api_client.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/api_client.rb deleted file mode 100644 index 106736b..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpProductFeesV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpProductFeesV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/api_error.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/api_error.rb deleted file mode 100644 index a14f8e7..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductFeesV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/configuration.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/configuration.rb deleted file mode 100644 index 6a360cc..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductFeesV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error.rb deleted file mode 100644 index e06a449..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error_list.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error_list.rb deleted file mode 100644 index 24861f0..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail.rb deleted file mode 100644 index c7be1c0..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # The type of fee, fee amount, and other details. - class FeeDetail - # The type of fee charged to a seller. - attr_accessor :fee_type - - attr_accessor :fee_amount - - attr_accessor :fee_promotion - - attr_accessor :tax_amount - - attr_accessor :final_fee - - attr_accessor :included_fee_detail_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fee_type' => :'FeeType', - :'fee_amount' => :'FeeAmount', - :'fee_promotion' => :'FeePromotion', - :'tax_amount' => :'TaxAmount', - :'final_fee' => :'FinalFee', - :'included_fee_detail_list' => :'IncludedFeeDetailList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fee_type' => :'Object', - :'fee_amount' => :'Object', - :'fee_promotion' => :'Object', - :'tax_amount' => :'Object', - :'final_fee' => :'Object', - :'included_fee_detail_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeeDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeeDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fee_type') - self.fee_type = attributes[:'fee_type'] - end - - if attributes.key?(:'fee_amount') - self.fee_amount = attributes[:'fee_amount'] - end - - if attributes.key?(:'fee_promotion') - self.fee_promotion = attributes[:'fee_promotion'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'final_fee') - self.final_fee = attributes[:'final_fee'] - end - - if attributes.key?(:'included_fee_detail_list') - self.included_fee_detail_list = attributes[:'included_fee_detail_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fee_type.nil? - invalid_properties.push('invalid value for "fee_type", fee_type cannot be nil.') - end - - if @fee_amount.nil? - invalid_properties.push('invalid value for "fee_amount", fee_amount cannot be nil.') - end - - if @final_fee.nil? - invalid_properties.push('invalid value for "final_fee", final_fee cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fee_type.nil? - return false if @fee_amount.nil? - return false if @final_fee.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fee_type == o.fee_type && - fee_amount == o.fee_amount && - fee_promotion == o.fee_promotion && - tax_amount == o.tax_amount && - final_fee == o.final_fee && - included_fee_detail_list == o.included_fee_detail_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fee_type, fee_amount, fee_promotion, tax_amount, final_fee, included_fee_detail_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail_list.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail_list.rb deleted file mode 100644 index 4ba2a99..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fee_detail_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A list of other fees that contribute to a given fee. - class FeeDetailList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeeDetailList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeeDetailList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate.rb deleted file mode 100644 index d4e40e7..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # The total estimated fees for an item and a list of details. - class FeesEstimate - # The time at which the fees were estimated. This defaults to the time the request is made. - attr_accessor :time_of_fees_estimation - - attr_accessor :total_fees_estimate - - attr_accessor :fee_detail_list - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'time_of_fees_estimation' => :'TimeOfFeesEstimation', - :'total_fees_estimate' => :'TotalFeesEstimate', - :'fee_detail_list' => :'FeeDetailList' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'time_of_fees_estimation' => :'Object', - :'total_fees_estimate' => :'Object', - :'fee_detail_list' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'time_of_fees_estimation') - self.time_of_fees_estimation = attributes[:'time_of_fees_estimation'] - end - - if attributes.key?(:'total_fees_estimate') - self.total_fees_estimate = attributes[:'total_fees_estimate'] - end - - if attributes.key?(:'fee_detail_list') - self.fee_detail_list = attributes[:'fee_detail_list'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @time_of_fees_estimation.nil? - invalid_properties.push('invalid value for "time_of_fees_estimation", time_of_fees_estimation cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @time_of_fees_estimation.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - time_of_fees_estimation == o.time_of_fees_estimation && - total_fees_estimate == o.total_fees_estimate && - fee_detail_list == o.fee_detail_list - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [time_of_fees_estimation, total_fees_estimate, fee_detail_list].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_by_id_request.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_by_id_request.rb deleted file mode 100644 index 6e92400..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_by_id_request.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A product, marketplace, and proposed price used to request estimated fees. - class FeesEstimateByIdRequest - attr_accessor :fees_estimate_request - - attr_accessor :id_type - - # The item identifier. - attr_accessor :id_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fees_estimate_request' => :'FeesEstimateRequest', - :'id_type' => :'IdType', - :'id_value' => :'IdValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fees_estimate_request' => :'Object', - :'id_type' => :'Object', - :'id_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateByIdRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateByIdRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fees_estimate_request') - self.fees_estimate_request = attributes[:'fees_estimate_request'] - end - - if attributes.key?(:'id_type') - self.id_type = attributes[:'id_type'] - end - - if attributes.key?(:'id_value') - self.id_value = attributes[:'id_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id_type.nil? - invalid_properties.push('invalid value for "id_type", id_type cannot be nil.') - end - - if @id_value.nil? - invalid_properties.push('invalid value for "id_value", id_value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id_type.nil? - return false if @id_value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fees_estimate_request == o.fees_estimate_request && - id_type == o.id_type && - id_value == o.id_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fees_estimate_request, id_type, id_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error.rb deleted file mode 100644 index 925d1ae..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # An unexpected error occurred during this operation. - class FeesEstimateError - # An error type, identifying either the receiver or the sender as the originator of the error. - attr_accessor :type - - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - attr_accessor :detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'code' => :'Code', - :'message' => :'Message', - :'detail' => :'Detail' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'code' => :'Object', - :'message' => :'Object', - :'detail' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - if @detail.nil? - invalid_properties.push('invalid value for "detail", detail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @code.nil? - return false if @message.nil? - return false if @detail.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - code == o.code && - message == o.message && - detail == o.detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, code, message, detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error_detail.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error_detail.rb deleted file mode 100644 index c66d22a..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_error_detail.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Additional information that can help the caller understand or fix the issue. - class FeesEstimateErrorDetail - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateErrorDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_identifier.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_identifier.rb deleted file mode 100644 index ac6b82d..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_identifier.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # An item identifier, marketplace, time of request, and other details that identify an estimate. - class FeesEstimateIdentifier - # A marketplace identifier. - attr_accessor :marketplace_id - - # The seller identifier. - attr_accessor :seller_id - - attr_accessor :id_type - - # The item identifier. - attr_accessor :id_value - - # When true, the offer is fulfilled by Amazon. - attr_accessor :is_amazon_fulfilled - - attr_accessor :price_to_estimate_fees - - # A unique identifier provided by the caller to track this request. - attr_accessor :seller_input_identifier - - attr_accessor :optional_fulfillment_program - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'seller_id' => :'SellerId', - :'id_type' => :'IdType', - :'id_value' => :'IdValue', - :'is_amazon_fulfilled' => :'IsAmazonFulfilled', - :'price_to_estimate_fees' => :'PriceToEstimateFees', - :'seller_input_identifier' => :'SellerInputIdentifier', - :'optional_fulfillment_program' => :'OptionalFulfillmentProgram' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'seller_id' => :'Object', - :'id_type' => :'Object', - :'id_value' => :'Object', - :'is_amazon_fulfilled' => :'Object', - :'price_to_estimate_fees' => :'Object', - :'seller_input_identifier' => :'Object', - :'optional_fulfillment_program' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - - if attributes.key?(:'id_type') - self.id_type = attributes[:'id_type'] - end - - if attributes.key?(:'id_value') - self.id_value = attributes[:'id_value'] - end - - if attributes.key?(:'is_amazon_fulfilled') - self.is_amazon_fulfilled = attributes[:'is_amazon_fulfilled'] - end - - if attributes.key?(:'price_to_estimate_fees') - self.price_to_estimate_fees = attributes[:'price_to_estimate_fees'] - end - - if attributes.key?(:'seller_input_identifier') - self.seller_input_identifier = attributes[:'seller_input_identifier'] - end - - if attributes.key?(:'optional_fulfillment_program') - self.optional_fulfillment_program = attributes[:'optional_fulfillment_program'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - seller_id == o.seller_id && - id_type == o.id_type && - id_value == o.id_value && - is_amazon_fulfilled == o.is_amazon_fulfilled && - price_to_estimate_fees == o.price_to_estimate_fees && - seller_input_identifier == o.seller_input_identifier && - optional_fulfillment_program == o.optional_fulfillment_program - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, seller_id, id_type, id_value, is_amazon_fulfilled, price_to_estimate_fees, seller_input_identifier, optional_fulfillment_program].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_request.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_request.rb deleted file mode 100644 index af16b46..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_request.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A product, marketplace, and proposed price used to request estimated fees. - class FeesEstimateRequest - # A marketplace identifier. - attr_accessor :marketplace_id - - # When true, the offer is fulfilled by Amazon. - attr_accessor :is_amazon_fulfilled - - attr_accessor :price_to_estimate_fees - - # A unique identifier provided by the caller to track this request. - attr_accessor :identifier - - attr_accessor :optional_fulfillment_program - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'is_amazon_fulfilled' => :'IsAmazonFulfilled', - :'price_to_estimate_fees' => :'PriceToEstimateFees', - :'identifier' => :'Identifier', - :'optional_fulfillment_program' => :'OptionalFulfillmentProgram' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'is_amazon_fulfilled' => :'Object', - :'price_to_estimate_fees' => :'Object', - :'identifier' => :'Object', - :'optional_fulfillment_program' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'is_amazon_fulfilled') - self.is_amazon_fulfilled = attributes[:'is_amazon_fulfilled'] - end - - if attributes.key?(:'price_to_estimate_fees') - self.price_to_estimate_fees = attributes[:'price_to_estimate_fees'] - end - - if attributes.key?(:'identifier') - self.identifier = attributes[:'identifier'] - end - - if attributes.key?(:'optional_fulfillment_program') - self.optional_fulfillment_program = attributes[:'optional_fulfillment_program'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @price_to_estimate_fees.nil? - invalid_properties.push('invalid value for "price_to_estimate_fees", price_to_estimate_fees cannot be nil.') - end - - if @identifier.nil? - invalid_properties.push('invalid value for "identifier", identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @price_to_estimate_fees.nil? - return false if @identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - is_amazon_fulfilled == o.is_amazon_fulfilled && - price_to_estimate_fees == o.price_to_estimate_fees && - identifier == o.identifier && - optional_fulfillment_program == o.optional_fulfillment_program - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, is_amazon_fulfilled, price_to_estimate_fees, identifier, optional_fulfillment_program].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_result.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_result.rb deleted file mode 100644 index e080cab..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/fees_estimate_result.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # An item identifier and the estimated fees for the item. - class FeesEstimateResult - # The status of the fee request. Possible values: Success, ClientError, ServiceError. - attr_accessor :status - - attr_accessor :fees_estimate_identifier - - attr_accessor :fees_estimate - - attr_accessor :error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'Status', - :'fees_estimate_identifier' => :'FeesEstimateIdentifier', - :'fees_estimate' => :'FeesEstimate', - :'error' => :'Error' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object', - :'fees_estimate_identifier' => :'Object', - :'fees_estimate' => :'Object', - :'error' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::FeesEstimateResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::FeesEstimateResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'fees_estimate_identifier') - self.fees_estimate_identifier = attributes[:'fees_estimate_identifier'] - end - - if attributes.key?(:'fees_estimate') - self.fees_estimate = attributes[:'fees_estimate'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - fees_estimate_identifier == o.fees_estimate_identifier && - fees_estimate == o.fees_estimate && - error == o.error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, fees_estimate_identifier, fees_estimate, error].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_request.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_request.rb deleted file mode 100644 index e7a0e11..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Request schema. - class GetMyFeesEstimateRequest - attr_accessor :fees_estimate_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fees_estimate_request' => :'FeesEstimateRequest' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fees_estimate_request' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fees_estimate_request') - self.fees_estimate_request = attributes[:'fees_estimate_request'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fees_estimate_request == o.fees_estimate_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fees_estimate_request].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_response.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_response.rb deleted file mode 100644 index c978e4b..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_response.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class GetMyFeesEstimateResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_result.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_result.rb deleted file mode 100644 index a9e5b73..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimate_result.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Response schema. - class GetMyFeesEstimateResult - attr_accessor :fees_estimate_result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fees_estimate_result' => :'FeesEstimateResult' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fees_estimate_result' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimateResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fees_estimate_result') - self.fees_estimate_result = attributes[:'fees_estimate_result'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fees_estimate_result == o.fees_estimate_result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fees_estimate_result].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_error_list.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_error_list.rb deleted file mode 100644 index 33edce0..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_error_list.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A list of error responses returned when a request is unsuccessful. - class GetMyFeesEstimatesErrorList - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_request.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_request.rb deleted file mode 100644 index 5c9bbad..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_request.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Request for estimated fees for a list of products. - class GetMyFeesEstimatesRequest - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_response.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_response.rb deleted file mode 100644 index d4c40ce..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/get_my_fees_estimates_response.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Estimated fees for a list of products. - class GetMyFeesEstimatesResponse - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::GetMyFeesEstimatesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/id_type.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/id_type.rb deleted file mode 100644 index bb4ad2a..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/id_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class IdType - ASIN = 'ASIN'.freeze - SELLER_SKU = 'SellerSKU'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = IdType.constants.select { |c| IdType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #IdType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail.rb deleted file mode 100644 index 0978276..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # The type of fee, fee amount, and other details. - class IncludedFeeDetail - # The type of fee charged to a seller. - attr_accessor :fee_type - - attr_accessor :fee_amount - - attr_accessor :fee_promotion - - attr_accessor :tax_amount - - attr_accessor :final_fee - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fee_type' => :'FeeType', - :'fee_amount' => :'FeeAmount', - :'fee_promotion' => :'FeePromotion', - :'tax_amount' => :'TaxAmount', - :'final_fee' => :'FinalFee' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fee_type' => :'Object', - :'fee_amount' => :'Object', - :'fee_promotion' => :'Object', - :'tax_amount' => :'Object', - :'final_fee' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::IncludedFeeDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::IncludedFeeDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fee_type') - self.fee_type = attributes[:'fee_type'] - end - - if attributes.key?(:'fee_amount') - self.fee_amount = attributes[:'fee_amount'] - end - - if attributes.key?(:'fee_promotion') - self.fee_promotion = attributes[:'fee_promotion'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'final_fee') - self.final_fee = attributes[:'final_fee'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fee_type.nil? - invalid_properties.push('invalid value for "fee_type", fee_type cannot be nil.') - end - - if @fee_amount.nil? - invalid_properties.push('invalid value for "fee_amount", fee_amount cannot be nil.') - end - - if @final_fee.nil? - invalid_properties.push('invalid value for "final_fee", final_fee cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fee_type.nil? - return false if @fee_amount.nil? - return false if @final_fee.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fee_type == o.fee_type && - fee_amount == o.fee_amount && - fee_promotion == o.fee_promotion && - tax_amount == o.tax_amount && - final_fee == o.final_fee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fee_type, fee_amount, fee_promotion, tax_amount, final_fee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail_list.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail_list.rb deleted file mode 100644 index 4431ed4..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/included_fee_detail_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # A list of other fees that contribute to a given fee. - class IncludedFeeDetailList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::IncludedFeeDetailList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::IncludedFeeDetailList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/money_type.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/money_type.rb deleted file mode 100644 index 130cc53..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/money_type.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class MoneyType - # The currency code in ISO 4217 format. - attr_accessor :currency_code - - # The monetary value. - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'CurrencyCode', - :'amount' => :'Amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::MoneyType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::MoneyType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/optional_fulfillment_program.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/optional_fulfillment_program.rb deleted file mode 100644 index 9cfa2db..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/optional_fulfillment_program.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class OptionalFulfillmentProgram - CORE = 'FBA_CORE'.freeze - SNL = 'FBA_SNL'.freeze - EFN = 'FBA_EFN'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = OptionalFulfillmentProgram.constants.select { |c| OptionalFulfillmentProgram::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OptionalFulfillmentProgram" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/points.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/points.rb deleted file mode 100644 index 2d1ef89..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/points.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - class Points - attr_accessor :points_number - - attr_accessor :points_monetary_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'points_number' => :'PointsNumber', - :'points_monetary_value' => :'PointsMonetaryValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'points_number' => :'Object', - :'points_monetary_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::Points` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::Points`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'points_number') - self.points_number = attributes[:'points_number'] - end - - if attributes.key?(:'points_monetary_value') - self.points_monetary_value = attributes[:'points_monetary_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - points_number == o.points_number && - points_monetary_value == o.points_monetary_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [points_number, points_monetary_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/price_to_estimate_fees.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/models/price_to_estimate_fees.rb deleted file mode 100644 index 94a5f97..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/models/price_to_estimate_fees.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductFeesV0 - # Price information for an item, used to estimate fees. - class PriceToEstimateFees - attr_accessor :listing_price - - attr_accessor :shipping - - attr_accessor :points - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'listing_price' => :'ListingPrice', - :'shipping' => :'Shipping', - :'points' => :'Points' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'listing_price' => :'Object', - :'shipping' => :'Object', - :'points' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductFeesV0::PriceToEstimateFees` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductFeesV0::PriceToEstimateFees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - - if attributes.key?(:'shipping') - self.shipping = attributes[:'shipping'] - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @listing_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - listing_price == o.listing_price && - shipping == o.shipping && - points == o.points - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [listing_price, shipping, points].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductFeesV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_fees_v0/lib/sp_product_fees_v0/version.rb b/vendor/product_fees_v0/lib/sp_product_fees_v0/version.rb deleted file mode 100644 index 85758f0..0000000 --- a/vendor/product_fees_v0/lib/sp_product_fees_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpProductFeesV0 - VERSION = '1.0.0' -end diff --git a/vendor/product_fees_v0/sp_product_fees_v0.gemspec b/vendor/product_fees_v0/sp_product_fees_v0.gemspec deleted file mode 100644 index f6c68b0..0000000 --- a/vendor/product_fees_v0/sp_product_fees_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Product Fees - -#The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_product_fees_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_product_fees_v0" - s.version = SpProductFeesV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Product Fees Ruby Gem" - s.description = "The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/product_pricing_v0/.gitignore b/vendor/product_pricing_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/product_pricing_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/product_pricing_v0/.rspec b/vendor/product_pricing_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/product_pricing_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/product_pricing_v0/.rubocop.yml b/vendor/product_pricing_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/product_pricing_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/product_pricing_v0/.swagger-codegen-ignore b/vendor/product_pricing_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/product_pricing_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/product_pricing_v0/.swagger-codegen/VERSION b/vendor/product_pricing_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/product_pricing_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/product_pricing_v0/Gemfile b/vendor/product_pricing_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/product_pricing_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/product_pricing_v0/README.md b/vendor/product_pricing_v0/README.md deleted file mode 100644 index 5803dc6..0000000 --- a/vendor/product_pricing_v0/README.md +++ /dev/null @@ -1,234 +0,0 @@ -# sp_product_pricing_v0 - -SpProductPricingV0 - the Ruby gem for the Selling Partner API for Pricing - -The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_product_pricing_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_product_pricing_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_product_pricing_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_product_pricing_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_product_pricing_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_product_pricing_v0' - -api_instance = SpProductPricingV0::ProductPricingApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for which prices are returned. -item_type = 'item_type_example' # String | Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. Possible values: Asin, Sku. -opts = { - asins: ['asins_example'], # Array | A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - skus: ['skus_example'], # Array | A list of up to twenty seller SKU values used to identify items in the given marketplace. - customer_type: 'customer_type_example' # String | Indicates whether to request pricing information from the point of view of Consumer or Business buyers. Default is Consumer. -} - -begin - result = api_instance.get_competitive_pricing(marketplace_id, item_type, opts) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_competitive_pricing: #{e}" -end - -api_instance = SpProductPricingV0::ProductPricingApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for which prices are returned. -item_condition = 'item_condition_example' # String | Filters the offer listings to be considered based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. -asin = 'asin_example' # String | The Amazon Standard Identification Number (ASIN) of the item. -opts = { - customer_type: 'customer_type_example' # String | Indicates whether to request Consumer or Business offers. Default is Consumer. -} - -begin - result = api_instance.get_item_offers(marketplace_id, item_condition, asin, opts) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_item_offers: #{e}" -end - -api_instance = SpProductPricingV0::ProductPricingApi.new -body = SpProductPricingV0::GetItemOffersBatchRequest.new # GetItemOffersBatchRequest | The request associated with the `getItemOffersBatch` API call. - - -begin - result = api_instance.get_item_offers_batch(body) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_item_offers_batch: #{e}" -end - -api_instance = SpProductPricingV0::ProductPricingApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for which prices are returned. -item_condition = 'item_condition_example' # String | Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. -seller_sku = 'seller_sku_example' # String | Identifies an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. -opts = { - customer_type: 'customer_type_example' # String | Indicates whether to request Consumer or Business offers. Default is Consumer. -} - -begin - result = api_instance.get_listing_offers(marketplace_id, item_condition, seller_sku, opts) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_listing_offers: #{e}" -end - -api_instance = SpProductPricingV0::ProductPricingApi.new -body = SpProductPricingV0::GetListingOffersBatchRequest.new # GetListingOffersBatchRequest | The request associated with the `getListingOffersBatch` API call. - - -begin - result = api_instance.get_listing_offers_batch(body) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_listing_offers_batch: #{e}" -end - -api_instance = SpProductPricingV0::ProductPricingApi.new -marketplace_id = 'marketplace_id_example' # String | A marketplace identifier. Specifies the marketplace for which prices are returned. -item_type = 'item_type_example' # String | Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. -opts = { - asins: ['asins_example'], # Array | A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - skus: ['skus_example'], # Array | A list of up to twenty seller SKU values used to identify items in the given marketplace. - item_condition: 'item_condition_example', # String | Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - offer_type: 'offer_type_example' # String | Indicates whether to request pricing information for the seller's B2C or B2B offers. Default is B2C. -} - -begin - result = api_instance.get_pricing(marketplace_id, item_type, opts) - p result -rescue SpProductPricingV0::ApiError => e - puts "Exception when calling ProductPricingApi->get_pricing: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpProductPricingV0::ProductPricingApi* | [**get_competitive_pricing**](docs/ProductPricingApi.md#get_competitive_pricing) | **GET** /products/pricing/v0/competitivePrice | -*SpProductPricingV0::ProductPricingApi* | [**get_item_offers**](docs/ProductPricingApi.md#get_item_offers) | **GET** /products/pricing/v0/items/{Asin}/offers | -*SpProductPricingV0::ProductPricingApi* | [**get_item_offers_batch**](docs/ProductPricingApi.md#get_item_offers_batch) | **POST** /batches/products/pricing/v0/itemOffers | -*SpProductPricingV0::ProductPricingApi* | [**get_listing_offers**](docs/ProductPricingApi.md#get_listing_offers) | **GET** /products/pricing/v0/listings/{SellerSKU}/offers | -*SpProductPricingV0::ProductPricingApi* | [**get_listing_offers_batch**](docs/ProductPricingApi.md#get_listing_offers_batch) | **POST** /batches/products/pricing/v0/listingOffers | -*SpProductPricingV0::ProductPricingApi* | [**get_pricing**](docs/ProductPricingApi.md#get_pricing) | **GET** /products/pricing/v0/price | - -## Documentation for Models - - - [SpProductPricingV0::ASINIdentifier](docs/ASINIdentifier.md) - - [SpProductPricingV0::Asin](docs/Asin.md) - - [SpProductPricingV0::AttributeSetList](docs/AttributeSetList.md) - - [SpProductPricingV0::BatchOffersRequestParams](docs/BatchOffersRequestParams.md) - - [SpProductPricingV0::BatchOffersResponse](docs/BatchOffersResponse.md) - - [SpProductPricingV0::BatchRequest](docs/BatchRequest.md) - - [SpProductPricingV0::BuyBoxEligibleOffers](docs/BuyBoxEligibleOffers.md) - - [SpProductPricingV0::BuyBoxPriceType](docs/BuyBoxPriceType.md) - - [SpProductPricingV0::BuyBoxPrices](docs/BuyBoxPrices.md) - - [SpProductPricingV0::CompetitivePriceList](docs/CompetitivePriceList.md) - - [SpProductPricingV0::CompetitivePriceType](docs/CompetitivePriceType.md) - - [SpProductPricingV0::CompetitivePricingType](docs/CompetitivePricingType.md) - - [SpProductPricingV0::ConditionType](docs/ConditionType.md) - - [SpProductPricingV0::CustomerType](docs/CustomerType.md) - - [SpProductPricingV0::DetailedShippingTimeType](docs/DetailedShippingTimeType.md) - - [SpProductPricingV0::Error](docs/Error.md) - - [SpProductPricingV0::ErrorList](docs/ErrorList.md) - - [SpProductPricingV0::Errors](docs/Errors.md) - - [SpProductPricingV0::FulfillmentChannelType](docs/FulfillmentChannelType.md) - - [SpProductPricingV0::GetItemOffersBatchRequest](docs/GetItemOffersBatchRequest.md) - - [SpProductPricingV0::GetItemOffersBatchResponse](docs/GetItemOffersBatchResponse.md) - - [SpProductPricingV0::GetListingOffersBatchRequest](docs/GetListingOffersBatchRequest.md) - - [SpProductPricingV0::GetListingOffersBatchResponse](docs/GetListingOffersBatchResponse.md) - - [SpProductPricingV0::GetOffersHttpStatusLine](docs/GetOffersHttpStatusLine.md) - - [SpProductPricingV0::GetOffersResponse](docs/GetOffersResponse.md) - - [SpProductPricingV0::GetOffersResult](docs/GetOffersResult.md) - - [SpProductPricingV0::GetPricingResponse](docs/GetPricingResponse.md) - - [SpProductPricingV0::HttpMethod](docs/HttpMethod.md) - - [SpProductPricingV0::HttpRequestHeaders](docs/HttpRequestHeaders.md) - - [SpProductPricingV0::HttpResponseHeaders](docs/HttpResponseHeaders.md) - - [SpProductPricingV0::IdentifierType](docs/IdentifierType.md) - - [SpProductPricingV0::ItemCondition](docs/ItemCondition.md) - - [SpProductPricingV0::ItemIdentifier](docs/ItemIdentifier.md) - - [SpProductPricingV0::ItemOffersRequest](docs/ItemOffersRequest.md) - - [SpProductPricingV0::ItemOffersRequestList](docs/ItemOffersRequestList.md) - - [SpProductPricingV0::ItemOffersRequestParams](docs/ItemOffersRequestParams.md) - - [SpProductPricingV0::ItemOffersResponse](docs/ItemOffersResponse.md) - - [SpProductPricingV0::ItemOffersResponseList](docs/ItemOffersResponseList.md) - - [SpProductPricingV0::ListingOffersRequest](docs/ListingOffersRequest.md) - - [SpProductPricingV0::ListingOffersRequestList](docs/ListingOffersRequestList.md) - - [SpProductPricingV0::ListingOffersRequestParams](docs/ListingOffersRequestParams.md) - - [SpProductPricingV0::ListingOffersResponse](docs/ListingOffersResponse.md) - - [SpProductPricingV0::ListingOffersResponseList](docs/ListingOffersResponseList.md) - - [SpProductPricingV0::LowestPriceType](docs/LowestPriceType.md) - - [SpProductPricingV0::LowestPrices](docs/LowestPrices.md) - - [SpProductPricingV0::MarketplaceId](docs/MarketplaceId.md) - - [SpProductPricingV0::MoneyType](docs/MoneyType.md) - - [SpProductPricingV0::NumberOfOfferListingsList](docs/NumberOfOfferListingsList.md) - - [SpProductPricingV0::NumberOfOffers](docs/NumberOfOffers.md) - - [SpProductPricingV0::OfferCountType](docs/OfferCountType.md) - - [SpProductPricingV0::OfferCustomerType](docs/OfferCustomerType.md) - - [SpProductPricingV0::OfferDetail](docs/OfferDetail.md) - - [SpProductPricingV0::OfferDetailList](docs/OfferDetailList.md) - - [SpProductPricingV0::OfferListingCountType](docs/OfferListingCountType.md) - - [SpProductPricingV0::OfferType](docs/OfferType.md) - - [SpProductPricingV0::OffersList](docs/OffersList.md) - - [SpProductPricingV0::Points](docs/Points.md) - - [SpProductPricingV0::Price](docs/Price.md) - - [SpProductPricingV0::PriceList](docs/PriceList.md) - - [SpProductPricingV0::PriceType](docs/PriceType.md) - - [SpProductPricingV0::PrimeInformationType](docs/PrimeInformationType.md) - - [SpProductPricingV0::Product](docs/Product.md) - - [SpProductPricingV0::QuantityDiscountPriceType](docs/QuantityDiscountPriceType.md) - - [SpProductPricingV0::QuantityDiscountType](docs/QuantityDiscountType.md) - - [SpProductPricingV0::RelationshipList](docs/RelationshipList.md) - - [SpProductPricingV0::SalesRankList](docs/SalesRankList.md) - - [SpProductPricingV0::SalesRankType](docs/SalesRankType.md) - - [SpProductPricingV0::SellerFeedbackType](docs/SellerFeedbackType.md) - - [SpProductPricingV0::SellerSKUIdentifier](docs/SellerSKUIdentifier.md) - - [SpProductPricingV0::ShipsFromType](docs/ShipsFromType.md) - - [SpProductPricingV0::Summary](docs/Summary.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/product_pricing_v0/Rakefile b/vendor/product_pricing_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/product_pricing_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/product_pricing_v0/git_push.sh b/vendor/product_pricing_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/product_pricing_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0.rb deleted file mode 100644 index 66a4065..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_product_pricing_v0/api_client' -# require 'sp_product_pricing_v0/api_error' -# require 'sp_product_pricing_v0/version' -# require 'sp_product_pricing_v0/configuration' - -# Models -# -# -# require_relative './sp_product_pricing_v0/models/asin_identifier' -# -# -# require_relative './sp_product_pricing_v0/models/asin' -# -# -# require_relative './sp_product_pricing_v0/models/attribute_set_list' -# -# -# require_relative './sp_product_pricing_v0/models/batch_offers_request_params' -# -# -# require_relative './sp_product_pricing_v0/models/batch_offers_response' -# -# -# require_relative './sp_product_pricing_v0/models/batch_request' -# -# -# require_relative './sp_product_pricing_v0/models/buy_box_eligible_offers' -# -# -# require_relative './sp_product_pricing_v0/models/buy_box_price_type' -# -# -# require_relative './sp_product_pricing_v0/models/buy_box_prices' -# -# -# require_relative './sp_product_pricing_v0/models/competitive_price_list' -# -# -# require_relative './sp_product_pricing_v0/models/competitive_price_type' -# -# -# require_relative './sp_product_pricing_v0/models/competitive_pricing_type' -# -# -# require_relative './sp_product_pricing_v0/models/condition_type' -# -# -# require_relative './sp_product_pricing_v0/models/customer_type' -# -# -# require_relative './sp_product_pricing_v0/models/detailed_shipping_time_type' -# -# -# require_relative './sp_product_pricing_v0/models/error' -# -# -# require_relative './sp_product_pricing_v0/models/error_list' -# -# -# require_relative './sp_product_pricing_v0/models/errors' -# -# -# require_relative './sp_product_pricing_v0/models/fulfillment_channel_type' -# -# -# require_relative './sp_product_pricing_v0/models/get_item_offers_batch_request' -# -# -# require_relative './sp_product_pricing_v0/models/get_item_offers_batch_response' -# -# -# require_relative './sp_product_pricing_v0/models/get_listing_offers_batch_request' -# -# -# require_relative './sp_product_pricing_v0/models/get_listing_offers_batch_response' -# -# -# require_relative './sp_product_pricing_v0/models/get_offers_http_status_line' -# -# -# require_relative './sp_product_pricing_v0/models/get_offers_response' -# -# -# require_relative './sp_product_pricing_v0/models/get_offers_result' -# -# -# require_relative './sp_product_pricing_v0/models/get_pricing_response' -# -# -# require_relative './sp_product_pricing_v0/models/http_method' -# -# -# require_relative './sp_product_pricing_v0/models/http_request_headers' -# -# -# require_relative './sp_product_pricing_v0/models/http_response_headers' -# -# -# require_relative './sp_product_pricing_v0/models/identifier_type' -# -# -# require_relative './sp_product_pricing_v0/models/item_condition' -# -# -# require_relative './sp_product_pricing_v0/models/item_identifier' -# -# -# require_relative './sp_product_pricing_v0/models/item_offers_request' -# -# -# require_relative './sp_product_pricing_v0/models/item_offers_request_list' -# -# -# require_relative './sp_product_pricing_v0/models/item_offers_request_params' -# -# -# require_relative './sp_product_pricing_v0/models/item_offers_response' -# -# -# require_relative './sp_product_pricing_v0/models/item_offers_response_list' -# -# -# require_relative './sp_product_pricing_v0/models/listing_offers_request' -# -# -# require_relative './sp_product_pricing_v0/models/listing_offers_request_list' -# -# -# require_relative './sp_product_pricing_v0/models/listing_offers_request_params' -# -# -# require_relative './sp_product_pricing_v0/models/listing_offers_response' -# -# -# require_relative './sp_product_pricing_v0/models/listing_offers_response_list' -# -# -# require_relative './sp_product_pricing_v0/models/lowest_price_type' -# -# -# require_relative './sp_product_pricing_v0/models/lowest_prices' -# -# -# require_relative './sp_product_pricing_v0/models/marketplace_id' -# -# -# require_relative './sp_product_pricing_v0/models/money_type' -# -# -# require_relative './sp_product_pricing_v0/models/number_of_offer_listings_list' -# -# -# require_relative './sp_product_pricing_v0/models/number_of_offers' -# -# -# require_relative './sp_product_pricing_v0/models/offer_count_type' -# -# -# require_relative './sp_product_pricing_v0/models/offer_customer_type' -# -# -# require_relative './sp_product_pricing_v0/models/offer_detail' -# -# -# require_relative './sp_product_pricing_v0/models/offer_detail_list' -# -# -# require_relative './sp_product_pricing_v0/models/offer_listing_count_type' -# -# -# require_relative './sp_product_pricing_v0/models/offer_type' -# -# -# require_relative './sp_product_pricing_v0/models/offers_list' -# -# -# require_relative './sp_product_pricing_v0/models/points' -# -# -# require_relative './sp_product_pricing_v0/models/price' -# -# -# require_relative './sp_product_pricing_v0/models/price_list' -# -# -# require_relative './sp_product_pricing_v0/models/price_type' -# -# -# require_relative './sp_product_pricing_v0/models/prime_information_type' -# -# -# require_relative './sp_product_pricing_v0/models/product' -# -# -# require_relative './sp_product_pricing_v0/models/quantity_discount_price_type' -# -# -# require_relative './sp_product_pricing_v0/models/quantity_discount_type' -# -# -# require_relative './sp_product_pricing_v0/models/relationship_list' -# -# -# require_relative './sp_product_pricing_v0/models/sales_rank_list' -# -# -# require_relative './sp_product_pricing_v0/models/sales_rank_type' -# -# -# require_relative './sp_product_pricing_v0/models/seller_feedback_type' -# -# -# require_relative './sp_product_pricing_v0/models/seller_sku_identifier' -# -# -# require_relative './sp_product_pricing_v0/models/ships_from_type' -# -# -# require_relative './sp_product_pricing_v0/models/summary' -# - -# APIs -require_relative './sp_product_pricing_v0/api/product_pricing_api' diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api/product_pricing_api.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api/product_pricing_api.rb deleted file mode 100644 index 2ef66df..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api/product_pricing_api.rb +++ /dev/null @@ -1,452 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductPricingV0 - class ProductPricingApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_type Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. Possible values: Asin, Sku. - # @param [Hash] opts the optional parameters - # @option opts [Array] :asins A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - # @option opts [Array] :skus A list of up to twenty seller SKU values used to identify items in the given marketplace. - # @option opts [String] :customer_type Indicates whether to request pricing information from the point of view of Consumer or Business buyers. Default is Consumer. - # @return [GetPricingResponse] - def get_competitive_pricing(marketplace_id, item_type, opts = {}) - data = get_competitive_pricing_with_http_info(marketplace_id, item_type, opts) - return data - end - - # Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_type Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. Possible values: Asin, Sku. - # @param [Hash] opts the optional parameters - # @option opts [Array] :asins A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - # @option opts [Array] :skus A list of up to twenty seller SKU values used to identify items in the given marketplace. - # @option opts [String] :customer_type Indicates whether to request pricing information from the point of view of Consumer or Business buyers. Default is Consumer. - # @return [Array<(GetPricingResponse)>] GetPricingResponse data, response status code and response headers - def get_competitive_pricing_with_http_info(marketplace_id, item_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_competitive_pricing ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling ProductPricingApi.get_competitive_pricing" - end - # verify the required parameter 'item_type' is set - if @api_client.config.client_side_validation && item_type.nil? - fail ArgumentError, "Missing the required parameter 'item_type' when calling ProductPricingApi.get_competitive_pricing" - end - # verify enum value - if @api_client.config.client_side_validation && !['Asin', 'Sku'].include?(item_type) - fail ArgumentError, "invalid value for 'item_type', must be one of Asin, Sku" - end - if @api_client.config.client_side_validation && opts[:'customer_type'] && !['Consumer', 'Business'].include?(opts[:'customer_type']) - fail ArgumentError, 'invalid value for "customer_type", must be one of Consumer, Business' - end - # resource path - local_var_path = '/products/pricing/v0/competitivePrice' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ItemType'] = item_type - query_params[:'Asins'] = @api_client.build_collection_param(opts[:'asins'], :csv) if !opts[:'asins'].nil? - query_params[:'Skus'] = @api_client.build_collection_param(opts[:'skus'], :csv) if !opts[:'skus'].nil? - query_params[:'CustomerType'] = opts[:'customer_type'] if !opts[:'customer_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_competitive_pricing\nData: #{data.inspect}" - end - return data - end - # Returns the lowest priced offers for a single item based on ASIN. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_condition Filters the offer listings to be considered based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @option opts [String] :customer_type Indicates whether to request Consumer or Business offers. Default is Consumer. - # @return [GetOffersResponse] - def get_item_offers(marketplace_id, item_condition, asin, opts = {}) - data = get_item_offers_with_http_info(marketplace_id, item_condition, asin, opts) - return data - end - - # Returns the lowest priced offers for a single item based on ASIN. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_condition Filters the offer listings to be considered based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @param asin The Amazon Standard Identification Number (ASIN) of the item. - # @param [Hash] opts the optional parameters - # @option opts [String] :customer_type Indicates whether to request Consumer or Business offers. Default is Consumer. - # @return [Array<(GetOffersResponse)>] GetOffersResponse data, response status code and response headers - def get_item_offers_with_http_info(marketplace_id, item_condition, asin, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_item_offers ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling ProductPricingApi.get_item_offers" - end - # verify the required parameter 'item_condition' is set - if @api_client.config.client_side_validation && item_condition.nil? - fail ArgumentError, "Missing the required parameter 'item_condition' when calling ProductPricingApi.get_item_offers" - end - # verify enum value - if @api_client.config.client_side_validation && !['New', 'Used', 'Collectible', 'Refurbished', 'Club'].include?(item_condition) - fail ArgumentError, "invalid value for 'item_condition', must be one of New, Used, Collectible, Refurbished, Club" - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling ProductPricingApi.get_item_offers" - end - if @api_client.config.client_side_validation && opts[:'customer_type'] && !['Consumer', 'Business'].include?(opts[:'customer_type']) - fail ArgumentError, 'invalid value for "customer_type", must be one of Consumer, Business' - end - # resource path - local_var_path = '/products/pricing/v0/items/{Asin}/offers'.sub('{' + 'Asin' + '}', asin.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ItemCondition'] = item_condition - query_params[:'CustomerType'] = opts[:'customer_type'] if !opts[:'customer_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_item_offers\nData: #{data.inspect}" - end - return data - end - # Returns the lowest priced offers for a batch of items based on ASIN. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request associated with the `getItemOffersBatch` API call. - # @param [Hash] opts the optional parameters - # @return [GetItemOffersBatchResponse] - def get_item_offers_batch(body, opts = {}) - data = get_item_offers_batch_with_http_info(body, opts) - return data - end - - # Returns the lowest priced offers for a batch of items based on ASIN. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request associated with the `getItemOffersBatch` API call. - # @param [Hash] opts the optional parameters - # @return [Array<(GetItemOffersBatchResponse)>] GetItemOffersBatchResponse data, response status code and response headers - def get_item_offers_batch_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_item_offers_batch ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ProductPricingApi.get_item_offers_batch" - end - # resource path - local_var_path = '/batches/products/pricing/v0/itemOffers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_item_offers_batch\nData: #{data.inspect}" - end - return data - end - # Returns the lowest priced offers for a single SKU listing. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_condition Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @param seller_sku Identifies an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @param [Hash] opts the optional parameters - # @option opts [String] :customer_type Indicates whether to request Consumer or Business offers. Default is Consumer. - # @return [GetOffersResponse] - def get_listing_offers(marketplace_id, item_condition, seller_sku, opts = {}) - data = get_listing_offers_with_http_info(marketplace_id, item_condition, seller_sku, opts) - return data - end - - # Returns the lowest priced offers for a single SKU listing. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_condition Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @param seller_sku Identifies an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. - # @param [Hash] opts the optional parameters - # @option opts [String] :customer_type Indicates whether to request Consumer or Business offers. Default is Consumer. - # @return [Array<(GetOffersResponse)>] GetOffersResponse data, response status code and response headers - def get_listing_offers_with_http_info(marketplace_id, item_condition, seller_sku, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_listing_offers ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling ProductPricingApi.get_listing_offers" - end - # verify the required parameter 'item_condition' is set - if @api_client.config.client_side_validation && item_condition.nil? - fail ArgumentError, "Missing the required parameter 'item_condition' when calling ProductPricingApi.get_listing_offers" - end - # verify enum value - if @api_client.config.client_side_validation && !['New', 'Used', 'Collectible', 'Refurbished', 'Club'].include?(item_condition) - fail ArgumentError, "invalid value for 'item_condition', must be one of New, Used, Collectible, Refurbished, Club" - end - # verify the required parameter 'seller_sku' is set - if @api_client.config.client_side_validation && seller_sku.nil? - fail ArgumentError, "Missing the required parameter 'seller_sku' when calling ProductPricingApi.get_listing_offers" - end - if @api_client.config.client_side_validation && opts[:'customer_type'] && !['Consumer', 'Business'].include?(opts[:'customer_type']) - fail ArgumentError, 'invalid value for "customer_type", must be one of Consumer, Business' - end - # resource path - local_var_path = '/products/pricing/v0/listings/{SellerSKU}/offers'.sub('{' + 'SellerSKU' + '}', seller_sku.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ItemCondition'] = item_condition - query_params[:'CustomerType'] = opts[:'customer_type'] if !opts[:'customer_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_listing_offers\nData: #{data.inspect}" - end - return data - end - # Returns the lowest priced offers for a batch of listings by SKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request associated with the `getListingOffersBatch` API call. - # @param [Hash] opts the optional parameters - # @return [GetListingOffersBatchResponse] - def get_listing_offers_batch(body, opts = {}) - data = get_listing_offers_batch_with_http_info(body, opts) - return data - end - - # Returns the lowest priced offers for a batch of listings by SKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request associated with the `getListingOffersBatch` API call. - # @param [Hash] opts the optional parameters - # @return [Array<(GetListingOffersBatchResponse)>] GetListingOffersBatchResponse data, response status code and response headers - def get_listing_offers_batch_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_listing_offers_batch ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ProductPricingApi.get_listing_offers_batch" - end - # resource path - local_var_path = '/batches/products/pricing/v0/listingOffers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_listing_offers_batch\nData: #{data.inspect}" - end - return data - end - # Returns pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_type Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. - # @param [Hash] opts the optional parameters - # @option opts [Array] :asins A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - # @option opts [Array] :skus A list of up to twenty seller SKU values used to identify items in the given marketplace. - # @option opts [String] :item_condition Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @option opts [String] :offer_type Indicates whether to request pricing information for the seller's B2C or B2B offers. Default is B2C. - # @return [GetPricingResponse] - def get_pricing(marketplace_id, item_type, opts = {}) - data = get_pricing_with_http_info(marketplace_id, item_type, opts) - return data - end - - # Returns pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_id A marketplace identifier. Specifies the marketplace for which prices are returned. - # @param item_type Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. - # @param [Hash] opts the optional parameters - # @option opts [Array] :asins A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace. - # @option opts [Array] :skus A list of up to twenty seller SKU values used to identify items in the given marketplace. - # @option opts [String] :item_condition Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. - # @option opts [String] :offer_type Indicates whether to request pricing information for the seller's B2C or B2B offers. Default is B2C. - # @return [Array<(GetPricingResponse)>] GetPricingResponse data, response status code and response headers - def get_pricing_with_http_info(marketplace_id, item_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProductPricingApi.get_pricing ...' - end - # verify the required parameter 'marketplace_id' is set - if @api_client.config.client_side_validation && marketplace_id.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling ProductPricingApi.get_pricing" - end - # verify the required parameter 'item_type' is set - if @api_client.config.client_side_validation && item_type.nil? - fail ArgumentError, "Missing the required parameter 'item_type' when calling ProductPricingApi.get_pricing" - end - # verify enum value - if @api_client.config.client_side_validation && !['Asin', 'Sku'].include?(item_type) - fail ArgumentError, "invalid value for 'item_type', must be one of Asin, Sku" - end - if @api_client.config.client_side_validation && opts[:'item_condition'] && !['New', 'Used', 'Collectible', 'Refurbished', 'Club'].include?(opts[:'item_condition']) - fail ArgumentError, 'invalid value for "item_condition", must be one of New, Used, Collectible, Refurbished, Club' - end - if @api_client.config.client_side_validation && opts[:'offer_type'] && !['B2C', 'B2B'].include?(opts[:'offer_type']) - fail ArgumentError, 'invalid value for "offer_type", must be one of B2C, B2B' - end - # resource path - local_var_path = '/products/pricing/v0/price' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'MarketplaceId'] = marketplace_id - query_params[:'ItemType'] = item_type - query_params[:'Asins'] = @api_client.build_collection_param(opts[:'asins'], :csv) if !opts[:'asins'].nil? - query_params[:'Skus'] = @api_client.build_collection_param(opts[:'skus'], :csv) if !opts[:'skus'].nil? - query_params[:'ItemCondition'] = opts[:'item_condition'] if !opts[:'item_condition'].nil? - query_params[:'OfferType'] = opts[:'offer_type'] if !opts[:'offer_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProductPricingApi#get_pricing\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_client.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_client.rb deleted file mode 100644 index 954eedf..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpProductPricingV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpProductPricingV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_error.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_error.rb deleted file mode 100644 index c627136..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductPricingV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/configuration.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/configuration.rb deleted file mode 100644 index 101c013..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpProductPricingV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin.rb deleted file mode 100644 index b1edd45..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The Amazon Standard Identification Number (ASIN) of the item. - class Asin - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Asin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Asin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin_identifier.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin_identifier.rb deleted file mode 100644 index 725597a..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/asin_identifier.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema to identify an item by MarketPlaceId and ASIN. - class ASINIdentifier - # A marketplace identifier. - attr_accessor :marketplace_id - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'asin' => :'ASIN' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ASINIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ASINIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @asin.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/attribute_set_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/attribute_set_list.rb deleted file mode 100644 index 6cdb89e..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/attribute_set_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of product attributes if they are applicable to the product that is returned. - class AttributeSetList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::AttributeSetList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::AttributeSetList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_request_params.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_request_params.rb deleted file mode 100644 index 1e1ac93..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_request_params.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Common request parameters that can be accepted by `ItemOffersRequest` and `ListingOffersRequest` - class BatchOffersRequestParams - attr_accessor :marketplace_id - - attr_accessor :item_condition - - attr_accessor :customer_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'item_condition' => :'ItemCondition', - :'customer_type' => :'CustomerType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'item_condition' => :'Object', - :'customer_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BatchOffersRequestParams` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BatchOffersRequestParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'customer_type') - self.customer_type = attributes[:'customer_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - item_condition == o.item_condition && - customer_type == o.customer_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, item_condition, customer_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_response.rb deleted file mode 100644 index c194872..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_offers_response.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Common schema that present in `ItemOffersResponse` and `ListingOffersResponse` - class BatchOffersResponse - attr_accessor :headers - - attr_accessor :status - - attr_accessor :body - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'headers' => :'headers', - :'status' => :'status', - :'body' => :'body' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'headers' => :'Object', - :'status' => :'Object', - :'body' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BatchOffersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BatchOffersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'body') - self.body = attributes[:'body'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @body.nil? - invalid_properties.push('invalid value for "body", body cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @body.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - headers == o.headers && - status == o.status && - body == o.body - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [headers, status, body].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_request.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_request.rb deleted file mode 100644 index 755c362..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/batch_request.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Common properties of batch requests against individual APIs. - class BatchRequest - # The resource path of the operation you are calling in batch without any query parameters. If you are calling `getItemOffersBatch`, supply the path of `getItemOffers`. **Example:** `/products/pricing/v0/items/B000P6Q7MY/offers` If you are calling `getListingOffersBatch`, supply the path of `getListingOffers`. **Example:** `/products/pricing/v0/listings/B000P6Q7MY/offers` - attr_accessor :uri - - attr_accessor :method - - attr_accessor :headers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'uri' => :'uri', - :'method' => :'method', - :'headers' => :'headers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'uri' => :'Object', - :'method' => :'Object', - :'headers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'uri') - self.uri = attributes[:'uri'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @uri.nil? - invalid_properties.push('invalid value for "uri", uri cannot be nil.') - end - - if @method.nil? - invalid_properties.push('invalid value for "method", method cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @uri.nil? - return false if @method.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - uri == o.uri && - method == o.method && - headers == o.headers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [uri, method, headers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_eligible_offers.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_eligible_offers.rb deleted file mode 100644 index 1473fae..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_eligible_offers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels. - class BuyBoxEligibleOffers - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BuyBoxEligibleOffers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BuyBoxEligibleOffers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_price_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_price_type.rb deleted file mode 100644 index dae0033..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_price_type.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual buybox price. - class BuyBoxPriceType - # Indicates the condition of the item. For example: New, Used, Collectible, Refurbished, or Club. - attr_accessor :condition - - attr_accessor :offer_type - - # Indicates at what quantity this price becomes active. - attr_accessor :quantity_tier - - attr_accessor :quantity_discount_type - - attr_accessor :landed_price - - attr_accessor :listing_price - - attr_accessor :shipping - - attr_accessor :points - - # The seller identifier for the offer. - attr_accessor :seller_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'offer_type' => :'offerType', - :'quantity_tier' => :'quantityTier', - :'quantity_discount_type' => :'quantityDiscountType', - :'landed_price' => :'LandedPrice', - :'listing_price' => :'ListingPrice', - :'shipping' => :'Shipping', - :'points' => :'Points', - :'seller_id' => :'sellerId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'Object', - :'offer_type' => :'Object', - :'quantity_tier' => :'Object', - :'quantity_discount_type' => :'Object', - :'landed_price' => :'Object', - :'listing_price' => :'Object', - :'shipping' => :'Object', - :'points' => :'Object', - :'seller_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BuyBoxPriceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BuyBoxPriceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'quantity_tier') - self.quantity_tier = attributes[:'quantity_tier'] - end - - if attributes.key?(:'quantity_discount_type') - self.quantity_discount_type = attributes[:'quantity_discount_type'] - end - - if attributes.key?(:'landed_price') - self.landed_price = attributes[:'landed_price'] - end - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - - if attributes.key?(:'shipping') - self.shipping = attributes[:'shipping'] - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @condition.nil? - invalid_properties.push('invalid value for "condition", condition cannot be nil.') - end - - if @landed_price.nil? - invalid_properties.push('invalid value for "landed_price", landed_price cannot be nil.') - end - - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - if @shipping.nil? - invalid_properties.push('invalid value for "shipping", shipping cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @condition.nil? - return false if @landed_price.nil? - return false if @listing_price.nil? - return false if @shipping.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - offer_type == o.offer_type && - quantity_tier == o.quantity_tier && - quantity_discount_type == o.quantity_discount_type && - landed_price == o.landed_price && - listing_price == o.listing_price && - shipping == o.shipping && - points == o.points && - seller_id == o.seller_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, offer_type, quantity_tier, quantity_discount_type, landed_price, listing_price, shipping, points, seller_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_prices.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_prices.rb deleted file mode 100644 index 45fa306..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/buy_box_prices.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of the Buy Box prices. - class BuyBoxPrices - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::BuyBoxPrices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::BuyBoxPrices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_list.rb deleted file mode 100644 index 4e19c69..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of competitive pricing information. - class CompetitivePriceList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::CompetitivePriceList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::CompetitivePriceList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_type.rb deleted file mode 100644 index aa06b46..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_price_type.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for competitive pricing information - class CompetitivePriceType - # The pricing model for each price that is returned. Possible values: * 1 - New Buy Box Price. * 2 - Used Buy Box Price. - attr_accessor :competitive_price_id - - attr_accessor :price - - # Indicates the condition of the item whose pricing information is returned. Possible values are: New, Used, Collectible, Refurbished, or Club. - attr_accessor :condition - - # Indicates the subcondition of the item whose pricing information is returned. Possible values are: New, Mint, Very Good, Good, Acceptable, Poor, Club, OEM, Warranty, Refurbished Warranty, Refurbished, Open Box, or Other. - attr_accessor :subcondition - - attr_accessor :offer_type - - # Indicates at what quantity this price becomes active. - attr_accessor :quantity_tier - - attr_accessor :quantity_discount_type - - # The seller identifier for the offer. - attr_accessor :seller_id - - # Indicates whether or not the pricing information is for an offer listing that belongs to the requester. The requester is the seller associated with the SellerId that was submitted with the request. Possible values are: true and false. - attr_accessor :belongs_to_requester - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'competitive_price_id' => :'CompetitivePriceId', - :'price' => :'Price', - :'condition' => :'condition', - :'subcondition' => :'subcondition', - :'offer_type' => :'offerType', - :'quantity_tier' => :'quantityTier', - :'quantity_discount_type' => :'quantityDiscountType', - :'seller_id' => :'sellerId', - :'belongs_to_requester' => :'belongsToRequester' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'competitive_price_id' => :'Object', - :'price' => :'Object', - :'condition' => :'Object', - :'subcondition' => :'Object', - :'offer_type' => :'Object', - :'quantity_tier' => :'Object', - :'quantity_discount_type' => :'Object', - :'seller_id' => :'Object', - :'belongs_to_requester' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::CompetitivePriceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::CompetitivePriceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'competitive_price_id') - self.competitive_price_id = attributes[:'competitive_price_id'] - end - - if attributes.key?(:'price') - self.price = attributes[:'price'] - end - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'subcondition') - self.subcondition = attributes[:'subcondition'] - end - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'quantity_tier') - self.quantity_tier = attributes[:'quantity_tier'] - end - - if attributes.key?(:'quantity_discount_type') - self.quantity_discount_type = attributes[:'quantity_discount_type'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - - if attributes.key?(:'belongs_to_requester') - self.belongs_to_requester = attributes[:'belongs_to_requester'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @competitive_price_id.nil? - invalid_properties.push('invalid value for "competitive_price_id", competitive_price_id cannot be nil.') - end - - if @price.nil? - invalid_properties.push('invalid value for "price", price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @competitive_price_id.nil? - return false if @price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - competitive_price_id == o.competitive_price_id && - price == o.price && - condition == o.condition && - subcondition == o.subcondition && - offer_type == o.offer_type && - quantity_tier == o.quantity_tier && - quantity_discount_type == o.quantity_discount_type && - seller_id == o.seller_id && - belongs_to_requester == o.belongs_to_requester - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [competitive_price_id, price, condition, subcondition, offer_type, quantity_tier, quantity_discount_type, seller_id, belongs_to_requester].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_pricing_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_pricing_type.rb deleted file mode 100644 index b733edb..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/competitive_pricing_type.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Competitive pricing information for the item. - class CompetitivePricingType - attr_accessor :competitive_prices - - attr_accessor :number_of_offer_listings - - attr_accessor :trade_in_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'competitive_prices' => :'CompetitivePrices', - :'number_of_offer_listings' => :'NumberOfOfferListings', - :'trade_in_value' => :'TradeInValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'competitive_prices' => :'Object', - :'number_of_offer_listings' => :'Object', - :'trade_in_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::CompetitivePricingType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::CompetitivePricingType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'competitive_prices') - self.competitive_prices = attributes[:'competitive_prices'] - end - - if attributes.key?(:'number_of_offer_listings') - self.number_of_offer_listings = attributes[:'number_of_offer_listings'] - end - - if attributes.key?(:'trade_in_value') - self.trade_in_value = attributes[:'trade_in_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @competitive_prices.nil? - invalid_properties.push('invalid value for "competitive_prices", competitive_prices cannot be nil.') - end - - if @number_of_offer_listings.nil? - invalid_properties.push('invalid value for "number_of_offer_listings", number_of_offer_listings cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @competitive_prices.nil? - return false if @number_of_offer_listings.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - competitive_prices == o.competitive_prices && - number_of_offer_listings == o.number_of_offer_listings && - trade_in_value == o.trade_in_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [competitive_prices, number_of_offer_listings, trade_in_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/condition_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/condition_type.rb deleted file mode 100644 index 54bc23b..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/condition_type.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class ConditionType - NEW = 'New'.freeze - USED = 'Used'.freeze - COLLECTIBLE = 'Collectible'.freeze - REFURBISHED = 'Refurbished'.freeze - CLUB = 'Club'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ConditionType.constants.select { |c| ConditionType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ConditionType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/customer_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/customer_type.rb deleted file mode 100644 index f85ba89..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/customer_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class CustomerType - CONSUMER = 'Consumer'.freeze - BUSINESS = 'Business'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CustomerType.constants.select { |c| CustomerType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CustomerType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/detailed_shipping_time_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/detailed_shipping_time_type.rb deleted file mode 100644 index b342afb..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/detailed_shipping_time_type.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The time range in which an item will likely be shipped once an order has been placed. - class DetailedShippingTimeType - # The minimum time, in hours, that the item will likely be shipped after the order has been placed. - attr_accessor :minimum_hours - - # The maximum time, in hours, that the item will likely be shipped after the order has been placed. - attr_accessor :maximum_hours - - # The date when the item will be available for shipping. Only displayed for items that are not currently available for shipping. - attr_accessor :available_date - - # Indicates whether the item is available for shipping now, or on a known or an unknown date in the future. If known, the availableDate property indicates the date that the item will be available for shipping. Possible values: NOW, FUTURE_WITHOUT_DATE, FUTURE_WITH_DATE. - attr_accessor :availability_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'minimum_hours' => :'minimumHours', - :'maximum_hours' => :'maximumHours', - :'available_date' => :'availableDate', - :'availability_type' => :'availabilityType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'minimum_hours' => :'Object', - :'maximum_hours' => :'Object', - :'available_date' => :'Object', - :'availability_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::DetailedShippingTimeType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::DetailedShippingTimeType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'minimum_hours') - self.minimum_hours = attributes[:'minimum_hours'] - end - - if attributes.key?(:'maximum_hours') - self.maximum_hours = attributes[:'maximum_hours'] - end - - if attributes.key?(:'available_date') - self.available_date = attributes[:'available_date'] - end - - if attributes.key?(:'availability_type') - self.availability_type = attributes[:'availability_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - availability_type_validator = EnumAttributeValidator.new('Object', ['NOW', 'FUTURE_WITHOUT_DATE', 'FUTURE_WITH_DATE']) - return false unless availability_type_validator.valid?(@availability_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] availability_type Object to be assigned - def availability_type=(availability_type) - validator = EnumAttributeValidator.new('Object', ['NOW', 'FUTURE_WITHOUT_DATE', 'FUTURE_WITH_DATE']) - unless validator.valid?(availability_type) - fail ArgumentError, "invalid value for \"availability_type\", must be one of #{validator.allowable_values}." - end - @availability_type = availability_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - minimum_hours == o.minimum_hours && - maximum_hours == o.maximum_hours && - available_date == o.available_date && - availability_type == o.availability_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [minimum_hours, maximum_hours, available_date, availability_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error.rb deleted file mode 100644 index 2fe5046..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error_list.rb deleted file mode 100644 index 7ec4c80..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/errors.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/errors.rb deleted file mode 100644 index 71e9056..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/errors.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of error responses returned when a request is unsuccessful. - class Errors - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Errors` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Errors`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/fulfillment_channel_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/fulfillment_channel_type.rb deleted file mode 100644 index 2b04321..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/fulfillment_channel_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class FulfillmentChannelType - AMAZON = 'Amazon'.freeze - MERCHANT = 'Merchant'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FulfillmentChannelType.constants.select { |c| FulfillmentChannelType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FulfillmentChannelType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_request.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_request.rb deleted file mode 100644 index c10d472..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The request associated with the `getItemOffersBatch` API call. - class GetItemOffersBatchRequest - attr_accessor :requests - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'requests' => :'requests' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'requests' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetItemOffersBatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetItemOffersBatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'requests') - self.requests = attributes[:'requests'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - requests == o.requests - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [requests].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_response.rb deleted file mode 100644 index bb42a95..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_item_offers_batch_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The response associated with the `getItemOffersBatch` API call. - class GetItemOffersBatchResponse - attr_accessor :responses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'responses' => :'responses' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'responses' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetItemOffersBatchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetItemOffersBatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'responses') - self.responses = attributes[:'responses'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - responses == o.responses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [responses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_request.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_request.rb deleted file mode 100644 index 3625c81..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The request associated with the `getListingOffersBatch` API call. - class GetListingOffersBatchRequest - attr_accessor :requests - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'requests' => :'requests' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'requests' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetListingOffersBatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetListingOffersBatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'requests') - self.requests = attributes[:'requests'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - requests == o.requests - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [requests].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_response.rb deleted file mode 100644 index 99daea4..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_listing_offers_batch_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The response associated with the `getListingOffersBatch` API call. - class GetListingOffersBatchResponse - attr_accessor :responses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'responses' => :'responses' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'responses' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetListingOffersBatchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetListingOffersBatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'responses') - self.responses = attributes[:'responses'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - responses == o.responses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [responses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_http_status_line.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_http_status_line.rb deleted file mode 100644 index 44345c1..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_http_status_line.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The HTTP status line associated with the response. For more information, consult [RFC 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html). - class GetOffersHttpStatusLine - # The HTTP response Status Code. - attr_accessor :status_code - - # The HTTP response Reason-Phase. - attr_accessor :reason_phrase - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status_code' => :'statusCode', - :'reason_phrase' => :'reasonPhrase' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status_code' => :'Object', - :'reason_phrase' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetOffersHttpStatusLine` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetOffersHttpStatusLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status_code') - self.status_code = attributes[:'status_code'] - end - - if attributes.key?(:'reason_phrase') - self.reason_phrase = attributes[:'reason_phrase'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status_code == o.status_code && - reason_phrase == o.reason_phrase - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status_code, reason_phrase].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_response.rb deleted file mode 100644 index bbd3aeb..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The response schema for the `getListingOffers` and `getItemOffers` operations. - class GetOffersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetOffersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetOffersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_result.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_result.rb deleted file mode 100644 index b615b8a..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_offers_result.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The payload for the getListingOffers and getItemOffers operations. - class GetOffersResult - # A marketplace identifier. - attr_accessor :marketplace_id - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # The stock keeping unit (SKU) of the item. - attr_accessor :sku - - attr_accessor :item_condition - - # The status of the operation. - attr_accessor :status - - attr_accessor :identifier - - attr_accessor :summary - - attr_accessor :offers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceID', - :'asin' => :'ASIN', - :'sku' => :'SKU', - :'item_condition' => :'ItemCondition', - :'status' => :'status', - :'identifier' => :'Identifier', - :'summary' => :'Summary', - :'offers' => :'Offers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object', - :'sku' => :'Object', - :'item_condition' => :'Object', - :'status' => :'Object', - :'identifier' => :'Object', - :'summary' => :'Object', - :'offers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetOffersResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetOffersResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'sku') - self.sku = attributes[:'sku'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'identifier') - self.identifier = attributes[:'identifier'] - end - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - - if attributes.key?(:'offers') - self.offers = attributes[:'offers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @identifier.nil? - invalid_properties.push('invalid value for "identifier", identifier cannot be nil.') - end - - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - if @offers.nil? - invalid_properties.push('invalid value for "offers", offers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - return false if @status.nil? - return false if @identifier.nil? - return false if @summary.nil? - return false if @offers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin && - sku == o.sku && - item_condition == o.item_condition && - status == o.status && - identifier == o.identifier && - summary == o.summary && - offers == o.offers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin, sku, item_condition, status, identifier, summary, offers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_pricing_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_pricing_response.rb deleted file mode 100644 index 81ebf6b..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/get_pricing_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The response schema for the `getPricing` and `getCompetitivePricing` operations. - class GetPricingResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::GetPricingResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::GetPricingResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_method.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_method.rb deleted file mode 100644 index 99aefea..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_method.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class HttpMethod - GET = 'GET'.freeze - PUT = 'PUT'.freeze - PATCH = 'PATCH'.freeze - DELETE = 'DELETE'.freeze - POST = 'POST'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = HttpMethod.constants.select { |c| HttpMethod::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #HttpMethod" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_request_headers.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_request_headers.rb deleted file mode 100644 index f5f0176..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_request_headers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A mapping of additional HTTP headers to send/receive for the individual batch request. - class HttpRequestHeaders - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::HttpRequestHeaders` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::HttpRequestHeaders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_response_headers.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_response_headers.rb deleted file mode 100644 index 7c008e9..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/http_response_headers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A mapping of additional HTTP headers to send/receive for the individual batch request. - class HttpResponseHeaders - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::HttpResponseHeaders` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::HttpResponseHeaders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/identifier_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/identifier_type.rb deleted file mode 100644 index 3fa1e00..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/identifier_type.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Specifies the identifiers used to uniquely identify an item. - class IdentifierType - attr_accessor :marketplace_asin - - attr_accessor :sku_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_asin' => :'MarketplaceASIN', - :'sku_identifier' => :'SKUIdentifier' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_asin' => :'Object', - :'sku_identifier' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::IdentifierType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::IdentifierType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_asin') - self.marketplace_asin = attributes[:'marketplace_asin'] - end - - if attributes.key?(:'sku_identifier') - self.sku_identifier = attributes[:'sku_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_asin.nil? - invalid_properties.push('invalid value for "marketplace_asin", marketplace_asin cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_asin.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_asin == o.marketplace_asin && - sku_identifier == o.sku_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_asin, sku_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_condition.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_condition.rb deleted file mode 100644 index c52e1fd..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_condition.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class ItemCondition - NEW = 'New'.freeze - USED = 'Used'.freeze - COLLECTIBLE = 'Collectible'.freeze - REFURBISHED = 'Refurbished'.freeze - CLUB = 'Club'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ItemCondition.constants.select { |c| ItemCondition::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ItemCondition" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_identifier.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_identifier.rb deleted file mode 100644 index 5df55b0..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_identifier.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Information that identifies an item. - class ItemIdentifier - # A marketplace identifier. Specifies the marketplace from which prices are returned. - attr_accessor :marketplace_id - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # The seller stock keeping unit (SKU) of the item. - attr_accessor :seller_sku - - attr_accessor :item_condition - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'asin' => :'ASIN', - :'seller_sku' => :'SellerSKU', - :'item_condition' => :'ItemCondition' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object', - :'seller_sku' => :'Object', - :'item_condition' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin && - seller_sku == o.seller_sku && - item_condition == o.item_condition - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin, seller_sku, item_condition].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request.rb deleted file mode 100644 index badbf56..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # List of request parameters can be accepted by `ItemOffersRequests` operation - class ItemOffersRequest - attr_accessor :marketplace_id - - attr_accessor :item_condition - - attr_accessor :customer_type - - # The resource path of the operation you are calling in batch without any query parameters. If you are calling `getItemOffersBatch`, supply the path of `getItemOffers`. **Example:** `/products/pricing/v0/items/B000P6Q7MY/offers` If you are calling `getListingOffersBatch`, supply the path of `getListingOffers`. **Example:** `/products/pricing/v0/listings/B000P6Q7MY/offers` - attr_accessor :uri - - attr_accessor :method - - attr_accessor :headers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'item_condition' => :'ItemCondition', - :'customer_type' => :'CustomerType', - :'uri' => :'uri', - :'method' => :'method', - :'headers' => :'headers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'', - :'item_condition' => :'', - :'customer_type' => :'', - :'uri' => :'', - :'method' => :'', - :'headers' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemOffersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemOffersRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'customer_type') - self.customer_type = attributes[:'customer_type'] - end - - if attributes.key?(:'uri') - self.uri = attributes[:'uri'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - if @uri.nil? - invalid_properties.push('invalid value for "uri", uri cannot be nil.') - end - - if @method.nil? - invalid_properties.push('invalid value for "method", method cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - return false if @uri.nil? - return false if @method.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - item_condition == o.item_condition && - customer_type == o.customer_type && - uri == o.uri && - method == o.method && - headers == o.headers && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, item_condition, customer_type, uri, method, headers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_list.rb deleted file mode 100644 index 277172f..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of `getListingOffers` batched requests to run. - class ItemOffersRequestList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemOffersRequestList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemOffersRequestList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_params.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_params.rb deleted file mode 100644 index 35f1e5d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_request_params.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # List of request parameters that can be accepted by `ItemOffersRequest` - class ItemOffersRequestParams - # The Amazon Standard Identification Number (ASIN) of the item. This is the same Asin passed as a request parameter. - attr_accessor :asin - - attr_accessor :marketplace_id - - attr_accessor :item_condition - - attr_accessor :customer_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'Asin', - :'marketplace_id' => :'MarketplaceId', - :'item_condition' => :'ItemCondition', - :'customer_type' => :'CustomerType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'', - :'marketplace_id' => :'', - :'item_condition' => :'', - :'customer_type' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemOffersRequestParams` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemOffersRequestParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'customer_type') - self.customer_type = attributes[:'customer_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - marketplace_id == o.marketplace_id && - item_condition == o.item_condition && - customer_type == o.customer_type && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, marketplace_id, item_condition, customer_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response.rb deleted file mode 100644 index a550f18..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual `ItemOffersResponse` - class ItemOffersResponse - attr_accessor :request - - attr_accessor :headers - - attr_accessor :status - - attr_accessor :body - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request' => :'request', - :'headers' => :'headers', - :'status' => :'status', - :'body' => :'body' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'request' => :'', - :'headers' => :'', - :'status' => :'', - :'body' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemOffersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemOffersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'request') - self.request = attributes[:'request'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'body') - self.body = attributes[:'body'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @request.nil? - invalid_properties.push('invalid value for "request", request cannot be nil.') - end - - if @body.nil? - invalid_properties.push('invalid value for "body", body cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request.nil? - return false if @body.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request == o.request && - headers == o.headers && - status == o.status && - body == o.body && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request, headers, status, body].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response_list.rb deleted file mode 100644 index 25a386d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/item_offers_response_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of `getItemOffers` batched responses. - class ItemOffersResponseList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ItemOffersResponseList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ItemOffersResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request.rb deleted file mode 100644 index b8f3023..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # List of request parameters that can be accepted by `ListingOffersRequest` operation - class ListingOffersRequest - attr_accessor :marketplace_id - - attr_accessor :item_condition - - attr_accessor :customer_type - - # The resource path of the operation you are calling in batch without any query parameters. If you are calling `getItemOffersBatch`, supply the path of `getItemOffers`. **Example:** `/products/pricing/v0/items/B000P6Q7MY/offers` If you are calling `getListingOffersBatch`, supply the path of `getListingOffers`. **Example:** `/products/pricing/v0/listings/B000P6Q7MY/offers` - attr_accessor :uri - - attr_accessor :method - - attr_accessor :headers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'item_condition' => :'ItemCondition', - :'customer_type' => :'CustomerType', - :'uri' => :'uri', - :'method' => :'method', - :'headers' => :'headers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'', - :'item_condition' => :'', - :'customer_type' => :'', - :'uri' => :'', - :'method' => :'', - :'headers' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ListingOffersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ListingOffersRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'customer_type') - self.customer_type = attributes[:'customer_type'] - end - - if attributes.key?(:'uri') - self.uri = attributes[:'uri'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - if @uri.nil? - invalid_properties.push('invalid value for "uri", uri cannot be nil.') - end - - if @method.nil? - invalid_properties.push('invalid value for "method", method cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - return false if @uri.nil? - return false if @method.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - item_condition == o.item_condition && - customer_type == o.customer_type && - uri == o.uri && - method == o.method && - headers == o.headers && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, item_condition, customer_type, uri, method, headers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_list.rb deleted file mode 100644 index 283647d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of `getListingOffers` batched requests to run. - class ListingOffersRequestList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ListingOffersRequestList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ListingOffersRequestList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_params.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_params.rb deleted file mode 100644 index 7df7f2d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_request_params.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # List of request parameters that can be accepted by `ListingOffersRequest` - class ListingOffersRequestParams - # The seller stock keeping unit (SKU) of the item. This is the same SKU passed as a path parameter. - attr_accessor :seller_sku - - attr_accessor :marketplace_id - - attr_accessor :item_condition - - attr_accessor :customer_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'SellerSKU', - :'marketplace_id' => :'MarketplaceId', - :'item_condition' => :'ItemCondition', - :'customer_type' => :'CustomerType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'', - :'marketplace_id' => :'', - :'item_condition' => :'', - :'customer_type' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ListingOffersRequestParams` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ListingOffersRequestParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'customer_type') - self.customer_type = attributes[:'customer_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @marketplace_id.nil? - return false if @item_condition.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - marketplace_id == o.marketplace_id && - item_condition == o.item_condition && - customer_type == o.customer_type && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, marketplace_id, item_condition, customer_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response.rb deleted file mode 100644 index b0801e7..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual `ListingOffersResponse` - class ListingOffersResponse - attr_accessor :request - - attr_accessor :headers - - attr_accessor :status - - attr_accessor :body - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request' => :'request', - :'headers' => :'headers', - :'status' => :'status', - :'body' => :'body' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'request' => :'', - :'headers' => :'', - :'status' => :'', - :'body' => :'' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ListingOffersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ListingOffersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'request') - self.request = attributes[:'request'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'body') - self.body = attributes[:'body'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - if @body.nil? - invalid_properties.push('invalid value for "body", body cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @body.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request == o.request && - headers == o.headers && - status == o.status && - body == o.body && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request, headers, status, body].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response_list.rb deleted file mode 100644 index 7ff38e8..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/listing_offers_response_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of `getListingOffers` batched responses. - class ListingOffersResponseList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ListingOffersResponseList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ListingOffersResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_price_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_price_type.rb deleted file mode 100644 index 4072c42..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_price_type.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual lowest price. - class LowestPriceType - # Indicates the condition of the item. For example: New, Used, Collectible, Refurbished, or Club. - attr_accessor :condition - - # Indicates whether the item is fulfilled by Amazon or by the seller. - attr_accessor :fulfillment_channel - - attr_accessor :offer_type - - # Indicates at what quantity this price becomes active. - attr_accessor :quantity_tier - - attr_accessor :quantity_discount_type - - attr_accessor :landed_price - - attr_accessor :listing_price - - attr_accessor :shipping - - attr_accessor :points - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'fulfillment_channel' => :'fulfillmentChannel', - :'offer_type' => :'offerType', - :'quantity_tier' => :'quantityTier', - :'quantity_discount_type' => :'quantityDiscountType', - :'landed_price' => :'LandedPrice', - :'listing_price' => :'ListingPrice', - :'shipping' => :'Shipping', - :'points' => :'Points' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'Object', - :'fulfillment_channel' => :'Object', - :'offer_type' => :'Object', - :'quantity_tier' => :'Object', - :'quantity_discount_type' => :'Object', - :'landed_price' => :'Object', - :'listing_price' => :'Object', - :'shipping' => :'Object', - :'points' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::LowestPriceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::LowestPriceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'fulfillment_channel') - self.fulfillment_channel = attributes[:'fulfillment_channel'] - end - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'quantity_tier') - self.quantity_tier = attributes[:'quantity_tier'] - end - - if attributes.key?(:'quantity_discount_type') - self.quantity_discount_type = attributes[:'quantity_discount_type'] - end - - if attributes.key?(:'landed_price') - self.landed_price = attributes[:'landed_price'] - end - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - - if attributes.key?(:'shipping') - self.shipping = attributes[:'shipping'] - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @condition.nil? - invalid_properties.push('invalid value for "condition", condition cannot be nil.') - end - - if @fulfillment_channel.nil? - invalid_properties.push('invalid value for "fulfillment_channel", fulfillment_channel cannot be nil.') - end - - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @condition.nil? - return false if @fulfillment_channel.nil? - return false if @listing_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - fulfillment_channel == o.fulfillment_channel && - offer_type == o.offer_type && - quantity_tier == o.quantity_tier && - quantity_discount_type == o.quantity_discount_type && - landed_price == o.landed_price && - listing_price == o.listing_price && - shipping == o.shipping && - points == o.points - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, fulfillment_channel, offer_type, quantity_tier, quantity_discount_type, landed_price, listing_price, shipping, points].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_prices.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_prices.rb deleted file mode 100644 index 91f49e4..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/lowest_prices.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of the lowest prices. - class LowestPrices - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::LowestPrices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::LowestPrices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/marketplace_id.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/marketplace_id.rb deleted file mode 100644 index d61ee22..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/marketplace_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A marketplace identifier. Specifies the marketplace for which prices are returned. - class MarketplaceId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::MarketplaceId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::MarketplaceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/money_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/money_type.rb deleted file mode 100644 index 868d874..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/money_type.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Currency type and monetary value. Schema for demonstrating pricing info. - class MoneyType - # The currency code in ISO 4217 format. - attr_accessor :currency_code - - # The monetary value. - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'CurrencyCode', - :'amount' => :'Amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::MoneyType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::MoneyType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offer_listings_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offer_listings_list.rb deleted file mode 100644 index de65df0..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offer_listings_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The number of active offer listings for the item that was submitted. The listing count is returned by condition, one for each listing condition value that is returned. - class NumberOfOfferListingsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::NumberOfOfferListingsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::NumberOfOfferListingsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offers.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offers.rb deleted file mode 100644 index 81e44cf..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/number_of_offers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list that contains the total number of offers information for given conditions and fulfillment channels. - class NumberOfOffers - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::NumberOfOffers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::NumberOfOffers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_count_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_count_type.rb deleted file mode 100644 index 4018329..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_count_type.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The total number of offers for the specified condition and fulfillment channel. - class OfferCountType - # Indicates the condition of the item. For example: New, Used, Collectible, Refurbished, or Club. - attr_accessor :condition - - attr_accessor :fulfillment_channel - - # The number of offers in a fulfillment channel that meet a specific condition. - attr_accessor :offer_count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'fulfillment_channel' => :'fulfillmentChannel', - :'offer_count' => :'OfferCount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'Object', - :'fulfillment_channel' => :'Object', - :'offer_count' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OfferCountType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OfferCountType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'fulfillment_channel') - self.fulfillment_channel = attributes[:'fulfillment_channel'] - end - - if attributes.key?(:'offer_count') - self.offer_count = attributes[:'offer_count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - fulfillment_channel == o.fulfillment_channel && - offer_count == o.offer_count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, fulfillment_channel, offer_count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_customer_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_customer_type.rb deleted file mode 100644 index e693c7d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_customer_type.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class OfferCustomerType - B2_C = 'B2C'.freeze - B2_B = 'B2B'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = OfferCustomerType.constants.select { |c| OfferCustomerType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OfferCustomerType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail.rb deleted file mode 100644 index 8f0ca2e..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail.rb +++ /dev/null @@ -1,381 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual offer. Object in `OfferDetailList`. - class OfferDetail - # When true, this is the seller's offer. - attr_accessor :my_offer - - attr_accessor :offer_type - - # The subcondition of the item. Subcondition values: New, Mint, Very Good, Good, Acceptable, Poor, Club, OEM, Warranty, Refurbished Warranty, Refurbished, Open Box, or Other. - attr_accessor :sub_condition - - # The seller identifier for the offer. - attr_accessor :seller_id - - # Information about the condition of the item. - attr_accessor :condition_notes - - attr_accessor :seller_feedback_rating - - attr_accessor :shipping_time - - attr_accessor :listing_price - - # List of `QuantityDiscountPrice` that contains item's pricing information when buy in bulk. - attr_accessor :quantity_discount_prices - - attr_accessor :points - - attr_accessor :shipping - - attr_accessor :ships_from - - # When true, the offer is fulfilled by Amazon. - attr_accessor :is_fulfilled_by_amazon - - attr_accessor :prime_information - - # When true, the offer is currently in the Buy Box. There can be up to two Buy Box winners at any time per ASIN, one that is eligible for Prime and one that is not eligible for Prime. - attr_accessor :is_buy_box_winner - - # When true, the seller of the item is eligible to win the Buy Box. - attr_accessor :is_featured_merchant - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'my_offer' => :'MyOffer', - :'offer_type' => :'offerType', - :'sub_condition' => :'SubCondition', - :'seller_id' => :'SellerId', - :'condition_notes' => :'ConditionNotes', - :'seller_feedback_rating' => :'SellerFeedbackRating', - :'shipping_time' => :'ShippingTime', - :'listing_price' => :'ListingPrice', - :'quantity_discount_prices' => :'quantityDiscountPrices', - :'points' => :'Points', - :'shipping' => :'Shipping', - :'ships_from' => :'ShipsFrom', - :'is_fulfilled_by_amazon' => :'IsFulfilledByAmazon', - :'prime_information' => :'PrimeInformation', - :'is_buy_box_winner' => :'IsBuyBoxWinner', - :'is_featured_merchant' => :'IsFeaturedMerchant' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'my_offer' => :'Object', - :'offer_type' => :'Object', - :'sub_condition' => :'Object', - :'seller_id' => :'Object', - :'condition_notes' => :'Object', - :'seller_feedback_rating' => :'Object', - :'shipping_time' => :'Object', - :'listing_price' => :'Object', - :'quantity_discount_prices' => :'Object', - :'points' => :'Object', - :'shipping' => :'Object', - :'ships_from' => :'Object', - :'is_fulfilled_by_amazon' => :'Object', - :'prime_information' => :'Object', - :'is_buy_box_winner' => :'Object', - :'is_featured_merchant' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OfferDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OfferDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'my_offer') - self.my_offer = attributes[:'my_offer'] - end - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'sub_condition') - self.sub_condition = attributes[:'sub_condition'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - - if attributes.key?(:'condition_notes') - self.condition_notes = attributes[:'condition_notes'] - end - - if attributes.key?(:'seller_feedback_rating') - self.seller_feedback_rating = attributes[:'seller_feedback_rating'] - end - - if attributes.key?(:'shipping_time') - self.shipping_time = attributes[:'shipping_time'] - end - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - - if attributes.key?(:'quantity_discount_prices') - if (value = attributes[:'quantity_discount_prices']).is_a?(Array) - self.quantity_discount_prices = value - end - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - - if attributes.key?(:'shipping') - self.shipping = attributes[:'shipping'] - end - - if attributes.key?(:'ships_from') - self.ships_from = attributes[:'ships_from'] - end - - if attributes.key?(:'is_fulfilled_by_amazon') - self.is_fulfilled_by_amazon = attributes[:'is_fulfilled_by_amazon'] - end - - if attributes.key?(:'prime_information') - self.prime_information = attributes[:'prime_information'] - end - - if attributes.key?(:'is_buy_box_winner') - self.is_buy_box_winner = attributes[:'is_buy_box_winner'] - end - - if attributes.key?(:'is_featured_merchant') - self.is_featured_merchant = attributes[:'is_featured_merchant'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sub_condition.nil? - invalid_properties.push('invalid value for "sub_condition", sub_condition cannot be nil.') - end - - if @shipping_time.nil? - invalid_properties.push('invalid value for "shipping_time", shipping_time cannot be nil.') - end - - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - if @shipping.nil? - invalid_properties.push('invalid value for "shipping", shipping cannot be nil.') - end - - if @is_fulfilled_by_amazon.nil? - invalid_properties.push('invalid value for "is_fulfilled_by_amazon", is_fulfilled_by_amazon cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sub_condition.nil? - return false if @shipping_time.nil? - return false if @listing_price.nil? - return false if @shipping.nil? - return false if @is_fulfilled_by_amazon.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - my_offer == o.my_offer && - offer_type == o.offer_type && - sub_condition == o.sub_condition && - seller_id == o.seller_id && - condition_notes == o.condition_notes && - seller_feedback_rating == o.seller_feedback_rating && - shipping_time == o.shipping_time && - listing_price == o.listing_price && - quantity_discount_prices == o.quantity_discount_prices && - points == o.points && - shipping == o.shipping && - ships_from == o.ships_from && - is_fulfilled_by_amazon == o.is_fulfilled_by_amazon && - prime_information == o.prime_information && - is_buy_box_winner == o.is_buy_box_winner && - is_featured_merchant == o.is_featured_merchant - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [my_offer, offer_type, sub_condition, seller_id, condition_notes, seller_feedback_rating, shipping_time, listing_price, quantity_discount_prices, points, shipping, ships_from, is_fulfilled_by_amazon, prime_information, is_buy_box_winner, is_featured_merchant].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail_list.rb deleted file mode 100644 index 06208b3..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_detail_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of offer details. The list is the same length as the TotalOfferCount in the Summary or 20, whichever is less. - class OfferDetailList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OfferDetailList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OfferDetailList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_listing_count_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_listing_count_type.rb deleted file mode 100644 index fe99273..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_listing_count_type.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The number of offer listings with the specified condition. - class OfferListingCountType - # The number of offer listings. - attr_accessor :count - - # The condition of the item. - attr_accessor :condition - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'count' => :'Count', - :'condition' => :'condition' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'count' => :'Object', - :'condition' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OfferListingCountType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OfferListingCountType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'count') - self.count = attributes[:'count'] - end - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @count.nil? - invalid_properties.push('invalid value for "count", count cannot be nil.') - end - - if @condition.nil? - invalid_properties.push('invalid value for "condition", condition cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @count.nil? - return false if @condition.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - count == o.count && - condition == o.condition - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [count, condition].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_type.rb deleted file mode 100644 index 15a445b..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offer_type.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for an individual offer. - class OfferType - attr_accessor :offer_type - - attr_accessor :buying_price - - attr_accessor :regular_price - - attr_accessor :business_price - - # List of `QuantityDiscountPrice` that contains item's pricing information when buy in bulk. - attr_accessor :quantity_discount_prices - - # The fulfillment channel for the offer listing. Possible values: * Amazon - Fulfilled by Amazon. * Merchant - Fulfilled by the seller. - attr_accessor :fulfillment_channel - - # The item condition for the offer listing. Possible values: New, Used, Collectible, Refurbished, or Club. - attr_accessor :item_condition - - # The item subcondition for the offer listing. Possible values: New, Mint, Very Good, Good, Acceptable, Poor, Club, OEM, Warranty, Refurbished Warranty, Refurbished, Open Box, or Other. - attr_accessor :item_sub_condition - - # The seller stock keeping unit (SKU) of the item. - attr_accessor :seller_sku - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offer_type' => :'offerType', - :'buying_price' => :'BuyingPrice', - :'regular_price' => :'RegularPrice', - :'business_price' => :'businessPrice', - :'quantity_discount_prices' => :'quantityDiscountPrices', - :'fulfillment_channel' => :'FulfillmentChannel', - :'item_condition' => :'ItemCondition', - :'item_sub_condition' => :'ItemSubCondition', - :'seller_sku' => :'SellerSKU' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'offer_type' => :'Object', - :'buying_price' => :'Object', - :'regular_price' => :'Object', - :'business_price' => :'Object', - :'quantity_discount_prices' => :'Object', - :'fulfillment_channel' => :'Object', - :'item_condition' => :'Object', - :'item_sub_condition' => :'Object', - :'seller_sku' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OfferType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OfferType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'buying_price') - self.buying_price = attributes[:'buying_price'] - end - - if attributes.key?(:'regular_price') - self.regular_price = attributes[:'regular_price'] - end - - if attributes.key?(:'business_price') - self.business_price = attributes[:'business_price'] - end - - if attributes.key?(:'quantity_discount_prices') - if (value = attributes[:'quantity_discount_prices']).is_a?(Array) - self.quantity_discount_prices = value - end - end - - if attributes.key?(:'fulfillment_channel') - self.fulfillment_channel = attributes[:'fulfillment_channel'] - end - - if attributes.key?(:'item_condition') - self.item_condition = attributes[:'item_condition'] - end - - if attributes.key?(:'item_sub_condition') - self.item_sub_condition = attributes[:'item_sub_condition'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @buying_price.nil? - invalid_properties.push('invalid value for "buying_price", buying_price cannot be nil.') - end - - if @regular_price.nil? - invalid_properties.push('invalid value for "regular_price", regular_price cannot be nil.') - end - - if @fulfillment_channel.nil? - invalid_properties.push('invalid value for "fulfillment_channel", fulfillment_channel cannot be nil.') - end - - if @item_condition.nil? - invalid_properties.push('invalid value for "item_condition", item_condition cannot be nil.') - end - - if @item_sub_condition.nil? - invalid_properties.push('invalid value for "item_sub_condition", item_sub_condition cannot be nil.') - end - - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @buying_price.nil? - return false if @regular_price.nil? - return false if @fulfillment_channel.nil? - return false if @item_condition.nil? - return false if @item_sub_condition.nil? - return false if @seller_sku.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offer_type == o.offer_type && - buying_price == o.buying_price && - regular_price == o.regular_price && - business_price == o.business_price && - quantity_discount_prices == o.quantity_discount_prices && - fulfillment_channel == o.fulfillment_channel && - item_condition == o.item_condition && - item_sub_condition == o.item_sub_condition && - seller_sku == o.seller_sku - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offer_type, buying_price, regular_price, business_price, quantity_discount_prices, fulfillment_channel, item_condition, item_sub_condition, seller_sku].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offers_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offers_list.rb deleted file mode 100644 index 4f6058e..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/offers_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of offers. - class OffersList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::OffersList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::OffersList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/points.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/points.rb deleted file mode 100644 index e178717..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/points.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The number of Amazon Points offered with the purchase of an item, and their monetary value. - class Points - # The number of points. - attr_accessor :points_number - - attr_accessor :points_monetary_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'points_number' => :'PointsNumber', - :'points_monetary_value' => :'PointsMonetaryValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'points_number' => :'Object', - :'points_monetary_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Points` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Points`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'points_number') - self.points_number = attributes[:'points_number'] - end - - if attributes.key?(:'points_monetary_value') - self.points_monetary_value = attributes[:'points_monetary_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - points_number == o.points_number && - points_monetary_value == o.points_monetary_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [points_number, points_monetary_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price.rb deleted file mode 100644 index a113be6..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for price info in `getPricing` response - class Price - # The status of the operation. - attr_accessor :status - - # The seller stock keeping unit (SKU) of the item. - attr_accessor :seller_sku - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - attr_accessor :product - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'seller_sku' => :'SellerSKU', - :'asin' => :'ASIN', - :'product' => :'Product' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object', - :'seller_sku' => :'Object', - :'asin' => :'Object', - :'product' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Price` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Price`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'product') - self.product = attributes[:'product'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - seller_sku == o.seller_sku && - asin == o.asin && - product == o.product - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, seller_sku, asin, product].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_list.rb deleted file mode 100644 index 195a51e..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The payload for the `getPricing` and `getCompetitivePricing` operations. - class PriceList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::PriceList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::PriceList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_type.rb deleted file mode 100644 index 97550d7..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/price_type.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema for item's price information, including listing price, shipping price, and Amazon points. - class PriceType - attr_accessor :landed_price - - attr_accessor :listing_price - - attr_accessor :shipping - - attr_accessor :points - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'landed_price' => :'LandedPrice', - :'listing_price' => :'ListingPrice', - :'shipping' => :'Shipping', - :'points' => :'Points' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'landed_price' => :'Object', - :'listing_price' => :'Object', - :'shipping' => :'Object', - :'points' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::PriceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::PriceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'landed_price') - self.landed_price = attributes[:'landed_price'] - end - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - - if attributes.key?(:'shipping') - self.shipping = attributes[:'shipping'] - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @listing_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - landed_price == o.landed_price && - listing_price == o.listing_price && - shipping == o.shipping && - points == o.points - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [landed_price, listing_price, shipping, points].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/prime_information_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/prime_information_type.rb deleted file mode 100644 index a0b6b84..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/prime_information_type.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Amazon Prime information. - class PrimeInformationType - # Indicates whether the offer is an Amazon Prime offer. - attr_accessor :is_prime - - # Indicates whether the offer is an Amazon Prime offer throughout the entire marketplace where it is listed. - attr_accessor :is_national_prime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_prime' => :'IsPrime', - :'is_national_prime' => :'IsNationalPrime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_prime' => :'Object', - :'is_national_prime' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::PrimeInformationType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::PrimeInformationType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_prime') - self.is_prime = attributes[:'is_prime'] - end - - if attributes.key?(:'is_national_prime') - self.is_national_prime = attributes[:'is_national_prime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_prime.nil? - invalid_properties.push('invalid value for "is_prime", is_prime cannot be nil.') - end - - if @is_national_prime.nil? - invalid_properties.push('invalid value for "is_national_prime", is_national_prime cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_prime.nil? - return false if @is_national_prime.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_prime == o.is_prime && - is_national_prime == o.is_national_prime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_prime, is_national_prime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/product.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/product.rb deleted file mode 100644 index 554c87d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/product.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # An item. - class Product - attr_accessor :identifiers - - attr_accessor :attribute_sets - - attr_accessor :relationships - - attr_accessor :competitive_pricing - - attr_accessor :sales_rankings - - attr_accessor :offers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identifiers' => :'Identifiers', - :'attribute_sets' => :'AttributeSets', - :'relationships' => :'Relationships', - :'competitive_pricing' => :'CompetitivePricing', - :'sales_rankings' => :'SalesRankings', - :'offers' => :'Offers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'identifiers' => :'Object', - :'attribute_sets' => :'Object', - :'relationships' => :'Object', - :'competitive_pricing' => :'Object', - :'sales_rankings' => :'Object', - :'offers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Product` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Product`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identifiers') - self.identifiers = attributes[:'identifiers'] - end - - if attributes.key?(:'attribute_sets') - self.attribute_sets = attributes[:'attribute_sets'] - end - - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] - end - - if attributes.key?(:'competitive_pricing') - self.competitive_pricing = attributes[:'competitive_pricing'] - end - - if attributes.key?(:'sales_rankings') - self.sales_rankings = attributes[:'sales_rankings'] - end - - if attributes.key?(:'offers') - self.offers = attributes[:'offers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identifiers.nil? - invalid_properties.push('invalid value for "identifiers", identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identifiers == o.identifiers && - attribute_sets == o.attribute_sets && - relationships == o.relationships && - competitive_pricing == o.competitive_pricing && - sales_rankings == o.sales_rankings && - offers == o.offers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identifiers, attribute_sets, relationships, competitive_pricing, sales_rankings, offers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_price_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_price_type.rb deleted file mode 100644 index eaa56dd..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_price_type.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Contains pricing information that includes special pricing when buying in bulk. - class QuantityDiscountPriceType - # Indicates at what quantity this price becomes active. - attr_accessor :quantity_tier - - attr_accessor :quantity_discount_type - - attr_accessor :listing_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'quantity_tier' => :'quantityTier', - :'quantity_discount_type' => :'quantityDiscountType', - :'listing_price' => :'listingPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'quantity_tier' => :'Object', - :'quantity_discount_type' => :'Object', - :'listing_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::QuantityDiscountPriceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::QuantityDiscountPriceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'quantity_tier') - self.quantity_tier = attributes[:'quantity_tier'] - end - - if attributes.key?(:'quantity_discount_type') - self.quantity_discount_type = attributes[:'quantity_discount_type'] - end - - if attributes.key?(:'listing_price') - self.listing_price = attributes[:'listing_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @quantity_tier.nil? - invalid_properties.push('invalid value for "quantity_tier", quantity_tier cannot be nil.') - end - - if @quantity_discount_type.nil? - invalid_properties.push('invalid value for "quantity_discount_type", quantity_discount_type cannot be nil.') - end - - if @listing_price.nil? - invalid_properties.push('invalid value for "listing_price", listing_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @quantity_tier.nil? - return false if @quantity_discount_type.nil? - return false if @listing_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - quantity_tier == o.quantity_tier && - quantity_discount_type == o.quantity_discount_type && - listing_price == o.listing_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [quantity_tier, quantity_discount_type, listing_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_type.rb deleted file mode 100644 index 2c12bcf..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/quantity_discount_type.rb +++ /dev/null @@ -1,29 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - class QuantityDiscountType - QUANTITY_DISCOUNT = 'QUANTITY_DISCOUNT'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = QuantityDiscountType.constants.select { |c| QuantityDiscountType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #QuantityDiscountType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/relationship_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/relationship_list.rb deleted file mode 100644 index 3de186d..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/relationship_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list that contains product variation information, if applicable. - class RelationshipList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::RelationshipList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::RelationshipList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_list.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_list.rb deleted file mode 100644 index b79f91e..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # A list of sales rank information for the item, by category. - class SalesRankList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::SalesRankList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::SalesRankList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_type.rb deleted file mode 100644 index 0494164..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/sales_rank_type.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Sales rank information for the item, by category - class SalesRankType - # Identifies the item category from which the sales rank is taken. - attr_accessor :product_category_id - - # The sales rank of the item within the item category. - attr_accessor :rank - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_category_id' => :'ProductCategoryId', - :'rank' => :'Rank' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_category_id' => :'Object', - :'rank' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::SalesRankType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::SalesRankType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_category_id') - self.product_category_id = attributes[:'product_category_id'] - end - - if attributes.key?(:'rank') - self.rank = attributes[:'rank'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product_category_id.nil? - invalid_properties.push('invalid value for "product_category_id", product_category_id cannot be nil.') - end - - if @rank.nil? - invalid_properties.push('invalid value for "rank", rank cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product_category_id.nil? - return false if @rank.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_category_id == o.product_category_id && - rank == o.rank - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_category_id, rank].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_feedback_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_feedback_type.rb deleted file mode 100644 index 820430b..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_feedback_type.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Information about the seller's feedback, including the percentage of positive feedback, and the total number of ratings received. - class SellerFeedbackType - # The percentage of positive feedback for the seller in the past 365 days. - attr_accessor :seller_positive_feedback_rating - - # The number of ratings received about the seller. - attr_accessor :feedback_count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_positive_feedback_rating' => :'SellerPositiveFeedbackRating', - :'feedback_count' => :'FeedbackCount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_positive_feedback_rating' => :'Object', - :'feedback_count' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::SellerFeedbackType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::SellerFeedbackType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_positive_feedback_rating') - self.seller_positive_feedback_rating = attributes[:'seller_positive_feedback_rating'] - end - - if attributes.key?(:'feedback_count') - self.feedback_count = attributes[:'feedback_count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feedback_count.nil? - invalid_properties.push('invalid value for "feedback_count", feedback_count cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feedback_count.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_positive_feedback_rating == o.seller_positive_feedback_rating && - feedback_count == o.feedback_count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_positive_feedback_rating, feedback_count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_sku_identifier.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_sku_identifier.rb deleted file mode 100644 index d603db8..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/seller_sku_identifier.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Schema to identify an item by MarketPlaceId, SellerId, and SellerSKU. - class SellerSKUIdentifier - # A marketplace identifier. - attr_accessor :marketplace_id - - # The seller identifier submitted for the operation. - attr_accessor :seller_id - - # The seller stock keeping unit (SKU) of the item. - attr_accessor :seller_sku - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'MarketplaceId', - :'seller_id' => :'SellerId', - :'seller_sku' => :'SellerSKU' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'seller_id' => :'Object', - :'seller_sku' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::SellerSKUIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::SellerSKUIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @seller_id.nil? - invalid_properties.push('invalid value for "seller_id", seller_id cannot be nil.') - end - - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @seller_id.nil? - return false if @seller_sku.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - seller_id == o.seller_id && - seller_sku == o.seller_sku - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, seller_id, seller_sku].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/ships_from_type.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/ships_from_type.rb deleted file mode 100644 index a6fac01..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/ships_from_type.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # The state and country from where the item is shipped. - class ShipsFromType - # The state from where the item is shipped. - attr_accessor :state - - # The country from where the item is shipped. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'State', - :'country' => :'Country' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'Object', - :'country' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::ShipsFromType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::ShipsFromType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/summary.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/summary.rb deleted file mode 100644 index 8ddb8d1..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/models/summary.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpProductPricingV0 - # Contains price information about the product, including the LowestPrices and BuyBoxPrices, the ListPrice, the SuggestedLowerPricePlusShipping, and NumberOfOffers and NumberOfBuyBoxEligibleOffers. - class Summary - # The number of unique offers contained in NumberOfOffers. - attr_accessor :total_offer_count - - attr_accessor :number_of_offers - - attr_accessor :lowest_prices - - attr_accessor :buy_box_prices - - attr_accessor :list_price - - attr_accessor :competitive_price_threshold - - attr_accessor :suggested_lower_price_plus_shipping - - attr_accessor :sales_rankings - - attr_accessor :buy_box_eligible_offers - - # When the status is ActiveButTooSoonForProcessing, this is the time when the offers will be available for processing. - attr_accessor :offers_available_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_offer_count' => :'TotalOfferCount', - :'number_of_offers' => :'NumberOfOffers', - :'lowest_prices' => :'LowestPrices', - :'buy_box_prices' => :'BuyBoxPrices', - :'list_price' => :'ListPrice', - :'competitive_price_threshold' => :'CompetitivePriceThreshold', - :'suggested_lower_price_plus_shipping' => :'SuggestedLowerPricePlusShipping', - :'sales_rankings' => :'SalesRankings', - :'buy_box_eligible_offers' => :'BuyBoxEligibleOffers', - :'offers_available_time' => :'OffersAvailableTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_offer_count' => :'Object', - :'number_of_offers' => :'Object', - :'lowest_prices' => :'Object', - :'buy_box_prices' => :'Object', - :'list_price' => :'Object', - :'competitive_price_threshold' => :'Object', - :'suggested_lower_price_plus_shipping' => :'Object', - :'sales_rankings' => :'Object', - :'buy_box_eligible_offers' => :'Object', - :'offers_available_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpProductPricingV0::Summary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpProductPricingV0::Summary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_offer_count') - self.total_offer_count = attributes[:'total_offer_count'] - end - - if attributes.key?(:'number_of_offers') - self.number_of_offers = attributes[:'number_of_offers'] - end - - if attributes.key?(:'lowest_prices') - self.lowest_prices = attributes[:'lowest_prices'] - end - - if attributes.key?(:'buy_box_prices') - self.buy_box_prices = attributes[:'buy_box_prices'] - end - - if attributes.key?(:'list_price') - self.list_price = attributes[:'list_price'] - end - - if attributes.key?(:'competitive_price_threshold') - self.competitive_price_threshold = attributes[:'competitive_price_threshold'] - end - - if attributes.key?(:'suggested_lower_price_plus_shipping') - self.suggested_lower_price_plus_shipping = attributes[:'suggested_lower_price_plus_shipping'] - end - - if attributes.key?(:'sales_rankings') - self.sales_rankings = attributes[:'sales_rankings'] - end - - if attributes.key?(:'buy_box_eligible_offers') - self.buy_box_eligible_offers = attributes[:'buy_box_eligible_offers'] - end - - if attributes.key?(:'offers_available_time') - self.offers_available_time = attributes[:'offers_available_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @total_offer_count.nil? - invalid_properties.push('invalid value for "total_offer_count", total_offer_count cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @total_offer_count.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_offer_count == o.total_offer_count && - number_of_offers == o.number_of_offers && - lowest_prices == o.lowest_prices && - buy_box_prices == o.buy_box_prices && - list_price == o.list_price && - competitive_price_threshold == o.competitive_price_threshold && - suggested_lower_price_plus_shipping == o.suggested_lower_price_plus_shipping && - sales_rankings == o.sales_rankings && - buy_box_eligible_offers == o.buy_box_eligible_offers && - offers_available_time == o.offers_available_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_offer_count, number_of_offers, lowest_prices, buy_box_prices, list_price, competitive_price_threshold, suggested_lower_price_plus_shipping, sales_rankings, buy_box_eligible_offers, offers_available_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpProductPricingV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/version.rb b/vendor/product_pricing_v0/lib/sp_product_pricing_v0/version.rb deleted file mode 100644 index c675d52..0000000 --- a/vendor/product_pricing_v0/lib/sp_product_pricing_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpProductPricingV0 - VERSION = '1.0.0' -end diff --git a/vendor/product_pricing_v0/sp_product_pricing_v0.gemspec b/vendor/product_pricing_v0/sp_product_pricing_v0.gemspec deleted file mode 100644 index 1ecee57..0000000 --- a/vendor/product_pricing_v0/sp_product_pricing_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Pricing - -#The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_product_pricing_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_product_pricing_v0" - s.version = SpProductPricingV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Pricing Ruby Gem" - s.description = "The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/sales/.gitignore b/vendor/sales/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/sales/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/sales/.rspec b/vendor/sales/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/sales/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/sales/.rubocop.yml b/vendor/sales/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/sales/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/sales/.swagger-codegen-ignore b/vendor/sales/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/sales/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/sales/.swagger-codegen/VERSION b/vendor/sales/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/sales/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/sales/Gemfile b/vendor/sales/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/sales/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/sales/README.md b/vendor/sales/README.md deleted file mode 100644 index 64ed57a..0000000 --- a/vendor/sales/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# sp_sales - -SpSales - the Ruby gem for the Selling Partner API for Sales - -The Selling Partner API for Sales provides APIs related to sales performance. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_sales.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_sales-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_sales-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_sales', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_sales', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_sales' - -api_instance = SpSales::SalesApi.new -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. For example, ATVPDKIKX0DER indicates the US marketplace. -interval = 'interval_example' # String | A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone. -granularity = 'granularity_example' # String | The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone. -opts = { - granularity_time_zone: 'granularity_time_zone_example', # String | An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone. - buyer_type: 'All', # String | Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers. - fulfillment_network: 'fulfillment_network_example', # String | Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network. - first_day_of_week: 'Monday', # String | Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday. - asin: 'asin_example', # String | Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN. - sku: 'sku_example' # String | Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU. -} - -begin - result = api_instance.get_order_metrics(marketplace_ids, interval, granularity, opts) - p result -rescue SpSales::ApiError => e - puts "Exception when calling SalesApi->get_order_metrics: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpSales::SalesApi* | [**get_order_metrics**](docs/SalesApi.md#get_order_metrics) | **GET** /sales/v1/orderMetrics | - -## Documentation for Models - - - [SpSales::Decimal](docs/Decimal.md) - - [SpSales::Error](docs/Error.md) - - [SpSales::ErrorList](docs/ErrorList.md) - - [SpSales::GetOrderMetricsResponse](docs/GetOrderMetricsResponse.md) - - [SpSales::Money](docs/Money.md) - - [SpSales::OrderMetricsInterval](docs/OrderMetricsInterval.md) - - [SpSales::OrderMetricsList](docs/OrderMetricsList.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/sales/Rakefile b/vendor/sales/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/sales/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/sales/git_push.sh b/vendor/sales/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/sales/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/sales/lib/sp_sales.rb b/vendor/sales/lib/sp_sales.rb deleted file mode 100644 index 4d4397c..0000000 --- a/vendor/sales/lib/sp_sales.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_sales/api_client' -# require 'sp_sales/api_error' -# require 'sp_sales/version' -# require 'sp_sales/configuration' - -# Models -# -# -# require_relative './sp_sales/models/decimal' -# -# -# require_relative './sp_sales/models/error' -# -# -# require_relative './sp_sales/models/error_list' -# -# -# require_relative './sp_sales/models/get_order_metrics_response' -# -# -# require_relative './sp_sales/models/money' -# -# -# require_relative './sp_sales/models/order_metrics_interval' -# -# -# require_relative './sp_sales/models/order_metrics_list' -# - -# APIs -require_relative './sp_sales/api/sales_api' diff --git a/vendor/sales/lib/sp_sales/api/sales_api.rb b/vendor/sales/lib/sp_sales/api/sales_api.rb deleted file mode 100644 index 181f0c8..0000000 --- a/vendor/sales/lib/sp_sales/api/sales_api.rb +++ /dev/null @@ -1,119 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSales - class SalesApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. For example, ATVPDKIKX0DER indicates the US marketplace. - # @param interval A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone. - # @param granularity The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone. - # @param [Hash] opts the optional parameters - # @option opts [String] :granularity_time_zone An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone. - # @option opts [String] :buyer_type Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers. (default to All) - # @option opts [String] :fulfillment_network Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network. - # @option opts [String] :first_day_of_week Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday. (default to Monday) - # @option opts [String] :asin Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN. - # @option opts [String] :sku Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU. - # @return [GetOrderMetricsResponse] - def get_order_metrics(marketplace_ids, interval, granularity, opts = {}) - data = get_order_metrics_with_http_info(marketplace_ids, interval, granularity, opts) - return data - end - - # Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. For example, ATVPDKIKX0DER indicates the US marketplace. - # @param interval A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone. - # @param granularity The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone. - # @param [Hash] opts the optional parameters - # @option opts [String] :granularity_time_zone An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone. - # @option opts [String] :buyer_type Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers. - # @option opts [String] :fulfillment_network Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network. - # @option opts [String] :first_day_of_week Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday. - # @option opts [String] :asin Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN. - # @option opts [String] :sku Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU. - # @return [Array<(GetOrderMetricsResponse)>] GetOrderMetricsResponse data, response status code and response headers - def get_order_metrics_with_http_info(marketplace_ids, interval, granularity, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SalesApi.get_order_metrics ...' - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling SalesApi.get_order_metrics" - end - # verify the required parameter 'interval' is set - if @api_client.config.client_side_validation && interval.nil? - fail ArgumentError, "Missing the required parameter 'interval' when calling SalesApi.get_order_metrics" - end - # verify the required parameter 'granularity' is set - if @api_client.config.client_side_validation && granularity.nil? - fail ArgumentError, "Missing the required parameter 'granularity' when calling SalesApi.get_order_metrics" - end - # verify enum value - if @api_client.config.client_side_validation && !['Hour', 'Day', 'Week', 'Month', 'Year', 'Total'].include?(granularity) - fail ArgumentError, "invalid value for 'granularity', must be one of Hour, Day, Week, Month, Year, Total" - end - if @api_client.config.client_side_validation && opts[:'buyer_type'] && !['B2B', 'B2C', 'All'].include?(opts[:'buyer_type']) - fail ArgumentError, 'invalid value for "buyer_type", must be one of B2B, B2C, All' - end - if @api_client.config.client_side_validation && opts[:'first_day_of_week'] && !['Monday', 'Sunday'].include?(opts[:'first_day_of_week']) - fail ArgumentError, 'invalid value for "first_day_of_week", must be one of Monday, Sunday' - end - # resource path - local_var_path = '/sales/v1/orderMetrics' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'interval'] = interval - query_params[:'granularity'] = granularity - query_params[:'granularityTimeZone'] = opts[:'granularity_time_zone'] if !opts[:'granularity_time_zone'].nil? - query_params[:'buyerType'] = opts[:'buyer_type'] if !opts[:'buyer_type'].nil? - query_params[:'fulfillmentNetwork'] = opts[:'fulfillment_network'] if !opts[:'fulfillment_network'].nil? - query_params[:'firstDayOfWeek'] = opts[:'first_day_of_week'] if !opts[:'first_day_of_week'].nil? - query_params[:'asin'] = opts[:'asin'] if !opts[:'asin'].nil? - query_params[:'sku'] = opts[:'sku'] if !opts[:'sku'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'payload']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SalesApi#get_order_metrics\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/sales/lib/sp_sales/api_client.rb b/vendor/sales/lib/sp_sales/api_client.rb deleted file mode 100644 index 28ebd4a..0000000 --- a/vendor/sales/lib/sp_sales/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpSales - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpSales.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/sales/lib/sp_sales/api_error.rb b/vendor/sales/lib/sp_sales/api_error.rb deleted file mode 100644 index fc01b8e..0000000 --- a/vendor/sales/lib/sp_sales/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSales - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/sales/lib/sp_sales/configuration.rb b/vendor/sales/lib/sp_sales/configuration.rb deleted file mode 100644 index 4786128..0000000 --- a/vendor/sales/lib/sp_sales/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSales - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/sales/lib/sp_sales/models/decimal.rb b/vendor/sales/lib/sp_sales/models/decimal.rb deleted file mode 100644 index d215420..0000000 --- a/vendor/sales/lib/sp_sales/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # A decimal number with no loss of precision. Useful when precision loss is unnaceptable, as with currencies. Follows RFC7159 for number representation. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/error.rb b/vendor/sales/lib/sp_sales/models/error.rb deleted file mode 100644 index 79be8a2..0000000 --- a/vendor/sales/lib/sp_sales/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occured. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/error_list.rb b/vendor/sales/lib/sp_sales/models/error_list.rb deleted file mode 100644 index 939dca2..0000000 --- a/vendor/sales/lib/sp_sales/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/get_order_metrics_response.rb b/vendor/sales/lib/sp_sales/models/get_order_metrics_response.rb deleted file mode 100644 index 41120df..0000000 --- a/vendor/sales/lib/sp_sales/models/get_order_metrics_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # The response schema for the getOrderMetrics operation. - class GetOrderMetricsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::GetOrderMetricsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::GetOrderMetricsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/money.rb b/vendor/sales/lib/sp_sales/models/money.rb deleted file mode 100644 index ed8323b..0000000 --- a/vendor/sales/lib/sp_sales/models/money.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # The currency type and the amount. - class Money - # Three-digit currency code. In ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/order_metrics_interval.rb b/vendor/sales/lib/sp_sales/models/order_metrics_interval.rb deleted file mode 100644 index b57e9aa..0000000 --- a/vendor/sales/lib/sp_sales/models/order_metrics_interval.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # Contains order metrics. - class OrderMetricsInterval - # The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data). - attr_accessor :interval - - # The number of units in orders based on the specified filters. - attr_accessor :unit_count - - # The number of order items based on the specified filters. - attr_accessor :order_item_count - - # The number of orders based on the specified filters. - attr_accessor :order_count - - attr_accessor :average_unit_price - - attr_accessor :total_sales - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interval' => :'interval', - :'unit_count' => :'unitCount', - :'order_item_count' => :'orderItemCount', - :'order_count' => :'orderCount', - :'average_unit_price' => :'averageUnitPrice', - :'total_sales' => :'totalSales' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'interval' => :'Object', - :'unit_count' => :'Object', - :'order_item_count' => :'Object', - :'order_count' => :'Object', - :'average_unit_price' => :'Object', - :'total_sales' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::OrderMetricsInterval` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::OrderMetricsInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interval') - self.interval = attributes[:'interval'] - end - - if attributes.key?(:'unit_count') - self.unit_count = attributes[:'unit_count'] - end - - if attributes.key?(:'order_item_count') - self.order_item_count = attributes[:'order_item_count'] - end - - if attributes.key?(:'order_count') - self.order_count = attributes[:'order_count'] - end - - if attributes.key?(:'average_unit_price') - self.average_unit_price = attributes[:'average_unit_price'] - end - - if attributes.key?(:'total_sales') - self.total_sales = attributes[:'total_sales'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @interval.nil? - invalid_properties.push('invalid value for "interval", interval cannot be nil.') - end - - if @unit_count.nil? - invalid_properties.push('invalid value for "unit_count", unit_count cannot be nil.') - end - - if @order_item_count.nil? - invalid_properties.push('invalid value for "order_item_count", order_item_count cannot be nil.') - end - - if @order_count.nil? - invalid_properties.push('invalid value for "order_count", order_count cannot be nil.') - end - - if @average_unit_price.nil? - invalid_properties.push('invalid value for "average_unit_price", average_unit_price cannot be nil.') - end - - if @total_sales.nil? - invalid_properties.push('invalid value for "total_sales", total_sales cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @interval.nil? - return false if @unit_count.nil? - return false if @order_item_count.nil? - return false if @order_count.nil? - return false if @average_unit_price.nil? - return false if @total_sales.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interval == o.interval && - unit_count == o.unit_count && - order_item_count == o.order_item_count && - order_count == o.order_count && - average_unit_price == o.average_unit_price && - total_sales == o.total_sales - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interval, unit_count, order_item_count, order_count, average_unit_price, total_sales].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/models/order_metrics_list.rb b/vendor/sales/lib/sp_sales/models/order_metrics_list.rb deleted file mode 100644 index 2fa1316..0000000 --- a/vendor/sales/lib/sp_sales/models/order_metrics_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSales - # A set of order metrics, each scoped to a particular time interval. - class OrderMetricsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSales::OrderMetricsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSales::OrderMetricsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSales.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sales/lib/sp_sales/version.rb b/vendor/sales/lib/sp_sales/version.rb deleted file mode 100644 index 694de9b..0000000 --- a/vendor/sales/lib/sp_sales/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpSales - VERSION = '1.0.0' -end diff --git a/vendor/sales/sp_sales.gemspec b/vendor/sales/sp_sales.gemspec deleted file mode 100644 index 8539da5..0000000 --- a/vendor/sales/sp_sales.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Sales - -#The Selling Partner API for Sales provides APIs related to sales performance. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_sales/version" - -Gem::Specification.new do |s| - s.name = "sp_sales" - s.version = SpSales::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Sales Ruby Gem" - s.description = "The Selling Partner API for Sales provides APIs related to sales performance." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/sellers/.gitignore b/vendor/sellers/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/sellers/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/sellers/.rspec b/vendor/sellers/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/sellers/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/sellers/.rubocop.yml b/vendor/sellers/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/sellers/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/sellers/.swagger-codegen-ignore b/vendor/sellers/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/sellers/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/sellers/.swagger-codegen/VERSION b/vendor/sellers/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/sellers/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/sellers/Gemfile b/vendor/sellers/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/sellers/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/sellers/README.md b/vendor/sellers/README.md deleted file mode 100644 index 7389992..0000000 --- a/vendor/sellers/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# sp_sellers - -SpSellers - the Ruby gem for the The Selling Partner API for Sellers - -The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_sellers.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_sellers-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_sellers-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_sellers', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_sellers', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_sellers' - -api_instance = SpSellers::SellersApi.new - -begin - result = api_instance.get_account - p result -rescue SpSellers::ApiError => e - puts "Exception when calling SellersApi->get_account: #{e}" -end - -api_instance = SpSellers::SellersApi.new - -begin - result = api_instance.get_marketplace_participations - p result -rescue SpSellers::ApiError => e - puts "Exception when calling SellersApi->get_marketplace_participations: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpSellers::SellersApi* | [**get_account**](docs/SellersApi.md#get_account) | **GET** /sellers/v1/account | -*SpSellers::SellersApi* | [**get_marketplace_participations**](docs/SellersApi.md#get_marketplace_participations) | **GET** /sellers/v1/marketplaceParticipations | - -## Documentation for Models - - - [SpSellers::Account](docs/Account.md) - - [SpSellers::Address](docs/Address.md) - - [SpSellers::Business](docs/Business.md) - - [SpSellers::Error](docs/Error.md) - - [SpSellers::ErrorList](docs/ErrorList.md) - - [SpSellers::GetAccountResponse](docs/GetAccountResponse.md) - - [SpSellers::GetMarketplaceParticipationsResponse](docs/GetMarketplaceParticipationsResponse.md) - - [SpSellers::Marketplace](docs/Marketplace.md) - - [SpSellers::MarketplaceParticipation](docs/MarketplaceParticipation.md) - - [SpSellers::MarketplaceParticipationList](docs/MarketplaceParticipationList.md) - - [SpSellers::Participation](docs/Participation.md) - - [SpSellers::PrimaryContact](docs/PrimaryContact.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/sellers/Rakefile b/vendor/sellers/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/sellers/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/sellers/git_push.sh b/vendor/sellers/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/sellers/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/sellers/lib/sp_sellers.rb b/vendor/sellers/lib/sp_sellers.rb deleted file mode 100644 index 862f9bc..0000000 --- a/vendor/sellers/lib/sp_sellers.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_sellers/api_client' -# require 'sp_sellers/api_error' -# require 'sp_sellers/version' -# require 'sp_sellers/configuration' - -# Models -# -# -# require_relative './sp_sellers/models/account' -# -# -# require_relative './sp_sellers/models/address' -# -# -# require_relative './sp_sellers/models/business' -# -# -# require_relative './sp_sellers/models/error' -# -# -# require_relative './sp_sellers/models/error_list' -# -# -# require_relative './sp_sellers/models/get_account_response' -# -# -# require_relative './sp_sellers/models/get_marketplace_participations_response' -# -# -# require_relative './sp_sellers/models/marketplace' -# -# -# require_relative './sp_sellers/models/marketplace_participation' -# -# -# require_relative './sp_sellers/models/marketplace_participation_list' -# -# -# require_relative './sp_sellers/models/participation' -# -# -# require_relative './sp_sellers/models/primary_contact' -# - -# APIs -require_relative './sp_sellers/api/sellers_api' diff --git a/vendor/sellers/lib/sp_sellers/api/sellers_api.rb b/vendor/sellers/lib/sp_sellers/api/sellers_api.rb deleted file mode 100644 index 44c3502..0000000 --- a/vendor/sellers/lib/sp_sellers/api/sellers_api.rb +++ /dev/null @@ -1,118 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSellers - class SellersApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns information about a seller account and its marketplaces. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.016 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [GetAccountResponse] - def get_account(opts = {}) - data = get_account_with_http_info(opts) - return data - end - - # Returns information about a seller account and its marketplaces. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.016 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [Array<(GetAccountResponse)>] GetAccountResponse data, response status code and response headers - def get_account_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SellersApi.get_account ...' - end - # resource path - local_var_path = '/sellers/v1/account' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SellersApi#get_account\nData: #{data.inspect}" - end - return data - end - # Returns a list of marketplaces where the seller can list items and information about the seller's participation in those marketplaces. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.016 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [GetMarketplaceParticipationsResponse] - def get_marketplace_participations(opts = {}) - data = get_marketplace_participations_with_http_info(opts) - return data - end - - # Returns a list of marketplaces where the seller can list items and information about the seller's participation in those marketplaces. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.016 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param [Hash] opts the optional parameters - # @return [Array<(GetMarketplaceParticipationsResponse)>] GetMarketplaceParticipationsResponse data, response status code and response headers - def get_marketplace_participations_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SellersApi.get_marketplace_participations ...' - end - # resource path - local_var_path = '/sellers/v1/marketplaceParticipations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'payload']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SellersApi#get_marketplace_participations\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/sellers/lib/sp_sellers/api_client.rb b/vendor/sellers/lib/sp_sellers/api_client.rb deleted file mode 100644 index 84285b0..0000000 --- a/vendor/sellers/lib/sp_sellers/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpSellers - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpSellers.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/sellers/lib/sp_sellers/api_error.rb b/vendor/sellers/lib/sp_sellers/api_error.rb deleted file mode 100644 index aa4abd0..0000000 --- a/vendor/sellers/lib/sp_sellers/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSellers - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/sellers/lib/sp_sellers/configuration.rb b/vendor/sellers/lib/sp_sellers/configuration.rb deleted file mode 100644 index 6ac913f..0000000 --- a/vendor/sellers/lib/sp_sellers/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSellers - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/account.rb b/vendor/sellers/lib/sp_sellers/models/account.rb deleted file mode 100644 index e95e32d..0000000 --- a/vendor/sellers/lib/sp_sellers/models/account.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # The response schema for the `getAccount` operation. - class Account - attr_accessor :marketplace_participation_list - - # The type of business registered for the seller account. - attr_accessor :business_type - - # The selling plan details. - attr_accessor :selling_plan - - attr_accessor :business - - attr_accessor :primary_contact - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_participation_list' => :'marketplaceParticipationList', - :'business_type' => :'businessType', - :'selling_plan' => :'sellingPlan', - :'business' => :'business', - :'primary_contact' => :'primaryContact' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_participation_list' => :'Object', - :'business_type' => :'Object', - :'selling_plan' => :'Object', - :'business' => :'Object', - :'primary_contact' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Account` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_participation_list') - self.marketplace_participation_list = attributes[:'marketplace_participation_list'] - end - - if attributes.key?(:'business_type') - self.business_type = attributes[:'business_type'] - end - - if attributes.key?(:'selling_plan') - self.selling_plan = attributes[:'selling_plan'] - end - - if attributes.key?(:'business') - self.business = attributes[:'business'] - end - - if attributes.key?(:'primary_contact') - self.primary_contact = attributes[:'primary_contact'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_participation_list.nil? - invalid_properties.push('invalid value for "marketplace_participation_list", marketplace_participation_list cannot be nil.') - end - - if @business_type.nil? - invalid_properties.push('invalid value for "business_type", business_type cannot be nil.') - end - - if @selling_plan.nil? - invalid_properties.push('invalid value for "selling_plan", selling_plan cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_participation_list.nil? - return false if @business_type.nil? - business_type_validator = EnumAttributeValidator.new('Object', ['CHARITY', 'CRAFTSMAN', 'NATURAL_PERSON_COMPANY', 'PUBLIC_LISTED', 'PRIVATE_LIMITED', 'SOLE_PROPRIETORSHIP', 'STATE_OWNED', 'INDIVIDUAL']) - return false unless business_type_validator.valid?(@business_type) - return false if @selling_plan.nil? - selling_plan_validator = EnumAttributeValidator.new('Object', ['PROFESSIONAL', 'INDIVIDUAL']) - return false unless selling_plan_validator.valid?(@selling_plan) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] business_type Object to be assigned - def business_type=(business_type) - validator = EnumAttributeValidator.new('Object', ['CHARITY', 'CRAFTSMAN', 'NATURAL_PERSON_COMPANY', 'PUBLIC_LISTED', 'PRIVATE_LIMITED', 'SOLE_PROPRIETORSHIP', 'STATE_OWNED', 'INDIVIDUAL']) - unless validator.valid?(business_type) - fail ArgumentError, "invalid value for \"business_type\", must be one of #{validator.allowable_values}." - end - @business_type = business_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] selling_plan Object to be assigned - def selling_plan=(selling_plan) - validator = EnumAttributeValidator.new('Object', ['PROFESSIONAL', 'INDIVIDUAL']) - unless validator.valid?(selling_plan) - fail ArgumentError, "invalid value for \"selling_plan\", must be one of #{validator.allowable_values}." - end - @selling_plan = selling_plan - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_participation_list == o.marketplace_participation_list && - business_type == o.business_type && - selling_plan == o.selling_plan && - business == o.business && - primary_contact == o.primary_contact - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_participation_list, business_type, selling_plan, business, primary_contact].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/address.rb b/vendor/sellers/lib/sp_sellers/models/address.rb deleted file mode 100644 index 7a34b92..0000000 --- a/vendor/sellers/lib/sp_sellers/models/address.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Represents an address - class Address - # Street address information. - attr_accessor :address_line1 - - # Additional street address information. - attr_accessor :address_line2 - - # The country code in two-character ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The state or province code. - attr_accessor :state_or_province_code - - # The city. - attr_accessor :city - - # The postal code. - attr_accessor :postal_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'country_code' => :'countryCode', - :'state_or_province_code' => :'stateOrProvinceCode', - :'city' => :'city', - :'postal_code' => :'postalCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'country_code' => :'Object', - :'state_or_province_code' => :'Object', - :'city' => :'Object', - :'postal_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'state_or_province_code') - self.state_or_province_code = attributes[:'state_or_province_code'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address_line1.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - country_code == o.country_code && - state_or_province_code == o.state_or_province_code && - city == o.city && - postal_code == o.postal_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address_line1, address_line2, country_code, state_or_province_code, city, postal_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/business.rb b/vendor/sellers/lib/sp_sellers/models/business.rb deleted file mode 100644 index b0ef9cb..0000000 --- a/vendor/sellers/lib/sp_sellers/models/business.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Information about the seller's business. Certain fields may be omitted depending on the seller's `businessType`. - class Business - # The registered business name. - attr_accessor :name - - attr_accessor :registered_business_address - - # The seller's company registration number, if applicable. This field will be absent for individual sellers and sole proprietorships. - attr_accessor :company_registration_number - - # The seller's company tax identification number, if applicable. This field will be present for certain business types only, such as sole proprietorships. - attr_accessor :company_tax_identification_number - - # The non-Latin script version of the registered business name, if applicable. - attr_accessor :non_latin_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'registered_business_address' => :'registeredBusinessAddress', - :'company_registration_number' => :'companyRegistrationNumber', - :'company_tax_identification_number' => :'companyTaxIdentificationNumber', - :'non_latin_name' => :'nonLatinName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'registered_business_address' => :'Object', - :'company_registration_number' => :'Object', - :'company_tax_identification_number' => :'Object', - :'non_latin_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Business` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Business`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'registered_business_address') - self.registered_business_address = attributes[:'registered_business_address'] - end - - if attributes.key?(:'company_registration_number') - self.company_registration_number = attributes[:'company_registration_number'] - end - - if attributes.key?(:'company_tax_identification_number') - self.company_tax_identification_number = attributes[:'company_tax_identification_number'] - end - - if attributes.key?(:'non_latin_name') - self.non_latin_name = attributes[:'non_latin_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @registered_business_address.nil? - invalid_properties.push('invalid value for "registered_business_address", registered_business_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @registered_business_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - registered_business_address == o.registered_business_address && - company_registration_number == o.company_registration_number && - company_tax_identification_number == o.company_tax_identification_number && - non_latin_name == o.non_latin_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, registered_business_address, company_registration_number, company_tax_identification_number, non_latin_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/error.rb b/vendor/sellers/lib/sp_sellers/models/error.rb deleted file mode 100644 index 452b6f5..0000000 --- a/vendor/sellers/lib/sp_sellers/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional details that can help you understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/error_list.rb b/vendor/sellers/lib/sp_sellers/models/error_list.rb deleted file mode 100644 index 2436acc..0000000 --- a/vendor/sellers/lib/sp_sellers/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/get_account_response.rb b/vendor/sellers/lib/sp_sellers/models/get_account_response.rb deleted file mode 100644 index f91e60f..0000000 --- a/vendor/sellers/lib/sp_sellers/models/get_account_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # The response schema for the `getAccount` operation. - class GetAccountResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::GetAccountResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::GetAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/get_marketplace_participations_response.rb b/vendor/sellers/lib/sp_sellers/models/get_marketplace_participations_response.rb deleted file mode 100644 index 596faae..0000000 --- a/vendor/sellers/lib/sp_sellers/models/get_marketplace_participations_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # The response schema for the `getMarketplaceParticipations` operation. - class GetMarketplaceParticipationsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::GetMarketplaceParticipationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::GetMarketplaceParticipationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/marketplace.rb b/vendor/sellers/lib/sp_sellers/models/marketplace.rb deleted file mode 100644 index 6d283c6..0000000 --- a/vendor/sellers/lib/sp_sellers/models/marketplace.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Information about an Amazon marketplace where a seller can list items and customers can view and purchase items. - class Marketplace - # The encrypted marketplace value. - attr_accessor :id - - # The marketplace name. - attr_accessor :name - - # The ISO 3166-1 alpha-2 format country code of the marketplace. - attr_accessor :country_code - - # The ISO 4217 format currency code of the marketplace. - attr_accessor :default_currency_code - - # The ISO 639-1 format language code of the marketplace. - attr_accessor :default_language_code - - # The domain name of the marketplace. - attr_accessor :domain_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'country_code' => :'countryCode', - :'default_currency_code' => :'defaultCurrencyCode', - :'default_language_code' => :'defaultLanguageCode', - :'domain_name' => :'domainName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'Object', - :'name' => :'Object', - :'country_code' => :'Object', - :'default_currency_code' => :'Object', - :'default_language_code' => :'Object', - :'domain_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Marketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Marketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'default_currency_code') - self.default_currency_code = attributes[:'default_currency_code'] - end - - if attributes.key?(:'default_language_code') - self.default_language_code = attributes[:'default_language_code'] - end - - if attributes.key?(:'domain_name') - self.domain_name = attributes[:'domain_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - if @default_currency_code.nil? - invalid_properties.push('invalid value for "default_currency_code", default_currency_code cannot be nil.') - end - - if @default_language_code.nil? - invalid_properties.push('invalid value for "default_language_code", default_language_code cannot be nil.') - end - - if @domain_name.nil? - invalid_properties.push('invalid value for "domain_name", domain_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @name.nil? - return false if @country_code.nil? - return false if @default_currency_code.nil? - return false if @default_language_code.nil? - return false if @domain_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - country_code == o.country_code && - default_currency_code == o.default_currency_code && - default_language_code == o.default_language_code && - domain_name == o.domain_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, country_code, default_currency_code, default_language_code, domain_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/marketplace_participation.rb b/vendor/sellers/lib/sp_sellers/models/marketplace_participation.rb deleted file mode 100644 index 2f91dca..0000000 --- a/vendor/sellers/lib/sp_sellers/models/marketplace_participation.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - class MarketplaceParticipation - attr_accessor :marketplace - - attr_accessor :participation - - # The name of the seller's store as displayed in the marketplace. - attr_accessor :store_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace' => :'marketplace', - :'participation' => :'participation', - :'store_name' => :'storeName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace' => :'Object', - :'participation' => :'Object', - :'store_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::MarketplaceParticipation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::MarketplaceParticipation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace') - self.marketplace = attributes[:'marketplace'] - end - - if attributes.key?(:'participation') - self.participation = attributes[:'participation'] - end - - if attributes.key?(:'store_name') - self.store_name = attributes[:'store_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace.nil? - invalid_properties.push('invalid value for "marketplace", marketplace cannot be nil.') - end - - if @participation.nil? - invalid_properties.push('invalid value for "participation", participation cannot be nil.') - end - - if @store_name.nil? - invalid_properties.push('invalid value for "store_name", store_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace.nil? - return false if @participation.nil? - return false if @store_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace == o.marketplace && - participation == o.participation && - store_name == o.store_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace, participation, store_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/marketplace_participation_list.rb b/vendor/sellers/lib/sp_sellers/models/marketplace_participation_list.rb deleted file mode 100644 index b81171c..0000000 --- a/vendor/sellers/lib/sp_sellers/models/marketplace_participation_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # List of marketplace participations. - class MarketplaceParticipationList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::MarketplaceParticipationList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::MarketplaceParticipationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/participation.rb b/vendor/sellers/lib/sp_sellers/models/participation.rb deleted file mode 100644 index 2f0265b..0000000 --- a/vendor/sellers/lib/sp_sellers/models/participation.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Information that is specific to a seller in a marketplace. - class Participation - # If `true`, the seller participates in the marketplace. Otherwise `false`. - attr_accessor :is_participating - - # Specifies if the seller has suspended listings. `true` if the seller Listing Status is set to Inactive, otherwise `false`. - attr_accessor :has_suspended_listings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_participating' => :'isParticipating', - :'has_suspended_listings' => :'hasSuspendedListings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_participating' => :'Object', - :'has_suspended_listings' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::Participation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::Participation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_participating') - self.is_participating = attributes[:'is_participating'] - end - - if attributes.key?(:'has_suspended_listings') - self.has_suspended_listings = attributes[:'has_suspended_listings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_participating.nil? - invalid_properties.push('invalid value for "is_participating", is_participating cannot be nil.') - end - - if @has_suspended_listings.nil? - invalid_properties.push('invalid value for "has_suspended_listings", has_suspended_listings cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_participating.nil? - return false if @has_suspended_listings.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_participating == o.is_participating && - has_suspended_listings == o.has_suspended_listings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_participating, has_suspended_listings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/models/primary_contact.rb b/vendor/sellers/lib/sp_sellers/models/primary_contact.rb deleted file mode 100644 index 303d6ac..0000000 --- a/vendor/sellers/lib/sp_sellers/models/primary_contact.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSellers - # Information about the seller's primary contact. - class PrimaryContact - # The full name of the seller's primary contact. - attr_accessor :name - - attr_accessor :address - - # The non-Latin script version of the primary contact's name, if applicable. - attr_accessor :non_latin_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address', - :'non_latin_name' => :'nonLatinName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address' => :'Object', - :'non_latin_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSellers::PrimaryContact` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSellers::PrimaryContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'non_latin_name') - self.non_latin_name = attributes[:'non_latin_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address && - non_latin_name == o.non_latin_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address, non_latin_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSellers.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/sellers/lib/sp_sellers/version.rb b/vendor/sellers/lib/sp_sellers/version.rb deleted file mode 100644 index 5eecf70..0000000 --- a/vendor/sellers/lib/sp_sellers/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpSellers - VERSION = '1.0.0' -end diff --git a/vendor/sellers/sp_sellers.gemspec b/vendor/sellers/sp_sellers.gemspec deleted file mode 100644 index b45be46..0000000 --- a/vendor/sellers/sp_sellers.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#The Selling Partner API for Sellers - -#The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_sellers/version" - -Gem::Specification.new do |s| - s.name = "sp_sellers" - s.version = SpSellers::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "The Selling Partner API for Sellers Ruby Gem" - s.description = "The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/services/.gitignore b/vendor/services/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/services/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/services/.rspec b/vendor/services/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/services/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/services/.rubocop.yml b/vendor/services/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/services/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/services/.swagger-codegen-ignore b/vendor/services/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/services/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/services/.swagger-codegen/VERSION b/vendor/services/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/services/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/services/Gemfile b/vendor/services/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/services/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/services/README.md b/vendor/services/README.md deleted file mode 100644 index 641c80c..0000000 --- a/vendor/services/README.md +++ /dev/null @@ -1,395 +0,0 @@ -# sp_services - -SpServices - the Ruby gem for the Selling Partner API for Services - -With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_services.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_services-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_services-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_services', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_services', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_services' - -api_instance = SpServices::ServiceApi.new -body = SpServices::AddAppointmentRequest.new # AddAppointmentRequest | Add appointment operation input details. -service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier. - - -begin - result = api_instance.add_appointment_for_service_job_by_service_job_id(body, service_job_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->add_appointment_for_service_job_by_service_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::AssignAppointmentResourcesRequest.new # AssignAppointmentResourcesRequest | -service_job_id = 'service_job_id_example' # String | An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. -appointment_id = 'appointment_id_example' # String | An Amazon-defined identifier of active service job appointment. - - -begin - result = api_instance.assign_appointment_resources(body, service_job_id, appointment_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->assign_appointment_resources: #{e}" -end - -api_instance = SpServices::ServiceApi.new -reservation_id = 'reservation_id_example' # String | Reservation Identifier -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. - - -begin - result = api_instance.cancel_reservation(reservation_id, marketplace_ids) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->cancel_reservation: #{e}" -end - -api_instance = SpServices::ServiceApi.new -service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier. -cancellation_reason_code = 'cancellation_reason_code_example' # String | A cancel reason code that specifies the reason for cancelling a service job. - - -begin - result = api_instance.cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->cancel_service_job_by_service_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier. - - -begin - result = api_instance.complete_service_job_by_service_job_id(service_job_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->complete_service_job_by_service_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::CreateReservationRequest.new # CreateReservationRequest | Reservation details -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. - - -begin - result = api_instance.create_reservation(body, marketplace_ids) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->create_reservation: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::ServiceUploadDocument.new # ServiceUploadDocument | Upload document operation input details. - - -begin - result = api_instance.create_service_document_upload_destination(body) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->create_service_document_upload_destination: #{e}" -end - -api_instance = SpServices::ServiceApi.new -asin = 'asin_example' # String | ASIN associated with the service. -store_id = 'store_id_example' # String | Store identifier defining the region scope to retrive appointment slots. -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace for which appointment slots are queried -opts = { - start_time: 'start_time_example', # String | A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - end_time: 'end_time_example' # String | A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. -} - -begin - result = api_instance.get_appointment_slots(asin, store_id, marketplace_ids, opts) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_appointment_slots: #{e}" -end - -api_instance = SpServices::ServiceApi.new -service_job_id = 'service_job_id_example' # String | A service job identifier to retrive appointment slots for associated service. -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. -opts = { - start_time: 'start_time_example', # String | A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - end_time: 'end_time_example' # String | A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. -} - -begin - result = api_instance.get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, opts) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_appointmment_slots_by_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::FixedSlotCapacityQuery.new # FixedSlotCapacityQuery | Request body. -resource_id = 'resource_id_example' # String | Resource Identifier. -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. -opts = { - next_page_token: 'next_page_token_example' # String | Next page token returned in the response of your previous request. -} - -begin - result = api_instance.get_fixed_slot_capacity(body, resource_id, marketplace_ids, opts) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_fixed_slot_capacity: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::RangeSlotCapacityQuery.new # RangeSlotCapacityQuery | Request body. -resource_id = 'resource_id_example' # String | Resource Identifier. -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. -opts = { - next_page_token: 'next_page_token_example' # String | Next page token returned in the response of your previous request. -} - -begin - result = api_instance.get_range_slot_capacity(body, resource_id, marketplace_ids, opts) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_range_slot_capacity: #{e}" -end - -api_instance = SpServices::ServiceApi.new -service_job_id = 'service_job_id_example' # String | A service job identifier. - - -begin - result = api_instance.get_service_job_by_service_job_id(service_job_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_service_job_by_service_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -marketplace_ids = ['marketplace_ids_example'] # Array | Used to select jobs that were placed in the specified marketplaces. -opts = { - service_order_ids: ['service_order_ids_example'], # Array | List of service order ids for the query you want to perform.Max values supported 20. - service_job_status: ['service_job_status_example'], # Array | A list of one or more job status by which to filter the list of jobs. - page_token: 'page_token_example', # String | String returned in the response of your previous request. - page_size: 20, # Integer | A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20. - sort_field: 'sort_field_example', # String | Sort fields on which you want to sort the output. - sort_order: 'sort_order_example', # String | Sort order for the query you want to perform. - created_after: 'created_after_example', # String | A date used for selecting jobs created at or after a specified time. Must be in ISO 8601 format. Required if `LastUpdatedAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - created_before: 'created_before_example', # String | A date used for selecting jobs created at or before a specified time. Must be in ISO 8601 format. - last_updated_after: 'last_updated_after_example', # String | A date used for selecting jobs updated at or after a specified time. Must be in ISO 8601 format. Required if `createdAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - last_updated_before: 'last_updated_before_example', # String | A date used for selecting jobs updated at or before a specified time. Must be in ISO 8601 format. - schedule_start_date: 'schedule_start_date_example', # String | A date used for filtering jobs schedules at or after a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - schedule_end_date: 'schedule_end_date_example', # String | A date used for filtering jobs schedules at or before a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - asins: ['asins_example'], # Array | List of Amazon Standard Identification Numbers (ASIN) of the items. Max values supported is 20. - required_skills: ['required_skills_example'], # Array | A defined set of related knowledge, skills, experience, tools, materials, and work processes common to service delivery for a set of products and/or service scenarios. Max values supported is 20. - store_ids: ['store_ids_example'] # Array | List of Amazon-defined identifiers for the region scope. Max values supported is 50. -} - -begin - result = api_instance.get_service_jobs(marketplace_ids, opts) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->get_service_jobs: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::RescheduleAppointmentRequest.new # RescheduleAppointmentRequest | Reschedule appointment operation input details. -service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier. -appointment_id = 'appointment_id_example' # String | An existing appointment identifier for the Service Job. - - -begin - result = api_instance.reschedule_appointment_for_service_job_by_service_job_id(body, service_job_id, appointment_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->reschedule_appointment_for_service_job_by_service_job_id: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::SetAppointmentFulfillmentDataRequest.new # SetAppointmentFulfillmentDataRequest | Appointment fulfillment data collection details. -service_job_id = 'service_job_id_example' # String | An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. -appointment_id = 'appointment_id_example' # String | An Amazon-defined identifier of active service job appointment. - - -begin - result = api_instance.set_appointment_fulfillment_data(body, service_job_id, appointment_id) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->set_appointment_fulfillment_data: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::UpdateReservationRequest.new # UpdateReservationRequest | Reservation details -reservation_id = 'reservation_id_example' # String | Reservation Identifier -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. - - -begin - result = api_instance.update_reservation(body, reservation_id, marketplace_ids) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->update_reservation: #{e}" -end - -api_instance = SpServices::ServiceApi.new -body = SpServices::UpdateScheduleRequest.new # UpdateScheduleRequest | Schedule details -resource_id = 'resource_id_example' # String | Resource (store) Identifier -marketplace_ids = ['marketplace_ids_example'] # Array | An identifier for the marketplace in which the resource operates. - - -begin - result = api_instance.update_schedule(body, resource_id, marketplace_ids) - p result -rescue SpServices::ApiError => e - puts "Exception when calling ServiceApi->update_schedule: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpServices::ServiceApi* | [**add_appointment_for_service_job_by_service_job_id**](docs/ServiceApi.md#add_appointment_for_service_job_by_service_job_id) | **POST** /service/v1/serviceJobs/{serviceJobId}/appointments | -*SpServices::ServiceApi* | [**assign_appointment_resources**](docs/ServiceApi.md#assign_appointment_resources) | **PUT** /service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId}/resources | -*SpServices::ServiceApi* | [**cancel_reservation**](docs/ServiceApi.md#cancel_reservation) | **DELETE** /service/v1/reservation/{reservationId} | -*SpServices::ServiceApi* | [**cancel_service_job_by_service_job_id**](docs/ServiceApi.md#cancel_service_job_by_service_job_id) | **PUT** /service/v1/serviceJobs/{serviceJobId}/cancellations | -*SpServices::ServiceApi* | [**complete_service_job_by_service_job_id**](docs/ServiceApi.md#complete_service_job_by_service_job_id) | **PUT** /service/v1/serviceJobs/{serviceJobId}/completions | -*SpServices::ServiceApi* | [**create_reservation**](docs/ServiceApi.md#create_reservation) | **POST** /service/v1/reservation | -*SpServices::ServiceApi* | [**create_service_document_upload_destination**](docs/ServiceApi.md#create_service_document_upload_destination) | **POST** /service/v1/documents | -*SpServices::ServiceApi* | [**get_appointment_slots**](docs/ServiceApi.md#get_appointment_slots) | **GET** /service/v1/appointmentSlots | -*SpServices::ServiceApi* | [**get_appointmment_slots_by_job_id**](docs/ServiceApi.md#get_appointmment_slots_by_job_id) | **GET** /service/v1/serviceJobs/{serviceJobId}/appointmentSlots | -*SpServices::ServiceApi* | [**get_fixed_slot_capacity**](docs/ServiceApi.md#get_fixed_slot_capacity) | **POST** /service/v1/serviceResources/{resourceId}/capacity/fixed | -*SpServices::ServiceApi* | [**get_range_slot_capacity**](docs/ServiceApi.md#get_range_slot_capacity) | **POST** /service/v1/serviceResources/{resourceId}/capacity/range | -*SpServices::ServiceApi* | [**get_service_job_by_service_job_id**](docs/ServiceApi.md#get_service_job_by_service_job_id) | **GET** /service/v1/serviceJobs/{serviceJobId} | -*SpServices::ServiceApi* | [**get_service_jobs**](docs/ServiceApi.md#get_service_jobs) | **GET** /service/v1/serviceJobs | -*SpServices::ServiceApi* | [**reschedule_appointment_for_service_job_by_service_job_id**](docs/ServiceApi.md#reschedule_appointment_for_service_job_by_service_job_id) | **POST** /service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId} | -*SpServices::ServiceApi* | [**set_appointment_fulfillment_data**](docs/ServiceApi.md#set_appointment_fulfillment_data) | **PUT** /service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId}/fulfillment | -*SpServices::ServiceApi* | [**update_reservation**](docs/ServiceApi.md#update_reservation) | **PUT** /service/v1/reservation/{reservationId} | -*SpServices::ServiceApi* | [**update_schedule**](docs/ServiceApi.md#update_schedule) | **PUT** /service/v1/serviceResources/{resourceId}/schedules | - -## Documentation for Models - - - [SpServices::AddAppointmentRequest](docs/AddAppointmentRequest.md) - - [SpServices::Address](docs/Address.md) - - [SpServices::Appointment](docs/Appointment.md) - - [SpServices::AppointmentId](docs/AppointmentId.md) - - [SpServices::AppointmentResource](docs/AppointmentResource.md) - - [SpServices::AppointmentResources](docs/AppointmentResources.md) - - [SpServices::AppointmentSlot](docs/AppointmentSlot.md) - - [SpServices::AppointmentSlotReport](docs/AppointmentSlotReport.md) - - [SpServices::AppointmentTime](docs/AppointmentTime.md) - - [SpServices::AppointmentTimeInput](docs/AppointmentTimeInput.md) - - [SpServices::AssignAppointmentResourcesRequest](docs/AssignAppointmentResourcesRequest.md) - - [SpServices::AssignAppointmentResourcesResponse](docs/AssignAppointmentResourcesResponse.md) - - [SpServices::AssignAppointmentResourcesResponsePayload](docs/AssignAppointmentResourcesResponsePayload.md) - - [SpServices::AssociatedItem](docs/AssociatedItem.md) - - [SpServices::AvailabilityRecord](docs/AvailabilityRecord.md) - - [SpServices::AvailabilityRecords](docs/AvailabilityRecords.md) - - [SpServices::Buyer](docs/Buyer.md) - - [SpServices::CancelReservationResponse](docs/CancelReservationResponse.md) - - [SpServices::CancelServiceJobByServiceJobIdResponse](docs/CancelServiceJobByServiceJobIdResponse.md) - - [SpServices::CapacityType](docs/CapacityType.md) - - [SpServices::CompleteServiceJobByServiceJobIdResponse](docs/CompleteServiceJobByServiceJobIdResponse.md) - - [SpServices::CreateReservationRecord](docs/CreateReservationRecord.md) - - [SpServices::CreateReservationRequest](docs/CreateReservationRequest.md) - - [SpServices::CreateReservationResponse](docs/CreateReservationResponse.md) - - [SpServices::CreateServiceDocumentUploadDestination](docs/CreateServiceDocumentUploadDestination.md) - - [SpServices::DayOfWeek](docs/DayOfWeek.md) - - [SpServices::EncryptionDetails](docs/EncryptionDetails.md) - - [SpServices::Error](docs/Error.md) - - [SpServices::ErrorList](docs/ErrorList.md) - - [SpServices::FixedSlot](docs/FixedSlot.md) - - [SpServices::FixedSlotCapacity](docs/FixedSlotCapacity.md) - - [SpServices::FixedSlotCapacityErrors](docs/FixedSlotCapacityErrors.md) - - [SpServices::FixedSlotCapacityQuery](docs/FixedSlotCapacityQuery.md) - - [SpServices::FulfillmentDocument](docs/FulfillmentDocument.md) - - [SpServices::FulfillmentDocuments](docs/FulfillmentDocuments.md) - - [SpServices::FulfillmentTime](docs/FulfillmentTime.md) - - [SpServices::GetAppointmentSlotsResponse](docs/GetAppointmentSlotsResponse.md) - - [SpServices::GetServiceJobByServiceJobIdResponse](docs/GetServiceJobByServiceJobIdResponse.md) - - [SpServices::GetServiceJobsResponse](docs/GetServiceJobsResponse.md) - - [SpServices::ItemDelivery](docs/ItemDelivery.md) - - [SpServices::ItemDeliveryPromise](docs/ItemDeliveryPromise.md) - - [SpServices::JobListing](docs/JobListing.md) - - [SpServices::OrderId](docs/OrderId.md) - - [SpServices::Poa](docs/Poa.md) - - [SpServices::RangeCapacity](docs/RangeCapacity.md) - - [SpServices::RangeSlot](docs/RangeSlot.md) - - [SpServices::RangeSlotCapacity](docs/RangeSlotCapacity.md) - - [SpServices::RangeSlotCapacityErrors](docs/RangeSlotCapacityErrors.md) - - [SpServices::RangeSlotCapacityQuery](docs/RangeSlotCapacityQuery.md) - - [SpServices::Recurrence](docs/Recurrence.md) - - [SpServices::RescheduleAppointmentRequest](docs/RescheduleAppointmentRequest.md) - - [SpServices::RescheduleReasonCode](docs/RescheduleReasonCode.md) - - [SpServices::Reservation](docs/Reservation.md) - - [SpServices::ScopeOfWork](docs/ScopeOfWork.md) - - [SpServices::Seller](docs/Seller.md) - - [SpServices::ServiceDocumentUploadDestination](docs/ServiceDocumentUploadDestination.md) - - [SpServices::ServiceJob](docs/ServiceJob.md) - - [SpServices::ServiceJobId](docs/ServiceJobId.md) - - [SpServices::ServiceJobProvider](docs/ServiceJobProvider.md) - - [SpServices::ServiceLocation](docs/ServiceLocation.md) - - [SpServices::ServiceUploadDocument](docs/ServiceUploadDocument.md) - - [SpServices::SetAppointmentFulfillmentDataRequest](docs/SetAppointmentFulfillmentDataRequest.md) - - [SpServices::SetAppointmentResponse](docs/SetAppointmentResponse.md) - - [SpServices::Technician](docs/Technician.md) - - [SpServices::UpdateReservationRecord](docs/UpdateReservationRecord.md) - - [SpServices::UpdateReservationRequest](docs/UpdateReservationRequest.md) - - [SpServices::UpdateReservationResponse](docs/UpdateReservationResponse.md) - - [SpServices::UpdateScheduleRecord](docs/UpdateScheduleRecord.md) - - [SpServices::UpdateScheduleRequest](docs/UpdateScheduleRequest.md) - - [SpServices::UpdateScheduleResponse](docs/UpdateScheduleResponse.md) - - [SpServices::Warning](docs/Warning.md) - - [SpServices::WarningList](docs/WarningList.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/services/Rakefile b/vendor/services/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/services/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/services/git_push.sh b/vendor/services/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/services/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/services/lib/sp_services.rb b/vendor/services/lib/sp_services.rb deleted file mode 100644 index 04cc0a8..0000000 --- a/vendor/services/lib/sp_services.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_services/api_client' -# require 'sp_services/api_error' -# require 'sp_services/version' -# require 'sp_services/configuration' - -# Models -# -# -# require_relative './sp_services/models/add_appointment_request' -# -# -# require_relative './sp_services/models/address' -# -# -# require_relative './sp_services/models/appointment' -# -# -# require_relative './sp_services/models/appointment_id' -# -# -# require_relative './sp_services/models/appointment_resource' -# -# -# require_relative './sp_services/models/appointment_resources' -# -# -# require_relative './sp_services/models/appointment_slot' -# -# -# require_relative './sp_services/models/appointment_slot_report' -# -# -# require_relative './sp_services/models/appointment_time' -# -# -# require_relative './sp_services/models/appointment_time_input' -# -# -# require_relative './sp_services/models/assign_appointment_resources_request' -# -# -# require_relative './sp_services/models/assign_appointment_resources_response' -# -# -# require_relative './sp_services/models/assign_appointment_resources_response_payload' -# -# -# require_relative './sp_services/models/associated_item' -# -# -# require_relative './sp_services/models/availability_record' -# -# -# require_relative './sp_services/models/availability_records' -# -# -# require_relative './sp_services/models/buyer' -# -# -# require_relative './sp_services/models/cancel_reservation_response' -# -# -# require_relative './sp_services/models/cancel_service_job_by_service_job_id_response' -# -# -# require_relative './sp_services/models/capacity_type' -# -# -# require_relative './sp_services/models/complete_service_job_by_service_job_id_response' -# -# -# require_relative './sp_services/models/create_reservation_record' -# -# -# require_relative './sp_services/models/create_reservation_request' -# -# -# require_relative './sp_services/models/create_reservation_response' -# -# -# require_relative './sp_services/models/create_service_document_upload_destination' -# -# -# require_relative './sp_services/models/day_of_week' -# -# -# require_relative './sp_services/models/encryption_details' -# -# -# require_relative './sp_services/models/error' -# -# -# require_relative './sp_services/models/error_list' -# -# -# require_relative './sp_services/models/fixed_slot' -# -# -# require_relative './sp_services/models/fixed_slot_capacity' -# -# -# require_relative './sp_services/models/fixed_slot_capacity_errors' -# -# -# require_relative './sp_services/models/fixed_slot_capacity_query' -# -# -# require_relative './sp_services/models/fulfillment_document' -# -# -# require_relative './sp_services/models/fulfillment_documents' -# -# -# require_relative './sp_services/models/fulfillment_time' -# -# -# require_relative './sp_services/models/get_appointment_slots_response' -# -# -# require_relative './sp_services/models/get_service_job_by_service_job_id_response' -# -# -# require_relative './sp_services/models/get_service_jobs_response' -# -# -# require_relative './sp_services/models/item_delivery' -# -# -# require_relative './sp_services/models/item_delivery_promise' -# -# -# require_relative './sp_services/models/job_listing' -# -# -# require_relative './sp_services/models/order_id' -# -# -# require_relative './sp_services/models/poa' -# -# -# require_relative './sp_services/models/range_capacity' -# -# -# require_relative './sp_services/models/range_slot' -# -# -# require_relative './sp_services/models/range_slot_capacity' -# -# -# require_relative './sp_services/models/range_slot_capacity_errors' -# -# -# require_relative './sp_services/models/range_slot_capacity_query' -# -# -# require_relative './sp_services/models/recurrence' -# -# -# require_relative './sp_services/models/reschedule_appointment_request' -# -# -# require_relative './sp_services/models/reschedule_reason_code' -# -# -# require_relative './sp_services/models/reservation' -# -# -# require_relative './sp_services/models/scope_of_work' -# -# -# require_relative './sp_services/models/seller' -# -# -# require_relative './sp_services/models/service_document_upload_destination' -# -# -# require_relative './sp_services/models/service_job' -# -# -# require_relative './sp_services/models/service_job_id' -# -# -# require_relative './sp_services/models/service_job_provider' -# -# -# require_relative './sp_services/models/service_location' -# -# -# require_relative './sp_services/models/service_upload_document' -# -# -# require_relative './sp_services/models/set_appointment_fulfillment_data_request' -# -# -# require_relative './sp_services/models/set_appointment_response' -# -# -# require_relative './sp_services/models/technician' -# -# -# require_relative './sp_services/models/update_reservation_record' -# -# -# require_relative './sp_services/models/update_reservation_request' -# -# -# require_relative './sp_services/models/update_reservation_response' -# -# -# require_relative './sp_services/models/update_schedule_record' -# -# -# require_relative './sp_services/models/update_schedule_request' -# -# -# require_relative './sp_services/models/update_schedule_response' -# -# -# require_relative './sp_services/models/warning' -# -# -# require_relative './sp_services/models/warning_list' -# - -# APIs -require_relative './sp_services/api/service_api' diff --git a/vendor/services/lib/sp_services/api/service_api.rb b/vendor/services/lib/sp_services/api/service_api.rb deleted file mode 100644 index 5272730..0000000 --- a/vendor/services/lib/sp_services/api/service_api.rb +++ /dev/null @@ -1,1170 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpServices - class ServiceApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Adds an appointment to the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Add appointment operation input details. - # @param service_job_id An Amazon defined service job identifier. - # @param [Hash] opts the optional parameters - # @return [SetAppointmentResponse] - def add_appointment_for_service_job_by_service_job_id(body, service_job_id, opts = {}) - data = add_appointment_for_service_job_by_service_job_id_with_http_info(body, service_job_id, opts) - return data - end - - # Adds an appointment to the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Add appointment operation input details. - # @param service_job_id An Amazon defined service job identifier. - # @param [Hash] opts the optional parameters - # @return [Array<(SetAppointmentResponse)>] SetAppointmentResponse data, response status code and response headers - def add_appointment_for_service_job_by_service_job_id_with_http_info(body, service_job_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.add_appointment_for_service_job_by_service_job_id ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.add_appointment_for_service_job_by_service_job_id" - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.add_appointment_for_service_job_by_service_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/appointments'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#add_appointment_for_service_job_by_service_job_id\nData: #{data.inspect}" - end - return data - end - # Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param service_job_id An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. - # @param appointment_id An Amazon-defined identifier of active service job appointment. - # @param [Hash] opts the optional parameters - # @return [AssignAppointmentResourcesResponse] - def assign_appointment_resources(body, service_job_id, appointment_id, opts = {}) - data = assign_appointment_resources_with_http_info(body, service_job_id, appointment_id, opts) - return data - end - - # Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body - # @param service_job_id An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. - # @param appointment_id An Amazon-defined identifier of active service job appointment. - # @param [Hash] opts the optional parameters - # @return [Array<(AssignAppointmentResourcesResponse)>] AssignAppointmentResourcesResponse data, response status code and response headers - def assign_appointment_resources_with_http_info(body, service_job_id, appointment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.assign_appointment_resources ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.assign_appointment_resources" - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.assign_appointment_resources" - end - # verify the required parameter 'appointment_id' is set - if @api_client.config.client_side_validation && appointment_id.nil? - fail ArgumentError, "Missing the required parameter 'appointment_id' when calling ServiceApi.assign_appointment_resources" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId}/resources'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s).sub('{' + 'appointmentId' + '}', appointment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#assign_appointment_resources\nData: #{data.inspect}" - end - return data - end - # Cancel a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param reservation_id Reservation Identifier - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @return [CancelReservationResponse] - def cancel_reservation(reservation_id, marketplace_ids, opts = {}) - data = cancel_reservation_with_http_info(reservation_id, marketplace_ids, opts) - return data - end - - # Cancel a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param reservation_id Reservation Identifier - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @return [Array<(CancelReservationResponse)>] CancelReservationResponse data, response status code and response headers - def cancel_reservation_with_http_info(reservation_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.cancel_reservation ...' - end - # verify the required parameter 'reservation_id' is set - if @api_client.config.client_side_validation && reservation_id.nil? - fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ServiceApi.cancel_reservation" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.cancel_reservation" - end - # resource path - local_var_path = '/service/v1/reservation/{reservationId}'.sub('{' + 'reservationId' + '}', reservation_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#cancel_reservation\nData: #{data.inspect}" - end - return data - end - # Cancels the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id An Amazon defined service job identifier. - # @param cancellation_reason_code A cancel reason code that specifies the reason for cancelling a service job. - # @param [Hash] opts the optional parameters - # @return [CancelServiceJobByServiceJobIdResponse] - def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code, opts = {}) - data = cancel_service_job_by_service_job_id_with_http_info(service_job_id, cancellation_reason_code, opts) - return data - end - - # Cancels the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id An Amazon defined service job identifier. - # @param cancellation_reason_code A cancel reason code that specifies the reason for cancelling a service job. - # @param [Hash] opts the optional parameters - # @return [Array<(CancelServiceJobByServiceJobIdResponse)>] CancelServiceJobByServiceJobIdResponse data, response status code and response headers - def cancel_service_job_by_service_job_id_with_http_info(service_job_id, cancellation_reason_code, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.cancel_service_job_by_service_job_id ...' - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.cancel_service_job_by_service_job_id" - end - # verify the required parameter 'cancellation_reason_code' is set - if @api_client.config.client_side_validation && cancellation_reason_code.nil? - fail ArgumentError, "Missing the required parameter 'cancellation_reason_code' when calling ServiceApi.cancel_service_job_by_service_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/cancellations'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'cancellationReasonCode'] = cancellation_reason_code - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#cancel_service_job_by_service_job_id\nData: #{data.inspect}" - end - return data - end - # Completes the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id An Amazon defined service job identifier. - # @param [Hash] opts the optional parameters - # @return [CompleteServiceJobByServiceJobIdResponse] - def complete_service_job_by_service_job_id(service_job_id, opts = {}) - data = complete_service_job_by_service_job_id_with_http_info(service_job_id, opts) - return data - end - - # Completes the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id An Amazon defined service job identifier. - # @param [Hash] opts the optional parameters - # @return [Array<(CompleteServiceJobByServiceJobIdResponse)>] CompleteServiceJobByServiceJobIdResponse data, response status code and response headers - def complete_service_job_by_service_job_id_with_http_info(service_job_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.complete_service_job_by_service_job_id ...' - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.complete_service_job_by_service_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/completions'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#complete_service_job_by_service_job_id\nData: #{data.inspect}" - end - return data - end - # Create a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reservation details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @return [CreateReservationResponse] - def create_reservation(body, marketplace_ids, opts = {}) - data = create_reservation_with_http_info(body, marketplace_ids, opts) - return data - end - - # Create a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reservation details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateReservationResponse)>] CreateReservationResponse data, response status code and response headers - def create_reservation_with_http_info(body, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.create_reservation ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.create_reservation" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.create_reservation" - end - # resource path - local_var_path = '/service/v1/reservation' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#create_reservation\nData: #{data.inspect}" - end - return data - end - # Creates an upload destination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Upload document operation input details. - # @param [Hash] opts the optional parameters - # @return [CreateServiceDocumentUploadDestination] - def create_service_document_upload_destination(body, opts = {}) - data = create_service_document_upload_destination_with_http_info(body, opts) - return data - end - - # Creates an upload destination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Upload document operation input details. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateServiceDocumentUploadDestination)>] CreateServiceDocumentUploadDestination data, response status code and response headers - def create_service_document_upload_destination_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.create_service_document_upload_destination ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.create_service_document_upload_destination" - end - # resource path - local_var_path = '/service/v1/documents' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#create_service_document_upload_destination\nData: #{data.inspect}" - end - return data - end - # Gets appointment slots as per the service context specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 20 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param asin ASIN associated with the service. - # @param store_id Store identifier defining the region scope to retrive appointment slots. - # @param marketplace_ids An identifier for the marketplace for which appointment slots are queried - # @param [Hash] opts the optional parameters - # @option opts [String] :start_time A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - # @option opts [String] :end_time A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. - # @return [GetAppointmentSlotsResponse] - def get_appointment_slots(asin, store_id, marketplace_ids, opts = {}) - data = get_appointment_slots_with_http_info(asin, store_id, marketplace_ids, opts) - return data - end - - # Gets appointment slots as per the service context specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 20 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param asin ASIN associated with the service. - # @param store_id Store identifier defining the region scope to retrive appointment slots. - # @param marketplace_ids An identifier for the marketplace for which appointment slots are queried - # @param [Hash] opts the optional parameters - # @option opts [String] :start_time A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - # @option opts [String] :end_time A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. - # @return [Array<(GetAppointmentSlotsResponse)>] GetAppointmentSlotsResponse data, response status code and response headers - def get_appointment_slots_with_http_info(asin, store_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_appointment_slots ...' - end - # verify the required parameter 'asin' is set - if @api_client.config.client_side_validation && asin.nil? - fail ArgumentError, "Missing the required parameter 'asin' when calling ServiceApi.get_appointment_slots" - end - # verify the required parameter 'store_id' is set - if @api_client.config.client_side_validation && store_id.nil? - fail ArgumentError, "Missing the required parameter 'store_id' when calling ServiceApi.get_appointment_slots" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.get_appointment_slots" - end - # resource path - local_var_path = '/service/v1/appointmentSlots' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'asin'] = asin - query_params[:'storeId'] = store_id - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil? - query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_appointment_slots\nData: #{data.inspect}" - end - return data - end - # Gets appointment slots for the service associated with the service job id specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id A service job identifier to retrive appointment slots for associated service. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @option opts [String] :start_time A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - # @option opts [String] :end_time A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. - # @return [GetAppointmentSlotsResponse] - def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, opts = {}) - data = get_appointmment_slots_by_job_id_with_http_info(service_job_id, marketplace_ids, opts) - return data - end - - # Gets appointment slots for the service associated with the service job id specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id A service job identifier to retrive appointment slots for associated service. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param [Hash] opts the optional parameters - # @option opts [String] :start_time A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per business configuration. - # @option opts [String] :end_time A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days. - # @return [Array<(GetAppointmentSlotsResponse)>] GetAppointmentSlotsResponse data, response status code and response headers - def get_appointmment_slots_by_job_id_with_http_info(service_job_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_appointmment_slots_by_job_id ...' - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.get_appointmment_slots_by_job_id" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.get_appointmment_slots_by_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/appointmentSlots'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil? - query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_appointmment_slots_by_job_id\nData: #{data.inspect}" - end - return data - end - # Provides capacity in fixed-size slots. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Request body. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource Identifier. - # @param [Hash] opts the optional parameters - # @option opts [String] :next_page_token Next page token returned in the response of your previous request. - # @return [FixedSlotCapacity] - def get_fixed_slot_capacity(body, marketplace_ids, resource_id, opts = {}) - data = get_fixed_slot_capacity_with_http_info(body, marketplace_ids, resource_id, opts) - return data - end - - # Provides capacity in fixed-size slots. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Request body. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource Identifier. - # @param [Hash] opts the optional parameters - # @option opts [String] :next_page_token Next page token returned in the response of your previous request. - # @return [Array<(FixedSlotCapacity)>] FixedSlotCapacity data, response status code and response headers - def get_fixed_slot_capacity_with_http_info(body, marketplace_ids, resource_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_fixed_slot_capacity ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.get_fixed_slot_capacity" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.get_fixed_slot_capacity" - end - # verify the required parameter 'resource_id' is set - if @api_client.config.client_side_validation && resource_id.nil? - fail ArgumentError, "Missing the required parameter 'resource_id' when calling ServiceApi.get_fixed_slot_capacity" - end - # resource path - local_var_path = '/service/v1/serviceResources/{resourceId}/capacity/fixed'.sub('{' + 'resourceId' + '}', resource_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'nextPageToken'] = opts[:'next_page_token'] if !opts[:'next_page_token'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_fixed_slot_capacity\nData: #{data.inspect}" - end - return data - end - # Provides capacity slots in a format similar to availability records. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Request body. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource Identifier. - # @param [Hash] opts the optional parameters - # @option opts [String] :next_page_token Next page token returned in the response of your previous request. - # @return [RangeSlotCapacity] - def get_range_slot_capacity(body, marketplace_ids, resource_id, opts = {}) - data = get_range_slot_capacity_with_http_info(body, marketplace_ids, resource_id, opts) - return data - end - - # Provides capacity slots in a format similar to availability records. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Request body. - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource Identifier. - # @param [Hash] opts the optional parameters - # @option opts [String] :next_page_token Next page token returned in the response of your previous request. - # @return [Array<(RangeSlotCapacity)>] RangeSlotCapacity data, response status code and response headers - def get_range_slot_capacity_with_http_info(body, marketplace_ids, resource_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_range_slot_capacity ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.get_range_slot_capacity" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.get_range_slot_capacity" - end - # verify the required parameter 'resource_id' is set - if @api_client.config.client_side_validation && resource_id.nil? - fail ArgumentError, "Missing the required parameter 'resource_id' when calling ServiceApi.get_range_slot_capacity" - end - # resource path - local_var_path = '/service/v1/serviceResources/{resourceId}/capacity/range'.sub('{' + 'resourceId' + '}', resource_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'nextPageToken'] = opts[:'next_page_token'] if !opts[:'next_page_token'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_range_slot_capacity\nData: #{data.inspect}" - end - return data - end - # Gets details of service job indicated by the provided `serviceJobID`. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 20 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id A service job identifier. - # @param [Hash] opts the optional parameters - # @return [GetServiceJobByServiceJobIdResponse] - def get_service_job_by_service_job_id(service_job_id, opts = {}) - data = get_service_job_by_service_job_id_with_http_info(service_job_id, opts) - return data - end - - # Gets details of service job indicated by the provided `serviceJobID`. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 20 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param service_job_id A service job identifier. - # @param [Hash] opts the optional parameters - # @return [Array<(GetServiceJobByServiceJobIdResponse)>] GetServiceJobByServiceJobIdResponse data, response status code and response headers - def get_service_job_by_service_job_id_with_http_info(service_job_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_service_job_by_service_job_id ...' - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.get_service_job_by_service_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_service_job_by_service_job_id\nData: #{data.inspect}" - end - return data - end - # Gets service job details for the specified filter query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids Used to select jobs that were placed in the specified marketplaces. - # @param [Hash] opts the optional parameters - # @option opts [Array] :service_order_ids List of service order ids for the query you want to perform.Max values supported 20. - # @option opts [Array] :service_job_status A list of one or more job status by which to filter the list of jobs. - # @option opts [String] :page_token String returned in the response of your previous request. - # @option opts [Integer] :page_size A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20. (default to 20) - # @option opts [String] :sort_field Sort fields on which you want to sort the output. - # @option opts [String] :sort_order Sort order for the query you want to perform. - # @option opts [String] :created_after A date used for selecting jobs created at or after a specified time. Must be in ISO 8601 format. Required if `LastUpdatedAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - # @option opts [String] :created_before A date used for selecting jobs created at or before a specified time. Must be in ISO 8601 format. - # @option opts [String] :last_updated_after A date used for selecting jobs updated at or after a specified time. Must be in ISO 8601 format. Required if `createdAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - # @option opts [String] :last_updated_before A date used for selecting jobs updated at or before a specified time. Must be in ISO 8601 format. - # @option opts [String] :schedule_start_date A date used for filtering jobs schedules at or after a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - # @option opts [String] :schedule_end_date A date used for filtering jobs schedules at or before a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - # @option opts [Array] :asins List of Amazon Standard Identification Numbers (ASIN) of the items. Max values supported is 20. - # @option opts [Array] :required_skills A defined set of related knowledge, skills, experience, tools, materials, and work processes common to service delivery for a set of products and/or service scenarios. Max values supported is 20. - # @option opts [Array] :store_ids List of Amazon-defined identifiers for the region scope. Max values supported is 50. - # @return [GetServiceJobsResponse] - def get_service_jobs(marketplace_ids, opts = {}) - data = get_service_jobs_with_http_info(marketplace_ids, opts) - return data - end - - # Gets service job details for the specified filter query. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 40 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids Used to select jobs that were placed in the specified marketplaces. - # @param [Hash] opts the optional parameters - # @option opts [Array] :service_order_ids List of service order ids for the query you want to perform.Max values supported 20. - # @option opts [Array] :service_job_status A list of one or more job status by which to filter the list of jobs. - # @option opts [String] :page_token String returned in the response of your previous request. - # @option opts [Integer] :page_size A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20. - # @option opts [String] :sort_field Sort fields on which you want to sort the output. - # @option opts [String] :sort_order Sort order for the query you want to perform. - # @option opts [String] :created_after A date used for selecting jobs created at or after a specified time. Must be in ISO 8601 format. Required if `LastUpdatedAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - # @option opts [String] :created_before A date used for selecting jobs created at or before a specified time. Must be in ISO 8601 format. - # @option opts [String] :last_updated_after A date used for selecting jobs updated at or after a specified time. Must be in ISO 8601 format. Required if `createdAfter` is not specified. Specifying both `CreatedAfter` and `LastUpdatedAfter` returns an error. - # @option opts [String] :last_updated_before A date used for selecting jobs updated at or before a specified time. Must be in ISO 8601 format. - # @option opts [String] :schedule_start_date A date used for filtering jobs schedules at or after a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - # @option opts [String] :schedule_end_date A date used for filtering jobs schedules at or before a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date. - # @option opts [Array] :asins List of Amazon Standard Identification Numbers (ASIN) of the items. Max values supported is 20. - # @option opts [Array] :required_skills A defined set of related knowledge, skills, experience, tools, materials, and work processes common to service delivery for a set of products and/or service scenarios. Max values supported is 20. - # @option opts [Array] :store_ids List of Amazon-defined identifiers for the region scope. Max values supported is 50. - # @return [Array<(GetServiceJobsResponse)>] GetServiceJobsResponse data, response status code and response headers - def get_service_jobs_with_http_info(marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.get_service_jobs ...' - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.get_service_jobs" - end - if @api_client.config.client_side_validation && opts[:'service_job_status'] && !opts[:'service_job_status'].all? { |item| ['NOT_SERVICED', 'CANCELLED', 'COMPLETED', 'PENDING_SCHEDULE', 'NOT_FULFILLABLE', 'HOLD', 'PAYMENT_DECLINED'].include?(item) } - fail ArgumentError, 'invalid value for "service_job_status", must include one of NOT_SERVICED, CANCELLED, COMPLETED, PENDING_SCHEDULE, NOT_FULFILLABLE, HOLD, PAYMENT_DECLINED' - end - if @api_client.config.client_side_validation && opts[:'sort_field'] && !['JOB_DATE', 'JOB_STATUS'].include?(opts[:'sort_field']) - fail ArgumentError, 'invalid value for "sort_field", must be one of JOB_DATE, JOB_STATUS' - end - if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order']) - fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC' - end - # resource path - local_var_path = '/service/v1/serviceJobs' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'serviceOrderIds'] = @api_client.build_collection_param(opts[:'service_order_ids'], :csv) if !opts[:'service_order_ids'].nil? - query_params[:'serviceJobStatus'] = @api_client.build_collection_param(opts[:'service_job_status'], :csv) if !opts[:'service_job_status'].nil? - query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? - query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sortField'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? - query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil? - query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? - query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? - query_params[:'lastUpdatedAfter'] = opts[:'last_updated_after'] if !opts[:'last_updated_after'].nil? - query_params[:'lastUpdatedBefore'] = opts[:'last_updated_before'] if !opts[:'last_updated_before'].nil? - query_params[:'scheduleStartDate'] = opts[:'schedule_start_date'] if !opts[:'schedule_start_date'].nil? - query_params[:'scheduleEndDate'] = opts[:'schedule_end_date'] if !opts[:'schedule_end_date'].nil? - query_params[:'asins'] = @api_client.build_collection_param(opts[:'asins'], :csv) if !opts[:'asins'].nil? - query_params[:'requiredSkills'] = @api_client.build_collection_param(opts[:'required_skills'], :csv) if !opts[:'required_skills'].nil? - query_params[:'storeIds'] = @api_client.build_collection_param(opts[:'store_ids'], :csv) if !opts[:'store_ids'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#get_service_jobs\nData: #{data.inspect}" - end - return data - end - # Reschedules an appointment for the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reschedule appointment operation input details. - # @param service_job_id An Amazon defined service job identifier. - # @param appointment_id An existing appointment identifier for the Service Job. - # @param [Hash] opts the optional parameters - # @return [SetAppointmentResponse] - def reschedule_appointment_for_service_job_by_service_job_id(body, service_job_id, appointment_id, opts = {}) - data = reschedule_appointment_for_service_job_by_service_job_id_with_http_info(body, service_job_id, appointment_id, opts) - return data - end - - # Reschedules an appointment for the service job indicated by the service job identifier specified. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reschedule appointment operation input details. - # @param service_job_id An Amazon defined service job identifier. - # @param appointment_id An existing appointment identifier for the Service Job. - # @param [Hash] opts the optional parameters - # @return [Array<(SetAppointmentResponse)>] SetAppointmentResponse data, response status code and response headers - def reschedule_appointment_for_service_job_by_service_job_id_with_http_info(body, service_job_id, appointment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.reschedule_appointment_for_service_job_by_service_job_id ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.reschedule_appointment_for_service_job_by_service_job_id" - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.reschedule_appointment_for_service_job_by_service_job_id" - end - # verify the required parameter 'appointment_id' is set - if @api_client.config.client_side_validation && appointment_id.nil? - fail ArgumentError, "Missing the required parameter 'appointment_id' when calling ServiceApi.reschedule_appointment_for_service_job_by_service_job_id" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId}'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s).sub('{' + 'appointmentId' + '}', appointment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#reschedule_appointment_for_service_job_by_service_job_id\nData: #{data.inspect}" - end - return data - end - # Updates the appointment fulfillment data related to a given `jobID` and `appointmentID`. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Appointment fulfillment data collection details. - # @param service_job_id An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. - # @param appointment_id An Amazon-defined identifier of active service job appointment. - # @param [Hash] opts the optional parameters - # @return [String] - def set_appointment_fulfillment_data(body, service_job_id, appointment_id, opts = {}) - data = set_appointment_fulfillment_data_with_http_info(body, service_job_id, appointment_id, opts) - return data - end - - # Updates the appointment fulfillment data related to a given `jobID` and `appointmentID`. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Appointment fulfillment data collection details. - # @param service_job_id An Amazon-defined service job identifier. Get this value by calling the `getServiceJobs` operation of the Services API. - # @param appointment_id An Amazon-defined identifier of active service job appointment. - # @param [Hash] opts the optional parameters - # @return [Array<(String)>] String data, response status code and response headers - def set_appointment_fulfillment_data_with_http_info(body, service_job_id, appointment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.set_appointment_fulfillment_data ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.set_appointment_fulfillment_data" - end - # verify the required parameter 'service_job_id' is set - if @api_client.config.client_side_validation && service_job_id.nil? - fail ArgumentError, "Missing the required parameter 'service_job_id' when calling ServiceApi.set_appointment_fulfillment_data" - end - # verify the required parameter 'appointment_id' is set - if @api_client.config.client_side_validation && appointment_id.nil? - fail ArgumentError, "Missing the required parameter 'appointment_id' when calling ServiceApi.set_appointment_fulfillment_data" - end - # resource path - local_var_path = '/service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId}/fulfillment'.sub('{' + 'serviceJobId' + '}', service_job_id.to_s).sub('{' + 'appointmentId' + '}', appointment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#set_appointment_fulfillment_data\nData: #{data.inspect}" - end - return data - end - # Update a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reservation details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param reservation_id Reservation Identifier - # @param [Hash] opts the optional parameters - # @return [UpdateReservationResponse] - def update_reservation(body, marketplace_ids, reservation_id, opts = {}) - data = update_reservation_with_http_info(body, marketplace_ids, reservation_id, opts) - return data - end - - # Update a reservation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Reservation details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param reservation_id Reservation Identifier - # @param [Hash] opts the optional parameters - # @return [Array<(UpdateReservationResponse)>] UpdateReservationResponse data, response status code and response headers - def update_reservation_with_http_info(body, marketplace_ids, reservation_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.update_reservation ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.update_reservation" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.update_reservation" - end - # verify the required parameter 'reservation_id' is set - if @api_client.config.client_side_validation && reservation_id.nil? - fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ServiceApi.update_reservation" - end - # resource path - local_var_path = '/service/v1/reservation/{reservationId}'.sub('{' + 'reservationId' + '}', reservation_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#update_reservation\nData: #{data.inspect}" - end - return data - end - # Update the schedule of the given resource. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Schedule details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource (store) Identifier - # @param [Hash] opts the optional parameters - # @return [UpdateScheduleResponse] - def update_schedule(body, marketplace_ids, resource_id, opts = {}) - data = update_schedule_with_http_info(body, marketplace_ids, resource_id, opts) - return data - end - - # Update the schedule of the given resource. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body Schedule details - # @param marketplace_ids An identifier for the marketplace in which the resource operates. - # @param resource_id Resource (store) Identifier - # @param [Hash] opts the optional parameters - # @return [Array<(UpdateScheduleResponse)>] UpdateScheduleResponse data, response status code and response headers - def update_schedule_with_http_info(body, marketplace_ids, resource_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceApi.update_schedule ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceApi.update_schedule" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling ServiceApi.update_schedule" - end - # verify the required parameter 'resource_id' is set - if @api_client.config.client_side_validation && resource_id.nil? - fail ArgumentError, "Missing the required parameter 'resource_id' when calling ServiceApi.update_schedule" - end - # resource path - local_var_path = '/service/v1/serviceResources/{resourceId}/schedules'.sub('{' + 'resourceId' + '}', resource_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceApi#update_schedule\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/services/lib/sp_services/api_client.rb b/vendor/services/lib/sp_services/api_client.rb deleted file mode 100644 index 0797059..0000000 --- a/vendor/services/lib/sp_services/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpServices - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpServices.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/services/lib/sp_services/api_error.rb b/vendor/services/lib/sp_services/api_error.rb deleted file mode 100644 index 02ad0ed..0000000 --- a/vendor/services/lib/sp_services/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpServices - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/services/lib/sp_services/configuration.rb b/vendor/services/lib/sp_services/configuration.rb deleted file mode 100644 index 0766da8..0000000 --- a/vendor/services/lib/sp_services/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpServices - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/services/lib/sp_services/models/add_appointment_request.rb b/vendor/services/lib/sp_services/models/add_appointment_request.rb deleted file mode 100644 index 1af4c8e..0000000 --- a/vendor/services/lib/sp_services/models/add_appointment_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Input for add appointment operation. - class AddAppointmentRequest - attr_accessor :appointment_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'appointment_time' => :'appointmentTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'appointment_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AddAppointmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AddAppointmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'appointment_time') - self.appointment_time = attributes[:'appointment_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @appointment_time.nil? - invalid_properties.push('invalid value for "appointment_time", appointment_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @appointment_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - appointment_time == o.appointment_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [appointment_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/address.rb b/vendor/services/lib/sp_services/models/address.rb deleted file mode 100644 index 5c77ae2..0000000 --- a/vendor/services/lib/sp_services/models/address.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The shipping address for the service job. - class Address - # The name of the person, business, or institution. - attr_accessor :name - - # The first line of the address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - # The city. - attr_accessor :city - - # The county. - attr_accessor :county - - # The district. - attr_accessor :district - - # The state or region. - attr_accessor :state_or_region - - # The postal code. This can contain letters, digits, spaces, and/or punctuation. - attr_accessor :postal_code - - # The two digit country code, in ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment.rb b/vendor/services/lib/sp_services/models/appointment.rb deleted file mode 100644 index 1ee54a0..0000000 --- a/vendor/services/lib/sp_services/models/appointment.rb +++ /dev/null @@ -1,294 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The details of an appointment. - class Appointment - attr_accessor :appointment_id - - # The status of the appointment. - attr_accessor :appointment_status - - attr_accessor :appointment_time - - # A list of technicians assigned to the service job. - attr_accessor :assigned_technicians - - attr_accessor :rescheduled_appointment_id - - attr_accessor :poa - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'appointment_id' => :'appointmentId', - :'appointment_status' => :'appointmentStatus', - :'appointment_time' => :'appointmentTime', - :'assigned_technicians' => :'assignedTechnicians', - :'rescheduled_appointment_id' => :'rescheduledAppointmentId', - :'poa' => :'poa' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'appointment_id' => :'Object', - :'appointment_status' => :'Object', - :'appointment_time' => :'Object', - :'assigned_technicians' => :'Object', - :'rescheduled_appointment_id' => :'Object', - :'poa' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Appointment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Appointment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'appointment_id') - self.appointment_id = attributes[:'appointment_id'] - end - - if attributes.key?(:'appointment_status') - self.appointment_status = attributes[:'appointment_status'] - end - - if attributes.key?(:'appointment_time') - self.appointment_time = attributes[:'appointment_time'] - end - - if attributes.key?(:'assigned_technicians') - if (value = attributes[:'assigned_technicians']).is_a?(Array) - self.assigned_technicians = value - end - end - - if attributes.key?(:'rescheduled_appointment_id') - self.rescheduled_appointment_id = attributes[:'rescheduled_appointment_id'] - end - - if attributes.key?(:'poa') - self.poa = attributes[:'poa'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - appointment_status_validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'CANCELLED', 'COMPLETED']) - return false unless appointment_status_validator.valid?(@appointment_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] appointment_status Object to be assigned - def appointment_status=(appointment_status) - validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'CANCELLED', 'COMPLETED']) - unless validator.valid?(appointment_status) - fail ArgumentError, "invalid value for \"appointment_status\", must be one of #{validator.allowable_values}." - end - @appointment_status = appointment_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - appointment_id == o.appointment_id && - appointment_status == o.appointment_status && - appointment_time == o.appointment_time && - assigned_technicians == o.assigned_technicians && - rescheduled_appointment_id == o.rescheduled_appointment_id && - poa == o.poa - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [appointment_id, appointment_status, appointment_time, assigned_technicians, rescheduled_appointment_id, poa].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_id.rb b/vendor/services/lib/sp_services/models/appointment_id.rb deleted file mode 100644 index ed2dceb..0000000 --- a/vendor/services/lib/sp_services/models/appointment_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The appointment identifier. - class AppointmentId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_resource.rb b/vendor/services/lib/sp_services/models/appointment_resource.rb deleted file mode 100644 index 5b213e7..0000000 --- a/vendor/services/lib/sp_services/models/appointment_resource.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The resource that performs or performed appointment fulfillment. - class AppointmentResource - # The resource identifier. - attr_accessor :resource_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_id' => :'resourceId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentResource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_id == o.resource_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_resources.rb b/vendor/services/lib/sp_services/models/appointment_resources.rb deleted file mode 100644 index db9debe..0000000 --- a/vendor/services/lib/sp_services/models/appointment_resources.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # List of resources that performs or performed job appointment fulfillment. - class AppointmentResources - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentResources` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentResources`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_slot.rb b/vendor/services/lib/sp_services/models/appointment_slot.rb deleted file mode 100644 index 1322441..0000000 --- a/vendor/services/lib/sp_services/models/appointment_slot.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # A time window along with associated capacity in which the service can be performed. - class AppointmentSlot - # Time window start time in ISO 8601 format. - attr_accessor :start_time - - # Time window end time in ISO 8601 format. - attr_accessor :end_time - - # Number of resources for which a slot can be reserved. - attr_accessor :capacity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'end_time' => :'endTime', - :'capacity' => :'capacity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'end_time' => :'Object', - :'capacity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentSlot` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentSlot`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'capacity') - self.capacity = attributes[:'capacity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time && - capacity == o.capacity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time, capacity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_slot_report.rb b/vendor/services/lib/sp_services/models/appointment_slot_report.rb deleted file mode 100644 index a9373bf..0000000 --- a/vendor/services/lib/sp_services/models/appointment_slot_report.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Availability information as per the service context queried. - class AppointmentSlotReport - # Defines the type of slots. - attr_accessor :scheduling_type - - # Start Time from which the appointment slots are generated in ISO 8601 format. - attr_accessor :start_time - - # End Time up to which the appointment slots are generated in ISO 8601 format. - attr_accessor :end_time - - # A list of time windows along with associated capacity in which the service can be performed. - attr_accessor :appointment_slots - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'scheduling_type' => :'schedulingType', - :'start_time' => :'startTime', - :'end_time' => :'endTime', - :'appointment_slots' => :'appointmentSlots' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'scheduling_type' => :'Object', - :'start_time' => :'Object', - :'end_time' => :'Object', - :'appointment_slots' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentSlotReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentSlotReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'scheduling_type') - self.scheduling_type = attributes[:'scheduling_type'] - end - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'appointment_slots') - if (value = attributes[:'appointment_slots']).is_a?(Array) - self.appointment_slots = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - scheduling_type_validator = EnumAttributeValidator.new('Object', ['REAL_TIME_SCHEDULING', 'NON_REAL_TIME_SCHEDULING']) - return false unless scheduling_type_validator.valid?(@scheduling_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] scheduling_type Object to be assigned - def scheduling_type=(scheduling_type) - validator = EnumAttributeValidator.new('Object', ['REAL_TIME_SCHEDULING', 'NON_REAL_TIME_SCHEDULING']) - unless validator.valid?(scheduling_type) - fail ArgumentError, "invalid value for \"scheduling_type\", must be one of #{validator.allowable_values}." - end - @scheduling_type = scheduling_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - scheduling_type == o.scheduling_type && - start_time == o.start_time && - end_time == o.end_time && - appointment_slots == o.appointment_slots - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [scheduling_type, start_time, end_time, appointment_slots].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_time.rb b/vendor/services/lib/sp_services/models/appointment_time.rb deleted file mode 100644 index 05aa803..0000000 --- a/vendor/services/lib/sp_services/models/appointment_time.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The time of the appointment window. - class AppointmentTime - # The date and time of the start of the appointment window in ISO 8601 format. - attr_accessor :start_time - - # The duration of the appointment window, in minutes. - attr_accessor :duration_in_minutes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'duration_in_minutes' => :'durationInMinutes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'duration_in_minutes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentTime` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentTime`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'duration_in_minutes') - self.duration_in_minutes = attributes[:'duration_in_minutes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_time.nil? - invalid_properties.push('invalid value for "start_time", start_time cannot be nil.') - end - - if @duration_in_minutes.nil? - invalid_properties.push('invalid value for "duration_in_minutes", duration_in_minutes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_time.nil? - return false if @duration_in_minutes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - duration_in_minutes == o.duration_in_minutes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, duration_in_minutes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/appointment_time_input.rb b/vendor/services/lib/sp_services/models/appointment_time_input.rb deleted file mode 100644 index 831b770..0000000 --- a/vendor/services/lib/sp_services/models/appointment_time_input.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The input appointment time details. - class AppointmentTimeInput - # The date, time in UTC for the start time of an appointment in ISO 8601 format. - attr_accessor :start_time - - # The duration of an appointment in minutes. - attr_accessor :duration_in_minutes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'duration_in_minutes' => :'durationInMinutes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'duration_in_minutes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AppointmentTimeInput` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AppointmentTimeInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'duration_in_minutes') - self.duration_in_minutes = attributes[:'duration_in_minutes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_time.nil? - invalid_properties.push('invalid value for "start_time", start_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - duration_in_minutes == o.duration_in_minutes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, duration_in_minutes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/assign_appointment_resources_request.rb b/vendor/services/lib/sp_services/models/assign_appointment_resources_request.rb deleted file mode 100644 index dd05df8..0000000 --- a/vendor/services/lib/sp_services/models/assign_appointment_resources_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `assignAppointmentResources` operation. - class AssignAppointmentResourcesRequest - attr_accessor :resources - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resources' => :'resources' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resources' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AssignAppointmentResourcesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AssignAppointmentResourcesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resources') - self.resources = attributes[:'resources'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @resources.nil? - invalid_properties.push('invalid value for "resources", resources cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @resources.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resources == o.resources - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resources].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/assign_appointment_resources_response.rb b/vendor/services/lib/sp_services/models/assign_appointment_resources_response.rb deleted file mode 100644 index 5d3a040..0000000 --- a/vendor/services/lib/sp_services/models/assign_appointment_resources_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `assignAppointmentResources` operation. - class AssignAppointmentResourcesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AssignAppointmentResourcesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AssignAppointmentResourcesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/assign_appointment_resources_response_payload.rb b/vendor/services/lib/sp_services/models/assign_appointment_resources_response_payload.rb deleted file mode 100644 index 8936e50..0000000 --- a/vendor/services/lib/sp_services/models/assign_appointment_resources_response_payload.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The payload for the `assignAppointmentResource` operation. - class AssignAppointmentResourcesResponsePayload - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warnings' => :'warnings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'warnings' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AssignAppointmentResourcesResponsePayload` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AssignAppointmentResourcesResponsePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warnings') - self.warnings = attributes[:'warnings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/associated_item.rb b/vendor/services/lib/sp_services/models/associated_item.rb deleted file mode 100644 index b3eb950..0000000 --- a/vendor/services/lib/sp_services/models/associated_item.rb +++ /dev/null @@ -1,304 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about an item associated with the service job. - class AssociatedItem - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # The title of the item. - attr_accessor :title - - # The total number of items included in the order. - attr_accessor :quantity - - attr_accessor :order_id - - # The status of the item. - attr_accessor :item_status - - # The brand name of the item. - attr_accessor :brand_name - - attr_accessor :item_delivery - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'asin', - :'title' => :'title', - :'quantity' => :'quantity', - :'order_id' => :'orderId', - :'item_status' => :'itemStatus', - :'brand_name' => :'brandName', - :'item_delivery' => :'itemDelivery' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'title' => :'Object', - :'quantity' => :'Object', - :'order_id' => :'Object', - :'item_status' => :'Object', - :'brand_name' => :'Object', - :'item_delivery' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AssociatedItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AssociatedItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'order_id') - self.order_id = attributes[:'order_id'] - end - - if attributes.key?(:'item_status') - self.item_status = attributes[:'item_status'] - end - - if attributes.key?(:'brand_name') - self.brand_name = attributes[:'brand_name'] - end - - if attributes.key?(:'item_delivery') - self.item_delivery = attributes[:'item_delivery'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - item_status_validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'CANCELLED', 'SHIPPED', 'DELIVERED']) - return false unless item_status_validator.valid?(@item_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] item_status Object to be assigned - def item_status=(item_status) - validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'CANCELLED', 'SHIPPED', 'DELIVERED']) - unless validator.valid?(item_status) - fail ArgumentError, "invalid value for \"item_status\", must be one of #{validator.allowable_values}." - end - @item_status = item_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - title == o.title && - quantity == o.quantity && - order_id == o.order_id && - item_status == o.item_status && - brand_name == o.brand_name && - item_delivery == o.item_delivery - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, title, quantity, order_id, item_status, brand_name, item_delivery].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/availability_record.rb b/vendor/services/lib/sp_services/models/availability_record.rb deleted file mode 100644 index 93aa798..0000000 --- a/vendor/services/lib/sp_services/models/availability_record.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # `AvailabilityRecord` to represent the capacity of a resource over a time range. - class AvailabilityRecord - # Denotes the time from when the resource is available in a day in ISO-8601 format. - attr_accessor :start_time - - # Denotes the time till when the resource is available in a day in ISO-8601 format. - attr_accessor :end_time - - attr_accessor :recurrence - - # Signifies the capacity of a resource which is available. - attr_accessor :capacity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'end_time' => :'endTime', - :'recurrence' => :'recurrence', - :'capacity' => :'capacity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'end_time' => :'Object', - :'recurrence' => :'Object', - :'capacity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AvailabilityRecord` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AvailabilityRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'recurrence') - self.recurrence = attributes[:'recurrence'] - end - - if attributes.key?(:'capacity') - self.capacity = attributes[:'capacity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_time.nil? - invalid_properties.push('invalid value for "start_time", start_time cannot be nil.') - end - - if @end_time.nil? - invalid_properties.push('invalid value for "end_time", end_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_time.nil? - return false if @end_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time && - recurrence == o.recurrence && - capacity == o.capacity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time, recurrence, capacity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/availability_records.rb b/vendor/services/lib/sp_services/models/availability_records.rb deleted file mode 100644 index f97897c..0000000 --- a/vendor/services/lib/sp_services/models/availability_records.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # List of `AvailabilityRecord`s to represent the capacity of a resource over a time range. - class AvailabilityRecords - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::AvailabilityRecords` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::AvailabilityRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/buyer.rb b/vendor/services/lib/sp_services/models/buyer.rb deleted file mode 100644 index e7b587a..0000000 --- a/vendor/services/lib/sp_services/models/buyer.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about the buyer. - class Buyer - # The identifier of the buyer. - attr_accessor :buyer_id - - # The name of the buyer. - attr_accessor :name - - # The phone number of the buyer. - attr_accessor :phone - - # When true, the service is for an Amazon Prime buyer. - attr_accessor :is_prime_member - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer_id' => :'buyerId', - :'name' => :'name', - :'phone' => :'phone', - :'is_prime_member' => :'isPrimeMember' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer_id' => :'Object', - :'name' => :'Object', - :'phone' => :'Object', - :'is_prime_member' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Buyer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Buyer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer_id') - self.buyer_id = attributes[:'buyer_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_prime_member') - self.is_prime_member = attributes[:'is_prime_member'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer_id == o.buyer_id && - name == o.name && - phone == o.phone && - is_prime_member == o.is_prime_member - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer_id, name, phone, is_prime_member].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/cancel_reservation_response.rb b/vendor/services/lib/sp_services/models/cancel_reservation_response.rb deleted file mode 100644 index b2326b8..0000000 --- a/vendor/services/lib/sp_services/models/cancel_reservation_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `cancelReservation` operation. - class CancelReservationResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CancelReservationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CancelReservationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/cancel_service_job_by_service_job_id_response.rb b/vendor/services/lib/sp_services/models/cancel_service_job_by_service_job_id_response.rb deleted file mode 100644 index 5f86065..0000000 --- a/vendor/services/lib/sp_services/models/cancel_service_job_by_service_job_id_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `cancelServiceJobByServiceJobId` operation. - class CancelServiceJobByServiceJobIdResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CancelServiceJobByServiceJobIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CancelServiceJobByServiceJobIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/capacity_type.rb b/vendor/services/lib/sp_services/models/capacity_type.rb deleted file mode 100644 index c24b91a..0000000 --- a/vendor/services/lib/sp_services/models/capacity_type.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - class CapacityType - SCHEDULED_CAPACITY = 'SCHEDULED_CAPACITY'.freeze - AVAILABLE_CAPACITY = 'AVAILABLE_CAPACITY'.freeze - ENCUMBERED_CAPACITY = 'ENCUMBERED_CAPACITY'.freeze - RESERVED_CAPACITY = 'RESERVED_CAPACITY'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CapacityType.constants.select { |c| CapacityType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CapacityType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/services/lib/sp_services/models/complete_service_job_by_service_job_id_response.rb b/vendor/services/lib/sp_services/models/complete_service_job_by_service_job_id_response.rb deleted file mode 100644 index 8b291f4..0000000 --- a/vendor/services/lib/sp_services/models/complete_service_job_by_service_job_id_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `completeServiceJobByServiceJobId` operation. - class CompleteServiceJobByServiceJobIdResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CompleteServiceJobByServiceJobIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CompleteServiceJobByServiceJobIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/create_reservation_record.rb b/vendor/services/lib/sp_services/models/create_reservation_record.rb deleted file mode 100644 index 0a75880..0000000 --- a/vendor/services/lib/sp_services/models/create_reservation_record.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # `CreateReservationRecord` entity contains the `Reservation` if there is an error/warning while performing the requested operation on it, otherwise it will contain the new `reservationId`. - class CreateReservationRecord - attr_accessor :reservation - - attr_accessor :warnings - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reservation' => :'reservation', - :'warnings' => :'warnings', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reservation' => :'Object', - :'warnings' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CreateReservationRecord` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CreateReservationRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reservation') - self.reservation = attributes[:'reservation'] - end - - if attributes.key?(:'warnings') - self.warnings = attributes[:'warnings'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reservation == o.reservation && - warnings == o.warnings && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reservation, warnings, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/create_reservation_request.rb b/vendor/services/lib/sp_services/models/create_reservation_request.rb deleted file mode 100644 index 083ac6e..0000000 --- a/vendor/services/lib/sp_services/models/create_reservation_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `createReservation` operation. - class CreateReservationRequest - # Resource (store) identifier. - attr_accessor :resource_id - - attr_accessor :reservation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_id' => :'resourceId', - :'reservation' => :'reservation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_id' => :'Object', - :'reservation' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CreateReservationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CreateReservationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - - if attributes.key?(:'reservation') - self.reservation = attributes[:'reservation'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @resource_id.nil? - invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.') - end - - if @reservation.nil? - invalid_properties.push('invalid value for "reservation", reservation cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @resource_id.nil? - return false if @reservation.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_id == o.resource_id && - reservation == o.reservation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_id, reservation].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/create_reservation_response.rb b/vendor/services/lib/sp_services/models/create_reservation_response.rb deleted file mode 100644 index 230bdb2..0000000 --- a/vendor/services/lib/sp_services/models/create_reservation_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `createReservation` operation. - class CreateReservationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CreateReservationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CreateReservationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/create_service_document_upload_destination.rb b/vendor/services/lib/sp_services/models/create_service_document_upload_destination.rb deleted file mode 100644 index 60e9dbb..0000000 --- a/vendor/services/lib/sp_services/models/create_service_document_upload_destination.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The response schema for the `createServiceDocumentUploadDestination` operation. - class CreateServiceDocumentUploadDestination - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::CreateServiceDocumentUploadDestination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::CreateServiceDocumentUploadDestination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/day_of_week.rb b/vendor/services/lib/sp_services/models/day_of_week.rb deleted file mode 100644 index d968884..0000000 --- a/vendor/services/lib/sp_services/models/day_of_week.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - class DayOfWeek - MONDAY = 'MONDAY'.freeze - TUESDAY = 'TUESDAY'.freeze - WEDNESDAY = 'WEDNESDAY'.freeze - THURSDAY = 'THURSDAY'.freeze - FRIDAY = 'FRIDAY'.freeze - SATURDAY = 'SATURDAY'.freeze - SUNDAY = 'SUNDAY'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = DayOfWeek.constants.select { |c| DayOfWeek::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #DayOfWeek" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/services/lib/sp_services/models/encryption_details.rb b/vendor/services/lib/sp_services/models/encryption_details.rb deleted file mode 100644 index 1d86ad4..0000000 --- a/vendor/services/lib/sp_services/models/encryption_details.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Encryption details for required client-side encryption and decryption of document contents. - class EncryptionDetails - # The encryption standard required to encrypt or decrypt the document contents. - attr_accessor :standard - - # The vector to encrypt or decrypt the document contents using Cipher Block Chaining (CBC). - attr_accessor :initialization_vector - - # The encryption key used to encrypt or decrypt the document contents. - attr_accessor :key - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'standard' => :'standard', - :'initialization_vector' => :'initializationVector', - :'key' => :'key' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'standard' => :'Object', - :'initialization_vector' => :'Object', - :'key' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::EncryptionDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::EncryptionDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'standard') - self.standard = attributes[:'standard'] - end - - if attributes.key?(:'initialization_vector') - self.initialization_vector = attributes[:'initialization_vector'] - end - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @standard.nil? - invalid_properties.push('invalid value for "standard", standard cannot be nil.') - end - - if @initialization_vector.nil? - invalid_properties.push('invalid value for "initialization_vector", initialization_vector cannot be nil.') - end - - if @key.nil? - invalid_properties.push('invalid value for "key", key cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @standard.nil? - standard_validator = EnumAttributeValidator.new('Object', ['AES']) - return false unless standard_validator.valid?(@standard) - return false if @initialization_vector.nil? - return false if @key.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] standard Object to be assigned - def standard=(standard) - validator = EnumAttributeValidator.new('Object', ['AES']) - unless validator.valid?(standard) - fail ArgumentError, "invalid value for \"standard\", must be one of #{validator.allowable_values}." - end - @standard = standard - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - standard == o.standard && - initialization_vector == o.initialization_vector && - key == o.key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [standard, initialization_vector, key].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/error.rb b/vendor/services/lib/sp_services/models/error.rb deleted file mode 100644 index d114265..0000000 --- a/vendor/services/lib/sp_services/models/error.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # The type of error. - attr_accessor :error_level - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details', - :'error_level' => :'errorLevel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object', - :'error_level' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'error_level') - self.error_level = attributes[:'error_level'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - error_level_validator = EnumAttributeValidator.new('Object', ['ERROR', 'WARNING']) - return false unless error_level_validator.valid?(@error_level) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] error_level Object to be assigned - def error_level=(error_level) - validator = EnumAttributeValidator.new('Object', ['ERROR', 'WARNING']) - unless validator.valid?(error_level) - fail ArgumentError, "invalid value for \"error_level\", must be one of #{validator.allowable_values}." - end - @error_level = error_level - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details && - error_level == o.error_level - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details, error_level].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/error_list.rb b/vendor/services/lib/sp_services/models/error_list.rb deleted file mode 100644 index 95fceeb..0000000 --- a/vendor/services/lib/sp_services/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fixed_slot.rb b/vendor/services/lib/sp_services/models/fixed_slot.rb deleted file mode 100644 index b54877e..0000000 --- a/vendor/services/lib/sp_services/models/fixed_slot.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # In this slot format each slot only has the requested capacity types. This slot size is as specified by slot duration. - class FixedSlot - # Start date time of slot in ISO 8601 format with precision of seconds. - attr_accessor :start_date_time - - # Scheduled capacity corresponding to the slot. This capacity represents the originally allocated capacity as per resource schedule. - attr_accessor :scheduled_capacity - - # Available capacity corresponding to the slot. This capacity represents the capacity available for allocation to reservations. - attr_accessor :available_capacity - - # Encumbered capacity corresponding to the slot. This capacity represents the capacity allocated for Amazon Jobs/Appointments/Orders. - attr_accessor :encumbered_capacity - - # Reserved capacity corresponding to the slot. This capacity represents the capacity made unavailable due to events like Breaks/Leaves/Lunch. - attr_accessor :reserved_capacity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date_time' => :'startDateTime', - :'scheduled_capacity' => :'scheduledCapacity', - :'available_capacity' => :'availableCapacity', - :'encumbered_capacity' => :'encumberedCapacity', - :'reserved_capacity' => :'reservedCapacity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date_time' => :'Object', - :'scheduled_capacity' => :'Object', - :'available_capacity' => :'Object', - :'encumbered_capacity' => :'Object', - :'reserved_capacity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FixedSlot` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FixedSlot`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date_time') - self.start_date_time = attributes[:'start_date_time'] - end - - if attributes.key?(:'scheduled_capacity') - self.scheduled_capacity = attributes[:'scheduled_capacity'] - end - - if attributes.key?(:'available_capacity') - self.available_capacity = attributes[:'available_capacity'] - end - - if attributes.key?(:'encumbered_capacity') - self.encumbered_capacity = attributes[:'encumbered_capacity'] - end - - if attributes.key?(:'reserved_capacity') - self.reserved_capacity = attributes[:'reserved_capacity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date_time == o.start_date_time && - scheduled_capacity == o.scheduled_capacity && - available_capacity == o.available_capacity && - encumbered_capacity == o.encumbered_capacity && - reserved_capacity == o.reserved_capacity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date_time, scheduled_capacity, available_capacity, encumbered_capacity, reserved_capacity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fixed_slot_capacity.rb b/vendor/services/lib/sp_services/models/fixed_slot_capacity.rb deleted file mode 100644 index d8ca6e7..0000000 --- a/vendor/services/lib/sp_services/models/fixed_slot_capacity.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `getFixedSlotCapacity` operation. - class FixedSlotCapacity - # Resource Identifier. - attr_accessor :resource_id - - # The duration of each slot which is returned. This value will be a multiple of 5 and fall in the following range: 5 <= `slotDuration` <= 360. - attr_accessor :slot_duration - - # Array of capacity slots in fixed slot format. - attr_accessor :capacities - - # Next page token, if there are more pages. - attr_accessor :next_page_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_id' => :'resourceId', - :'slot_duration' => :'slotDuration', - :'capacities' => :'capacities', - :'next_page_token' => :'nextPageToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_id' => :'Object', - :'slot_duration' => :'Object', - :'capacities' => :'Object', - :'next_page_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FixedSlotCapacity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FixedSlotCapacity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - - if attributes.key?(:'slot_duration') - self.slot_duration = attributes[:'slot_duration'] - end - - if attributes.key?(:'capacities') - if (value = attributes[:'capacities']).is_a?(Array) - self.capacities = value - end - end - - if attributes.key?(:'next_page_token') - self.next_page_token = attributes[:'next_page_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_id == o.resource_id && - slot_duration == o.slot_duration && - capacities == o.capacities && - next_page_token == o.next_page_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_id, slot_duration, capacities, next_page_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fixed_slot_capacity_errors.rb b/vendor/services/lib/sp_services/models/fixed_slot_capacity_errors.rb deleted file mode 100644 index 05c0e3f..0000000 --- a/vendor/services/lib/sp_services/models/fixed_slot_capacity_errors.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The error response schema for the `getFixedSlotCapacity` operation. - class FixedSlotCapacityErrors - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FixedSlotCapacityErrors` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FixedSlotCapacityErrors`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fixed_slot_capacity_query.rb b/vendor/services/lib/sp_services/models/fixed_slot_capacity_query.rb deleted file mode 100644 index 373de8b..0000000 --- a/vendor/services/lib/sp_services/models/fixed_slot_capacity_query.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `getFixedSlotCapacity` operation. This schema is used to define the time range, capacity types and slot duration which are being queried. - class FixedSlotCapacityQuery - # An array of capacity types which are being requested. Default value is `[SCHEDULED_CAPACITY]`. - attr_accessor :capacity_types - - # Size in which slots are being requested. This value should be a multiple of 5 and fall in the range: 5 <= `slotDuration` <= 360. - attr_accessor :slot_duration - - # Start date time from which the capacity slots are being requested in ISO 8601 format. - attr_accessor :start_date_time - - # End date time up to which the capacity slots are being requested in ISO 8601 format. - attr_accessor :end_date_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'capacity_types' => :'capacityTypes', - :'slot_duration' => :'slotDuration', - :'start_date_time' => :'startDateTime', - :'end_date_time' => :'endDateTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'capacity_types' => :'Object', - :'slot_duration' => :'Object', - :'start_date_time' => :'Object', - :'end_date_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FixedSlotCapacityQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FixedSlotCapacityQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'capacity_types') - if (value = attributes[:'capacity_types']).is_a?(Array) - self.capacity_types = value - end - end - - if attributes.key?(:'slot_duration') - self.slot_duration = attributes[:'slot_duration'] - end - - if attributes.key?(:'start_date_time') - self.start_date_time = attributes[:'start_date_time'] - end - - if attributes.key?(:'end_date_time') - self.end_date_time = attributes[:'end_date_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_date_time.nil? - invalid_properties.push('invalid value for "start_date_time", start_date_time cannot be nil.') - end - - if @end_date_time.nil? - invalid_properties.push('invalid value for "end_date_time", end_date_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_date_time.nil? - return false if @end_date_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - capacity_types == o.capacity_types && - slot_duration == o.slot_duration && - start_date_time == o.start_date_time && - end_date_time == o.end_date_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [capacity_types, slot_duration, start_date_time, end_date_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fulfillment_document.rb b/vendor/services/lib/sp_services/models/fulfillment_document.rb deleted file mode 100644 index 5c1a8d7..0000000 --- a/vendor/services/lib/sp_services/models/fulfillment_document.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Document that captured during service appointment fulfillment that portrays proof of completion - class FulfillmentDocument - # The identifier of the upload destination. Get this value by calling the `createServiceDocumentUploadDestination` operation of the Services API. - attr_accessor :upload_destination_id - - # Sha256 hash of the file content. This value is used to determine if the file has been corrupted or tampered with during transit. - attr_accessor :content_sha256 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'upload_destination_id' => :'uploadDestinationId', - :'content_sha256' => :'contentSha256' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'upload_destination_id' => :'Object', - :'content_sha256' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FulfillmentDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FulfillmentDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'upload_destination_id') - self.upload_destination_id = attributes[:'upload_destination_id'] - end - - if attributes.key?(:'content_sha256') - self.content_sha256 = attributes[:'content_sha256'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - upload_destination_id == o.upload_destination_id && - content_sha256 == o.content_sha256 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [upload_destination_id, content_sha256].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fulfillment_documents.rb b/vendor/services/lib/sp_services/models/fulfillment_documents.rb deleted file mode 100644 index 1a5a3e5..0000000 --- a/vendor/services/lib/sp_services/models/fulfillment_documents.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # List of documents captured during service appointment fulfillment. - class FulfillmentDocuments - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FulfillmentDocuments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FulfillmentDocuments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/fulfillment_time.rb b/vendor/services/lib/sp_services/models/fulfillment_time.rb deleted file mode 100644 index e3e1bb3..0000000 --- a/vendor/services/lib/sp_services/models/fulfillment_time.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Input for fulfillment time details - class FulfillmentTime - # The date, time in UTC of the fulfillment start time in ISO 8601 format. - attr_accessor :start_time - - # The date, time in UTC of the fulfillment end time in ISO 8601 format. - attr_accessor :end_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'end_time' => :'endTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'end_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::FulfillmentTime` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::FulfillmentTime`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/get_appointment_slots_response.rb b/vendor/services/lib/sp_services/models/get_appointment_slots_response.rb deleted file mode 100644 index 3e6de57..0000000 --- a/vendor/services/lib/sp_services/models/get_appointment_slots_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The response of fetching appointment slots based on service context. - class GetAppointmentSlotsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::GetAppointmentSlotsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::GetAppointmentSlotsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/get_service_job_by_service_job_id_response.rb b/vendor/services/lib/sp_services/models/get_service_job_by_service_job_id_response.rb deleted file mode 100644 index 0fd13af..0000000 --- a/vendor/services/lib/sp_services/models/get_service_job_by_service_job_id_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The response schema for the `getServiceJobByServiceJobId` operation. - class GetServiceJobByServiceJobIdResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::GetServiceJobByServiceJobIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::GetServiceJobByServiceJobIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/get_service_jobs_response.rb b/vendor/services/lib/sp_services/models/get_service_jobs_response.rb deleted file mode 100644 index 7691fd1..0000000 --- a/vendor/services/lib/sp_services/models/get_service_jobs_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `getServiceJobs` operation. - class GetServiceJobsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::GetServiceJobsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::GetServiceJobsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/item_delivery.rb b/vendor/services/lib/sp_services/models/item_delivery.rb deleted file mode 100644 index c38e818..0000000 --- a/vendor/services/lib/sp_services/models/item_delivery.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Delivery information for the item. - class ItemDelivery - # The date and time of the latest Estimated Delivery Date (EDD) of all the items with an EDD. In ISO 8601 format. - attr_accessor :estimated_delivery_date - - attr_accessor :item_delivery_promise - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'estimated_delivery_date' => :'estimatedDeliveryDate', - :'item_delivery_promise' => :'itemDeliveryPromise' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'estimated_delivery_date' => :'Object', - :'item_delivery_promise' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ItemDelivery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ItemDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'estimated_delivery_date') - self.estimated_delivery_date = attributes[:'estimated_delivery_date'] - end - - if attributes.key?(:'item_delivery_promise') - self.item_delivery_promise = attributes[:'item_delivery_promise'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - estimated_delivery_date == o.estimated_delivery_date && - item_delivery_promise == o.item_delivery_promise - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [estimated_delivery_date, item_delivery_promise].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/item_delivery_promise.rb b/vendor/services/lib/sp_services/models/item_delivery_promise.rb deleted file mode 100644 index 8f22532..0000000 --- a/vendor/services/lib/sp_services/models/item_delivery_promise.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Promised delivery information for the item. - class ItemDeliveryPromise - # The date and time of the start of the promised delivery window in ISO 8601 format. - attr_accessor :start_time - - # The date and time of the end of the promised delivery window in ISO 8601 format. - attr_accessor :end_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'startTime', - :'end_time' => :'endTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'end_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ItemDeliveryPromise` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ItemDeliveryPromise`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/job_listing.rb b/vendor/services/lib/sp_services/models/job_listing.rb deleted file mode 100644 index b3289d1..0000000 --- a/vendor/services/lib/sp_services/models/job_listing.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The payload for the `getServiceJobs` operation. - class JobListing - # Total result size of the query result. - attr_accessor :total_result_size - - # A generated string used to pass information to your next request. If `nextPageToken` is returned, pass the value of `nextPageToken` to the `pageToken` to get next results. - attr_accessor :next_page_token - - # A generated string used to pass information to your next request. If `previousPageToken` is returned, pass the value of `previousPageToken` to the `pageToken` to get previous page results. - attr_accessor :previous_page_token - - # List of job details for the given input. - attr_accessor :jobs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result_size' => :'totalResultSize', - :'next_page_token' => :'nextPageToken', - :'previous_page_token' => :'previousPageToken', - :'jobs' => :'jobs' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result_size' => :'Object', - :'next_page_token' => :'Object', - :'previous_page_token' => :'Object', - :'jobs' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::JobListing` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::JobListing`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result_size') - self.total_result_size = attributes[:'total_result_size'] - end - - if attributes.key?(:'next_page_token') - self.next_page_token = attributes[:'next_page_token'] - end - - if attributes.key?(:'previous_page_token') - self.previous_page_token = attributes[:'previous_page_token'] - end - - if attributes.key?(:'jobs') - if (value = attributes[:'jobs']).is_a?(Array) - self.jobs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result_size == o.total_result_size && - next_page_token == o.next_page_token && - previous_page_token == o.previous_page_token && - jobs == o.jobs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result_size, next_page_token, previous_page_token, jobs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/order_id.rb b/vendor/services/lib/sp_services/models/order_id.rb deleted file mode 100644 index 0d613f3..0000000 --- a/vendor/services/lib/sp_services/models/order_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The Amazon-defined identifier for an order placed by the buyer, in 3-7-7 format. - class OrderId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::OrderId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::OrderId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/poa.rb b/vendor/services/lib/sp_services/models/poa.rb deleted file mode 100644 index fd27bf5..0000000 --- a/vendor/services/lib/sp_services/models/poa.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Proof of Appointment (POA) details. - class Poa - attr_accessor :appointment_time - - # A list of technicians. - attr_accessor :technicians - - # The identifier of the technician who uploaded the POA. - attr_accessor :uploading_technician - - # The date and time when the POA was uploaded in ISO 8601 format. - attr_accessor :upload_time - - # The type of POA uploaded. - attr_accessor :poa_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'appointment_time' => :'appointmentTime', - :'technicians' => :'technicians', - :'uploading_technician' => :'uploadingTechnician', - :'upload_time' => :'uploadTime', - :'poa_type' => :'poaType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'appointment_time' => :'Object', - :'technicians' => :'Object', - :'uploading_technician' => :'Object', - :'upload_time' => :'Object', - :'poa_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Poa` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Poa`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'appointment_time') - self.appointment_time = attributes[:'appointment_time'] - end - - if attributes.key?(:'technicians') - if (value = attributes[:'technicians']).is_a?(Array) - self.technicians = value - end - end - - if attributes.key?(:'uploading_technician') - self.uploading_technician = attributes[:'uploading_technician'] - end - - if attributes.key?(:'upload_time') - self.upload_time = attributes[:'upload_time'] - end - - if attributes.key?(:'poa_type') - self.poa_type = attributes[:'poa_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - poa_type_validator = EnumAttributeValidator.new('Object', ['NO_SIGNATURE_DUMMY_POS', 'CUSTOMER_SIGNATURE', 'DUMMY_RECEIPT', 'POA_RECEIPT']) - return false unless poa_type_validator.valid?(@poa_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] poa_type Object to be assigned - def poa_type=(poa_type) - validator = EnumAttributeValidator.new('Object', ['NO_SIGNATURE_DUMMY_POS', 'CUSTOMER_SIGNATURE', 'DUMMY_RECEIPT', 'POA_RECEIPT']) - unless validator.valid?(poa_type) - fail ArgumentError, "invalid value for \"poa_type\", must be one of #{validator.allowable_values}." - end - @poa_type = poa_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - appointment_time == o.appointment_time && - technicians == o.technicians && - uploading_technician == o.uploading_technician && - upload_time == o.upload_time && - poa_type == o.poa_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [appointment_time, technicians, uploading_technician, upload_time, poa_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/range_capacity.rb b/vendor/services/lib/sp_services/models/range_capacity.rb deleted file mode 100644 index 6e94800..0000000 --- a/vendor/services/lib/sp_services/models/range_capacity.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Range capacity entity where each entry has a capacity type and corresponding slots. - class RangeCapacity - attr_accessor :capacity_type - - # Array of capacity slots in range slot format. - attr_accessor :slots - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'capacity_type' => :'capacityType', - :'slots' => :'slots' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'capacity_type' => :'Object', - :'slots' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RangeCapacity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RangeCapacity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'capacity_type') - self.capacity_type = attributes[:'capacity_type'] - end - - if attributes.key?(:'slots') - if (value = attributes[:'slots']).is_a?(Array) - self.slots = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - capacity_type == o.capacity_type && - slots == o.slots - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [capacity_type, slots].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/range_slot.rb b/vendor/services/lib/sp_services/models/range_slot.rb deleted file mode 100644 index 514204d..0000000 --- a/vendor/services/lib/sp_services/models/range_slot.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Capacity slots represented in a format similar to availability rules. - class RangeSlot - # Start date time of slot in ISO 8601 format with precision of seconds. - attr_accessor :start_date_time - - # End date time of slot in ISO 8601 format with precision of seconds. - attr_accessor :end_date_time - - # Capacity of the slot. - attr_accessor :capacity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date_time' => :'startDateTime', - :'end_date_time' => :'endDateTime', - :'capacity' => :'capacity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date_time' => :'Object', - :'end_date_time' => :'Object', - :'capacity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RangeSlot` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RangeSlot`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date_time') - self.start_date_time = attributes[:'start_date_time'] - end - - if attributes.key?(:'end_date_time') - self.end_date_time = attributes[:'end_date_time'] - end - - if attributes.key?(:'capacity') - self.capacity = attributes[:'capacity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date_time == o.start_date_time && - end_date_time == o.end_date_time && - capacity == o.capacity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date_time, end_date_time, capacity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/range_slot_capacity.rb b/vendor/services/lib/sp_services/models/range_slot_capacity.rb deleted file mode 100644 index e1dcd12..0000000 --- a/vendor/services/lib/sp_services/models/range_slot_capacity.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `getRangeSlotCapacity` operation. - class RangeSlotCapacity - # Resource Identifier. - attr_accessor :resource_id - - # Array of range capacities where each entry is for a specific capacity type. - attr_accessor :capacities - - # Next page token, if there are more pages. - attr_accessor :next_page_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_id' => :'resourceId', - :'capacities' => :'capacities', - :'next_page_token' => :'nextPageToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_id' => :'Object', - :'capacities' => :'Object', - :'next_page_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RangeSlotCapacity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RangeSlotCapacity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - - if attributes.key?(:'capacities') - if (value = attributes[:'capacities']).is_a?(Array) - self.capacities = value - end - end - - if attributes.key?(:'next_page_token') - self.next_page_token = attributes[:'next_page_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_id == o.resource_id && - capacities == o.capacities && - next_page_token == o.next_page_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_id, capacities, next_page_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/range_slot_capacity_errors.rb b/vendor/services/lib/sp_services/models/range_slot_capacity_errors.rb deleted file mode 100644 index 610921b..0000000 --- a/vendor/services/lib/sp_services/models/range_slot_capacity_errors.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The error response schema for the `getRangeSlotCapacity` operation. - class RangeSlotCapacityErrors - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RangeSlotCapacityErrors` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RangeSlotCapacityErrors`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/range_slot_capacity_query.rb b/vendor/services/lib/sp_services/models/range_slot_capacity_query.rb deleted file mode 100644 index 144882b..0000000 --- a/vendor/services/lib/sp_services/models/range_slot_capacity_query.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `getRangeSlotCapacity` operation. This schema is used to define the time range and capacity types that are being queried. - class RangeSlotCapacityQuery - # An array of capacity types which are being requested. Default value is `[SCHEDULED_CAPACITY]`. - attr_accessor :capacity_types - - # Start date time from which the capacity slots are being requested in ISO 8601 format. - attr_accessor :start_date_time - - # End date time up to which the capacity slots are being requested in ISO 8601 format. - attr_accessor :end_date_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'capacity_types' => :'capacityTypes', - :'start_date_time' => :'startDateTime', - :'end_date_time' => :'endDateTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'capacity_types' => :'Object', - :'start_date_time' => :'Object', - :'end_date_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RangeSlotCapacityQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RangeSlotCapacityQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'capacity_types') - if (value = attributes[:'capacity_types']).is_a?(Array) - self.capacity_types = value - end - end - - if attributes.key?(:'start_date_time') - self.start_date_time = attributes[:'start_date_time'] - end - - if attributes.key?(:'end_date_time') - self.end_date_time = attributes[:'end_date_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_date_time.nil? - invalid_properties.push('invalid value for "start_date_time", start_date_time cannot be nil.') - end - - if @end_date_time.nil? - invalid_properties.push('invalid value for "end_date_time", end_date_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_date_time.nil? - return false if @end_date_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - capacity_types == o.capacity_types && - start_date_time == o.start_date_time && - end_date_time == o.end_date_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [capacity_types, start_date_time, end_date_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/recurrence.rb b/vendor/services/lib/sp_services/models/recurrence.rb deleted file mode 100644 index e0a10a0..0000000 --- a/vendor/services/lib/sp_services/models/recurrence.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Repeated occurrence of an event in a time range. - class Recurrence - # End time of the recurrence. - attr_accessor :end_time - - # Days of the week when recurrence is valid. If the schedule is valid every Monday, input will only contain `MONDAY` in the list. - attr_accessor :days_of_week - - # Days of the month when recurrence is valid. - attr_accessor :days_of_month - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'end_time' => :'endTime', - :'days_of_week' => :'daysOfWeek', - :'days_of_month' => :'daysOfMonth' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'end_time' => :'Object', - :'days_of_week' => :'Object', - :'days_of_month' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Recurrence` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Recurrence`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'days_of_week') - if (value = attributes[:'days_of_week']).is_a?(Array) - self.days_of_week = value - end - end - - if attributes.key?(:'days_of_month') - if (value = attributes[:'days_of_month']).is_a?(Array) - self.days_of_month = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @end_time.nil? - invalid_properties.push('invalid value for "end_time", end_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @end_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - end_time == o.end_time && - days_of_week == o.days_of_week && - days_of_month == o.days_of_month - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [end_time, days_of_week, days_of_month].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/reschedule_appointment_request.rb b/vendor/services/lib/sp_services/models/reschedule_appointment_request.rb deleted file mode 100644 index a05aec3..0000000 --- a/vendor/services/lib/sp_services/models/reschedule_appointment_request.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Input for rescheduled appointment operation. - class RescheduleAppointmentRequest - attr_accessor :appointment_time - - attr_accessor :reschedule_reason_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'appointment_time' => :'appointmentTime', - :'reschedule_reason_code' => :'rescheduleReasonCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'appointment_time' => :'Object', - :'reschedule_reason_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RescheduleAppointmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RescheduleAppointmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'appointment_time') - self.appointment_time = attributes[:'appointment_time'] - end - - if attributes.key?(:'reschedule_reason_code') - self.reschedule_reason_code = attributes[:'reschedule_reason_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @appointment_time.nil? - invalid_properties.push('invalid value for "appointment_time", appointment_time cannot be nil.') - end - - if @reschedule_reason_code.nil? - invalid_properties.push('invalid value for "reschedule_reason_code", reschedule_reason_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @appointment_time.nil? - return false if @reschedule_reason_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - appointment_time == o.appointment_time && - reschedule_reason_code == o.reschedule_reason_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [appointment_time, reschedule_reason_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/reschedule_reason_code.rb b/vendor/services/lib/sp_services/models/reschedule_reason_code.rb deleted file mode 100644 index 0174874..0000000 --- a/vendor/services/lib/sp_services/models/reschedule_reason_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The appointment reschedule reason code. - class RescheduleReasonCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::RescheduleReasonCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::RescheduleReasonCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/reservation.rb b/vendor/services/lib/sp_services/models/reservation.rb deleted file mode 100644 index 9242e00..0000000 --- a/vendor/services/lib/sp_services/models/reservation.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Reservation object reduces the capacity of a resource. - class Reservation - # Unique identifier for a reservation. If present, it is treated as an update reservation request and will update the corresponding reservation. Otherwise, it is treated as a new create reservation request. - attr_accessor :reservation_id - - # Type of reservation. - attr_accessor :type - - attr_accessor :availability - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reservation_id' => :'reservationId', - :'type' => :'type', - :'availability' => :'availability' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reservation_id' => :'Object', - :'type' => :'Object', - :'availability' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Reservation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Reservation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reservation_id') - self.reservation_id = attributes[:'reservation_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'availability') - self.availability = attributes[:'availability'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @availability.nil? - invalid_properties.push('invalid value for "availability", availability cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['APPOINTMENT', 'TRAVEL', 'VACATION', 'BREAK', 'TRAINING']) - return false unless type_validator.valid?(@type) - return false if @availability.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['APPOINTMENT', 'TRAVEL', 'VACATION', 'BREAK', 'TRAINING']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reservation_id == o.reservation_id && - type == o.type && - availability == o.availability - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reservation_id, type, availability].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/scope_of_work.rb b/vendor/services/lib/sp_services/models/scope_of_work.rb deleted file mode 100644 index 964c62c..0000000 --- a/vendor/services/lib/sp_services/models/scope_of_work.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The scope of work for the order. - class ScopeOfWork - # The Amazon Standard Identification Number (ASIN) of the service job. - attr_accessor :asin - - # The title of the service job. - attr_accessor :title - - # The number of service jobs. - attr_accessor :quantity - - # A list of skills required to perform the job. - attr_accessor :required_skills - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'asin', - :'title' => :'title', - :'quantity' => :'quantity', - :'required_skills' => :'requiredSkills' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'title' => :'Object', - :'quantity' => :'Object', - :'required_skills' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ScopeOfWork` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ScopeOfWork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'required_skills') - if (value = attributes[:'required_skills']).is_a?(Array) - self.required_skills = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - title == o.title && - quantity == o.quantity && - required_skills == o.required_skills - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, title, quantity, required_skills].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/seller.rb b/vendor/services/lib/sp_services/models/seller.rb deleted file mode 100644 index 138541d..0000000 --- a/vendor/services/lib/sp_services/models/seller.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about the seller of the service job. - class Seller - # The identifier of the seller of the service job. - attr_accessor :seller_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_id' => :'sellerId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Seller` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Seller`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_id') - self.seller_id = attributes[:'seller_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_id == o.seller_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_document_upload_destination.rb b/vendor/services/lib/sp_services/models/service_document_upload_destination.rb deleted file mode 100644 index 4f24593..0000000 --- a/vendor/services/lib/sp_services/models/service_document_upload_destination.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about an upload destination. - class ServiceDocumentUploadDestination - # The unique identifier to be used by APIs that reference the upload destination. - attr_accessor :upload_destination_id - - # The URL to which to upload the file. - attr_accessor :url - - attr_accessor :encryption_details - - # The headers to include in the upload request. - attr_accessor :headers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'upload_destination_id' => :'uploadDestinationId', - :'url' => :'url', - :'encryption_details' => :'encryptionDetails', - :'headers' => :'headers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'upload_destination_id' => :'Object', - :'url' => :'Object', - :'encryption_details' => :'Object', - :'headers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceDocumentUploadDestination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceDocumentUploadDestination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'upload_destination_id') - self.upload_destination_id = attributes[:'upload_destination_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'encryption_details') - self.encryption_details = attributes[:'encryption_details'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @upload_destination_id.nil? - invalid_properties.push('invalid value for "upload_destination_id", upload_destination_id cannot be nil.') - end - - if @url.nil? - invalid_properties.push('invalid value for "url", url cannot be nil.') - end - - if @encryption_details.nil? - invalid_properties.push('invalid value for "encryption_details", encryption_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @upload_destination_id.nil? - return false if @url.nil? - return false if @encryption_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - upload_destination_id == o.upload_destination_id && - url == o.url && - encryption_details == o.encryption_details && - headers == o.headers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [upload_destination_id, url, encryption_details, headers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_job.rb b/vendor/services/lib/sp_services/models/service_job.rb deleted file mode 100644 index 645032e..0000000 --- a/vendor/services/lib/sp_services/models/service_job.rb +++ /dev/null @@ -1,375 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # The job details of a service. - class ServiceJob - # The date and time of the creation of the job in ISO 8601 format. - attr_accessor :create_time - - attr_accessor :service_job_id - - # The status of the service job. - attr_accessor :service_job_status - - attr_accessor :scope_of_work - - attr_accessor :seller - - attr_accessor :service_job_provider - - # A list of appointment windows preferred by the buyer. Included only if the buyer selected appointment windows when creating the order. - attr_accessor :preferred_appointment_times - - # A list of appointments. - attr_accessor :appointments - - attr_accessor :service_order_id - - # The marketplace identifier. - attr_accessor :marketplace_id - - # The Amazon-defined identifier for the region scope. - attr_accessor :store_id - - attr_accessor :buyer - - # A list of items associated with the service job. - attr_accessor :associated_items - - attr_accessor :service_location - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'create_time' => :'createTime', - :'service_job_id' => :'serviceJobId', - :'service_job_status' => :'serviceJobStatus', - :'scope_of_work' => :'scopeOfWork', - :'seller' => :'seller', - :'service_job_provider' => :'serviceJobProvider', - :'preferred_appointment_times' => :'preferredAppointmentTimes', - :'appointments' => :'appointments', - :'service_order_id' => :'serviceOrderId', - :'marketplace_id' => :'marketplaceId', - :'store_id' => :'storeId', - :'buyer' => :'buyer', - :'associated_items' => :'associatedItems', - :'service_location' => :'serviceLocation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'create_time' => :'Object', - :'service_job_id' => :'Object', - :'service_job_status' => :'Object', - :'scope_of_work' => :'Object', - :'seller' => :'Object', - :'service_job_provider' => :'Object', - :'preferred_appointment_times' => :'Object', - :'appointments' => :'Object', - :'service_order_id' => :'Object', - :'marketplace_id' => :'Object', - :'store_id' => :'Object', - :'buyer' => :'Object', - :'associated_items' => :'Object', - :'service_location' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceJob` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceJob`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'create_time') - self.create_time = attributes[:'create_time'] - end - - if attributes.key?(:'service_job_id') - self.service_job_id = attributes[:'service_job_id'] - end - - if attributes.key?(:'service_job_status') - self.service_job_status = attributes[:'service_job_status'] - end - - if attributes.key?(:'scope_of_work') - self.scope_of_work = attributes[:'scope_of_work'] - end - - if attributes.key?(:'seller') - self.seller = attributes[:'seller'] - end - - if attributes.key?(:'service_job_provider') - self.service_job_provider = attributes[:'service_job_provider'] - end - - if attributes.key?(:'preferred_appointment_times') - if (value = attributes[:'preferred_appointment_times']).is_a?(Array) - self.preferred_appointment_times = value - end - end - - if attributes.key?(:'appointments') - if (value = attributes[:'appointments']).is_a?(Array) - self.appointments = value - end - end - - if attributes.key?(:'service_order_id') - self.service_order_id = attributes[:'service_order_id'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'store_id') - self.store_id = attributes[:'store_id'] - end - - if attributes.key?(:'buyer') - self.buyer = attributes[:'buyer'] - end - - if attributes.key?(:'associated_items') - if (value = attributes[:'associated_items']).is_a?(Array) - self.associated_items = value - end - end - - if attributes.key?(:'service_location') - self.service_location = attributes[:'service_location'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - service_job_status_validator = EnumAttributeValidator.new('Object', ['NOT_SERVICED', 'CANCELLED', 'COMPLETED', 'PENDING_SCHEDULE', 'NOT_FULFILLABLE', 'HOLD', 'PAYMENT_DECLINED']) - return false unless service_job_status_validator.valid?(@service_job_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] service_job_status Object to be assigned - def service_job_status=(service_job_status) - validator = EnumAttributeValidator.new('Object', ['NOT_SERVICED', 'CANCELLED', 'COMPLETED', 'PENDING_SCHEDULE', 'NOT_FULFILLABLE', 'HOLD', 'PAYMENT_DECLINED']) - unless validator.valid?(service_job_status) - fail ArgumentError, "invalid value for \"service_job_status\", must be one of #{validator.allowable_values}." - end - @service_job_status = service_job_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - create_time == o.create_time && - service_job_id == o.service_job_id && - service_job_status == o.service_job_status && - scope_of_work == o.scope_of_work && - seller == o.seller && - service_job_provider == o.service_job_provider && - preferred_appointment_times == o.preferred_appointment_times && - appointments == o.appointments && - service_order_id == o.service_order_id && - marketplace_id == o.marketplace_id && - store_id == o.store_id && - buyer == o.buyer && - associated_items == o.associated_items && - service_location == o.service_location - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [create_time, service_job_id, service_job_status, scope_of_work, seller, service_job_provider, preferred_appointment_times, appointments, service_order_id, marketplace_id, store_id, buyer, associated_items, service_location].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_job_id.rb b/vendor/services/lib/sp_services/models/service_job_id.rb deleted file mode 100644 index d047f14..0000000 --- a/vendor/services/lib/sp_services/models/service_job_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Amazon identifier for the service job. - class ServiceJobId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceJobId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceJobId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_job_provider.rb b/vendor/services/lib/sp_services/models/service_job_provider.rb deleted file mode 100644 index 82df45a..0000000 --- a/vendor/services/lib/sp_services/models/service_job_provider.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about the service job provider. - class ServiceJobProvider - # The identifier of the service job provider. - attr_accessor :service_job_provider_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service_job_provider_id' => :'serviceJobProviderId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'service_job_provider_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceJobProvider` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceJobProvider`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service_job_provider_id') - self.service_job_provider_id = attributes[:'service_job_provider_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service_job_provider_id == o.service_job_provider_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service_job_provider_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_location.rb b/vendor/services/lib/sp_services/models/service_location.rb deleted file mode 100644 index a101998..0000000 --- a/vendor/services/lib/sp_services/models/service_location.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Information about the location of the service job. - class ServiceLocation - # The location of the service job. - attr_accessor :service_location_type - - attr_accessor :address - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service_location_type' => :'serviceLocationType', - :'address' => :'address' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'service_location_type' => :'Object', - :'address' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceLocation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceLocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service_location_type') - self.service_location_type = attributes[:'service_location_type'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - service_location_type_validator = EnumAttributeValidator.new('Object', ['IN_HOME', 'IN_STORE', 'ONLINE']) - return false unless service_location_type_validator.valid?(@service_location_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] service_location_type Object to be assigned - def service_location_type=(service_location_type) - validator = EnumAttributeValidator.new('Object', ['IN_HOME', 'IN_STORE', 'ONLINE']) - unless validator.valid?(service_location_type) - fail ArgumentError, "invalid value for \"service_location_type\", must be one of #{validator.allowable_values}." - end - @service_location_type = service_location_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service_location_type == o.service_location_type && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service_location_type, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/service_upload_document.rb b/vendor/services/lib/sp_services/models/service_upload_document.rb deleted file mode 100644 index e356e82..0000000 --- a/vendor/services/lib/sp_services/models/service_upload_document.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Input for to be uploaded document. - class ServiceUploadDocument - # The content type of the to-be-uploaded file - attr_accessor :content_type - - # The content length of the to-be-uploaded file - attr_accessor :content_length - - # An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. - attr_accessor :content_md5 - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'content_type' => :'contentType', - :'content_length' => :'contentLength', - :'content_md5' => :'contentMD5' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'content_type' => :'Object', - :'content_length' => :'Object', - :'content_md5' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::ServiceUploadDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::ServiceUploadDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'content_type') - self.content_type = attributes[:'content_type'] - end - - if attributes.key?(:'content_length') - self.content_length = attributes[:'content_length'] - end - - if attributes.key?(:'content_md5') - self.content_md5 = attributes[:'content_md5'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @content_type.nil? - invalid_properties.push('invalid value for "content_type", content_type cannot be nil.') - end - - if @content_length.nil? - invalid_properties.push('invalid value for "content_length", content_length cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @content_type.nil? - content_type_validator = EnumAttributeValidator.new('Object', ['TIFF', 'JPG', 'PNG', 'JPEG', 'GIF', 'PDF']) - return false unless content_type_validator.valid?(@content_type) - return false if @content_length.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] content_type Object to be assigned - def content_type=(content_type) - validator = EnumAttributeValidator.new('Object', ['TIFF', 'JPG', 'PNG', 'JPEG', 'GIF', 'PDF']) - unless validator.valid?(content_type) - fail ArgumentError, "invalid value for \"content_type\", must be one of #{validator.allowable_values}." - end - @content_type = content_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - content_type == o.content_type && - content_length == o.content_length && - content_md5 == o.content_md5 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [content_type, content_length, content_md5].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/set_appointment_fulfillment_data_request.rb b/vendor/services/lib/sp_services/models/set_appointment_fulfillment_data_request.rb deleted file mode 100644 index 8905a81..0000000 --- a/vendor/services/lib/sp_services/models/set_appointment_fulfillment_data_request.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Input for set appointment fulfillment data operation. - class SetAppointmentFulfillmentDataRequest - attr_accessor :fulfillment_time - - attr_accessor :appointment_resources - - attr_accessor :fulfillment_documents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_time' => :'fulfillmentTime', - :'appointment_resources' => :'appointmentResources', - :'fulfillment_documents' => :'fulfillmentDocuments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_time' => :'Object', - :'appointment_resources' => :'Object', - :'fulfillment_documents' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::SetAppointmentFulfillmentDataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::SetAppointmentFulfillmentDataRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_time') - self.fulfillment_time = attributes[:'fulfillment_time'] - end - - if attributes.key?(:'appointment_resources') - self.appointment_resources = attributes[:'appointment_resources'] - end - - if attributes.key?(:'fulfillment_documents') - self.fulfillment_documents = attributes[:'fulfillment_documents'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_time == o.fulfillment_time && - appointment_resources == o.appointment_resources && - fulfillment_documents == o.fulfillment_documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_time, appointment_resources, fulfillment_documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/set_appointment_response.rb b/vendor/services/lib/sp_services/models/set_appointment_response.rb deleted file mode 100644 index 5d99f6b..0000000 --- a/vendor/services/lib/sp_services/models/set_appointment_response.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `addAppointmentForServiceJobByServiceJobId` and `rescheduleAppointmentForServiceJobByServiceJobId` operations. - class SetAppointmentResponse - attr_accessor :appointment_id - - attr_accessor :warnings - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'appointment_id' => :'appointmentId', - :'warnings' => :'warnings', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'appointment_id' => :'Object', - :'warnings' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::SetAppointmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::SetAppointmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'appointment_id') - self.appointment_id = attributes[:'appointment_id'] - end - - if attributes.key?(:'warnings') - self.warnings = attributes[:'warnings'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - appointment_id == o.appointment_id && - warnings == o.warnings && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [appointment_id, warnings, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/technician.rb b/vendor/services/lib/sp_services/models/technician.rb deleted file mode 100644 index 9ea82c9..0000000 --- a/vendor/services/lib/sp_services/models/technician.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # A technician who is assigned to perform the service job in part or in full. - class Technician - # The technician identifier. - attr_accessor :technician_id - - # The name of the technician. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'technician_id' => :'technicianId', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'technician_id' => :'Object', - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Technician` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Technician`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'technician_id') - self.technician_id = attributes[:'technician_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - technician_id == o.technician_id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [technician_id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_reservation_record.rb b/vendor/services/lib/sp_services/models/update_reservation_record.rb deleted file mode 100644 index b34b022..0000000 --- a/vendor/services/lib/sp_services/models/update_reservation_record.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # `UpdateReservationRecord` entity contains the `Reservation` if there is an error/warning while performing the requested operation on it, otherwise it will contain the new `reservationId`. - class UpdateReservationRecord - attr_accessor :reservation - - attr_accessor :warnings - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reservation' => :'reservation', - :'warnings' => :'warnings', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reservation' => :'Object', - :'warnings' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateReservationRecord` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateReservationRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reservation') - self.reservation = attributes[:'reservation'] - end - - if attributes.key?(:'warnings') - self.warnings = attributes[:'warnings'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reservation == o.reservation && - warnings == o.warnings && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reservation, warnings, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_reservation_request.rb b/vendor/services/lib/sp_services/models/update_reservation_request.rb deleted file mode 100644 index ed4df41..0000000 --- a/vendor/services/lib/sp_services/models/update_reservation_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `updateReservation` operation. - class UpdateReservationRequest - # Resource (store) identifier. - attr_accessor :resource_id - - attr_accessor :reservation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_id' => :'resourceId', - :'reservation' => :'reservation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_id' => :'Object', - :'reservation' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateReservationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateReservationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - - if attributes.key?(:'reservation') - self.reservation = attributes[:'reservation'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @resource_id.nil? - invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.') - end - - if @reservation.nil? - invalid_properties.push('invalid value for "reservation", reservation cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @resource_id.nil? - return false if @reservation.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_id == o.resource_id && - reservation == o.reservation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_id, reservation].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_reservation_response.rb b/vendor/services/lib/sp_services/models/update_reservation_response.rb deleted file mode 100644 index 038f5b8..0000000 --- a/vendor/services/lib/sp_services/models/update_reservation_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `updateReservation` operation. - class UpdateReservationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateReservationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateReservationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_schedule_record.rb b/vendor/services/lib/sp_services/models/update_schedule_record.rb deleted file mode 100644 index 745972d..0000000 --- a/vendor/services/lib/sp_services/models/update_schedule_record.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # `UpdateScheduleRecord` entity contains the `AvailabilityRecord` if there is an error/warning while performing the requested operation on it. - class UpdateScheduleRecord - attr_accessor :availability - - attr_accessor :warnings - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'availability' => :'availability', - :'warnings' => :'warnings', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'availability' => :'Object', - :'warnings' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateScheduleRecord` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateScheduleRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'availability') - self.availability = attributes[:'availability'] - end - - if attributes.key?(:'warnings') - self.warnings = attributes[:'warnings'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - availability == o.availability && - warnings == o.warnings && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [availability, warnings, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_schedule_request.rb b/vendor/services/lib/sp_services/models/update_schedule_request.rb deleted file mode 100644 index 2f7d2dc..0000000 --- a/vendor/services/lib/sp_services/models/update_schedule_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Request schema for the `updateSchedule` operation. - class UpdateScheduleRequest - attr_accessor :schedules - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'schedules' => :'schedules' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'schedules' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateScheduleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateScheduleRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'schedules') - self.schedules = attributes[:'schedules'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @schedules.nil? - invalid_properties.push('invalid value for "schedules", schedules cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @schedules.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - schedules == o.schedules - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [schedules].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/update_schedule_response.rb b/vendor/services/lib/sp_services/models/update_schedule_response.rb deleted file mode 100644 index 631719a..0000000 --- a/vendor/services/lib/sp_services/models/update_schedule_response.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Response schema for the `updateSchedule` operation. - class UpdateScheduleResponse - # Contains the `UpdateScheduleRecords` for which the error/warning has occurred. - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::UpdateScheduleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::UpdateScheduleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - if (value = attributes[:'payload']).is_a?(Array) - self.payload = value - end - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/warning.rb b/vendor/services/lib/sp_services/models/warning.rb deleted file mode 100644 index f9e7d08..0000000 --- a/vendor/services/lib/sp_services/models/warning.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # Warning returned when the request is successful, but there are important callouts based on which API clients should take defined actions. - class Warning - # An warning code that identifies the type of warning that occurred. - attr_accessor :code - - # A message that describes the warning condition in a human-readable form. - attr_accessor :message - - # Additional details that can help the caller understand or address the warning. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::Warning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::Warning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/models/warning_list.rb b/vendor/services/lib/sp_services/models/warning_list.rb deleted file mode 100644 index e8623a5..0000000 --- a/vendor/services/lib/sp_services/models/warning_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpServices - # A list of warnings returned in the sucessful execution response of an API request. - class WarningList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpServices::WarningList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpServices::WarningList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpServices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/services/lib/sp_services/version.rb b/vendor/services/lib/sp_services/version.rb deleted file mode 100644 index ef322d4..0000000 --- a/vendor/services/lib/sp_services/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpServices - VERSION = '1.0.0' -end diff --git a/vendor/services/sp_services.gemspec b/vendor/services/sp_services.gemspec deleted file mode 100644 index 7f1af22..0000000 --- a/vendor/services/sp_services.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Services - -#With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_services/version" - -Gem::Specification.new do |s| - s.name = "sp_services" - s.version = SpServices::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Services Ruby Gem" - s.description = "With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/shipping/.gitignore b/vendor/shipping/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/shipping/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/shipping/.rspec b/vendor/shipping/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/shipping/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/shipping/.rubocop.yml b/vendor/shipping/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/shipping/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/shipping/.swagger-codegen-ignore b/vendor/shipping/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/shipping/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/shipping/.swagger-codegen/VERSION b/vendor/shipping/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/shipping/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/shipping/Gemfile b/vendor/shipping/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/shipping/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/shipping/README.md b/vendor/shipping/README.md deleted file mode 100644 index 70fa400..0000000 --- a/vendor/shipping/README.md +++ /dev/null @@ -1,245 +0,0 @@ -# sp_shipping - -SpShipping - the Ruby gem for the Selling Partner API for Shipping - -Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_shipping.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_shipping-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_shipping-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_shipping', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_shipping', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_shipping' - -api_instance = SpShipping::ShippingApi.new -shipment_id = 'shipment_id_example' # String | Shipment Id to cancel a shipment - - -begin - result = api_instance.cancel_shipment(shipment_id) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->cancel_shipment: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -body = SpShipping::CreateShipmentRequest.new # CreateShipmentRequest | CreateShipmentRequest Body - - -begin - result = api_instance.create_shipment(body) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->create_shipment: #{e}" -end - -api_instance = SpShipping::ShippingApi.new - -begin - result = api_instance.get_account - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->get_account: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -body = SpShipping::GetRatesRequest.new # GetRatesRequest | GetRatesRequest body - - -begin - result = api_instance.get_rates(body) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->get_rates: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -shipment_id = 'shipment_id_example' # String | Shipment id to return the entire shipment object - - -begin - result = api_instance.get_shipment(shipment_id) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->get_shipment: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -tracking_id = 'tracking_id_example' # String | Tracking Id - - -begin - result = api_instance.get_tracking_information(tracking_id) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->get_tracking_information: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -body = SpShipping::PurchaseLabelsRequest.new # PurchaseLabelsRequest | PurchaseShippingLabelRequest body -shipment_id = 'shipment_id_example' # String | Shipment id for purchase shipping label - - -begin - result = api_instance.purchase_labels(body, shipment_id) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->purchase_labels: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -body = SpShipping::PurchaseShipmentRequest.new # PurchaseShipmentRequest | PurchaseShipmentRequest body - - -begin - result = api_instance.purchase_shipment(body) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->purchase_shipment: #{e}" -end - -api_instance = SpShipping::ShippingApi.new -body = SpShipping::RetrieveShippingLabelRequest.new # RetrieveShippingLabelRequest | RetrieveShippingLabelRequest body -shipment_id = 'shipment_id_example' # String | Shipment Id to retreive label -tracking_id = 'tracking_id_example' # String | Tracking Id - - -begin - result = api_instance.retrieve_shipping_label(body, shipment_id, tracking_id) - p result -rescue SpShipping::ApiError => e - puts "Exception when calling ShippingApi->retrieve_shipping_label: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpShipping::ShippingApi* | [**cancel_shipment**](docs/ShippingApi.md#cancel_shipment) | **POST** /shipping/v1/shipments/{shipmentId}/cancel | -*SpShipping::ShippingApi* | [**create_shipment**](docs/ShippingApi.md#create_shipment) | **POST** /shipping/v1/shipments | -*SpShipping::ShippingApi* | [**get_account**](docs/ShippingApi.md#get_account) | **GET** /shipping/v1/account | -*SpShipping::ShippingApi* | [**get_rates**](docs/ShippingApi.md#get_rates) | **POST** /shipping/v1/rates | -*SpShipping::ShippingApi* | [**get_shipment**](docs/ShippingApi.md#get_shipment) | **GET** /shipping/v1/shipments/{shipmentId} | -*SpShipping::ShippingApi* | [**get_tracking_information**](docs/ShippingApi.md#get_tracking_information) | **GET** /shipping/v1/tracking/{trackingId} | -*SpShipping::ShippingApi* | [**purchase_labels**](docs/ShippingApi.md#purchase_labels) | **POST** /shipping/v1/shipments/{shipmentId}/purchaseLabels | -*SpShipping::ShippingApi* | [**purchase_shipment**](docs/ShippingApi.md#purchase_shipment) | **POST** /shipping/v1/purchaseShipment | -*SpShipping::ShippingApi* | [**retrieve_shipping_label**](docs/ShippingApi.md#retrieve_shipping_label) | **POST** /shipping/v1/shipments/{shipmentId}/containers/{trackingId}/label | - -## Documentation for Models - - - [SpShipping::AcceptedRate](docs/AcceptedRate.md) - - [SpShipping::Account](docs/Account.md) - - [SpShipping::AccountId](docs/AccountId.md) - - [SpShipping::Address](docs/Address.md) - - [SpShipping::CancelShipmentResponse](docs/CancelShipmentResponse.md) - - [SpShipping::City](docs/City.md) - - [SpShipping::ClientReferenceId](docs/ClientReferenceId.md) - - [SpShipping::Container](docs/Container.md) - - [SpShipping::ContainerItem](docs/ContainerItem.md) - - [SpShipping::ContainerList](docs/ContainerList.md) - - [SpShipping::ContainerReferenceId](docs/ContainerReferenceId.md) - - [SpShipping::ContainerSpecification](docs/ContainerSpecification.md) - - [SpShipping::ContainerSpecificationList](docs/ContainerSpecificationList.md) - - [SpShipping::CountryCode](docs/CountryCode.md) - - [SpShipping::CreateShipmentRequest](docs/CreateShipmentRequest.md) - - [SpShipping::CreateShipmentResponse](docs/CreateShipmentResponse.md) - - [SpShipping::CreateShipmentResult](docs/CreateShipmentResult.md) - - [SpShipping::Currency](docs/Currency.md) - - [SpShipping::Dimensions](docs/Dimensions.md) - - [SpShipping::Error](docs/Error.md) - - [SpShipping::ErrorList](docs/ErrorList.md) - - [SpShipping::Event](docs/Event.md) - - [SpShipping::EventCode](docs/EventCode.md) - - [SpShipping::EventList](docs/EventList.md) - - [SpShipping::GetAccountResponse](docs/GetAccountResponse.md) - - [SpShipping::GetRatesRequest](docs/GetRatesRequest.md) - - [SpShipping::GetRatesResponse](docs/GetRatesResponse.md) - - [SpShipping::GetRatesResult](docs/GetRatesResult.md) - - [SpShipping::GetShipmentResponse](docs/GetShipmentResponse.md) - - [SpShipping::GetTrackingInformationResponse](docs/GetTrackingInformationResponse.md) - - [SpShipping::Label](docs/Label.md) - - [SpShipping::LabelResult](docs/LabelResult.md) - - [SpShipping::LabelResultList](docs/LabelResultList.md) - - [SpShipping::LabelSpecification](docs/LabelSpecification.md) - - [SpShipping::LabelStream](docs/LabelStream.md) - - [SpShipping::Location](docs/Location.md) - - [SpShipping::Party](docs/Party.md) - - [SpShipping::PostalCode](docs/PostalCode.md) - - [SpShipping::PromisedDeliveryDate](docs/PromisedDeliveryDate.md) - - [SpShipping::PurchaseLabelsRequest](docs/PurchaseLabelsRequest.md) - - [SpShipping::PurchaseLabelsResponse](docs/PurchaseLabelsResponse.md) - - [SpShipping::PurchaseLabelsResult](docs/PurchaseLabelsResult.md) - - [SpShipping::PurchaseShipmentRequest](docs/PurchaseShipmentRequest.md) - - [SpShipping::PurchaseShipmentResponse](docs/PurchaseShipmentResponse.md) - - [SpShipping::PurchaseShipmentResult](docs/PurchaseShipmentResult.md) - - [SpShipping::Rate](docs/Rate.md) - - [SpShipping::RateId](docs/RateId.md) - - [SpShipping::RateList](docs/RateList.md) - - [SpShipping::RetrieveShippingLabelRequest](docs/RetrieveShippingLabelRequest.md) - - [SpShipping::RetrieveShippingLabelResponse](docs/RetrieveShippingLabelResponse.md) - - [SpShipping::RetrieveShippingLabelResult](docs/RetrieveShippingLabelResult.md) - - [SpShipping::ServiceRate](docs/ServiceRate.md) - - [SpShipping::ServiceRateList](docs/ServiceRateList.md) - - [SpShipping::ServiceType](docs/ServiceType.md) - - [SpShipping::ServiceTypeList](docs/ServiceTypeList.md) - - [SpShipping::Shipment](docs/Shipment.md) - - [SpShipping::ShipmentId](docs/ShipmentId.md) - - [SpShipping::ShippingPromiseSet](docs/ShippingPromiseSet.md) - - [SpShipping::StateOrRegion](docs/StateOrRegion.md) - - [SpShipping::TimeRange](docs/TimeRange.md) - - [SpShipping::TrackingId](docs/TrackingId.md) - - [SpShipping::TrackingInformation](docs/TrackingInformation.md) - - [SpShipping::TrackingSummary](docs/TrackingSummary.md) - - [SpShipping::Weight](docs/Weight.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/shipping/Rakefile b/vendor/shipping/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/shipping/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/shipping/git_push.sh b/vendor/shipping/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/shipping/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/shipping/lib/sp_shipping.rb b/vendor/shipping/lib/sp_shipping.rb deleted file mode 100644 index f96cc53..0000000 --- a/vendor/shipping/lib/sp_shipping.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_shipping/api_client' -# require 'sp_shipping/api_error' -# require 'sp_shipping/version' -# require 'sp_shipping/configuration' - -# Models -# -# -# require_relative './sp_shipping/models/accepted_rate' -# -# -# require_relative './sp_shipping/models/account' -# -# -# require_relative './sp_shipping/models/account_id' -# -# -# require_relative './sp_shipping/models/address' -# -# -# require_relative './sp_shipping/models/cancel_shipment_response' -# -# -# require_relative './sp_shipping/models/city' -# -# -# require_relative './sp_shipping/models/client_reference_id' -# -# -# require_relative './sp_shipping/models/container' -# -# -# require_relative './sp_shipping/models/container_item' -# -# -# require_relative './sp_shipping/models/container_list' -# -# -# require_relative './sp_shipping/models/container_reference_id' -# -# -# require_relative './sp_shipping/models/container_specification' -# -# -# require_relative './sp_shipping/models/container_specification_list' -# -# -# require_relative './sp_shipping/models/country_code' -# -# -# require_relative './sp_shipping/models/create_shipment_request' -# -# -# require_relative './sp_shipping/models/create_shipment_response' -# -# -# require_relative './sp_shipping/models/create_shipment_result' -# -# -# require_relative './sp_shipping/models/currency' -# -# -# require_relative './sp_shipping/models/dimensions' -# -# -# require_relative './sp_shipping/models/error' -# -# -# require_relative './sp_shipping/models/error_list' -# -# -# require_relative './sp_shipping/models/event' -# -# -# require_relative './sp_shipping/models/event_code' -# -# -# require_relative './sp_shipping/models/event_list' -# -# -# require_relative './sp_shipping/models/get_account_response' -# -# -# require_relative './sp_shipping/models/get_rates_request' -# -# -# require_relative './sp_shipping/models/get_rates_response' -# -# -# require_relative './sp_shipping/models/get_rates_result' -# -# -# require_relative './sp_shipping/models/get_shipment_response' -# -# -# require_relative './sp_shipping/models/get_tracking_information_response' -# -# -# require_relative './sp_shipping/models/label' -# -# -# require_relative './sp_shipping/models/label_result' -# -# -# require_relative './sp_shipping/models/label_result_list' -# -# -# require_relative './sp_shipping/models/label_specification' -# -# -# require_relative './sp_shipping/models/label_stream' -# -# -# require_relative './sp_shipping/models/location' -# -# -# require_relative './sp_shipping/models/party' -# -# -# require_relative './sp_shipping/models/postal_code' -# -# -# require_relative './sp_shipping/models/promised_delivery_date' -# -# -# require_relative './sp_shipping/models/purchase_labels_request' -# -# -# require_relative './sp_shipping/models/purchase_labels_response' -# -# -# require_relative './sp_shipping/models/purchase_labels_result' -# -# -# require_relative './sp_shipping/models/purchase_shipment_request' -# -# -# require_relative './sp_shipping/models/purchase_shipment_response' -# -# -# require_relative './sp_shipping/models/purchase_shipment_result' -# -# -# require_relative './sp_shipping/models/rate' -# -# -# require_relative './sp_shipping/models/rate_id' -# -# -# require_relative './sp_shipping/models/rate_list' -# -# -# require_relative './sp_shipping/models/retrieve_shipping_label_request' -# -# -# require_relative './sp_shipping/models/retrieve_shipping_label_response' -# -# -# require_relative './sp_shipping/models/retrieve_shipping_label_result' -# -# -# require_relative './sp_shipping/models/service_rate' -# -# -# require_relative './sp_shipping/models/service_rate_list' -# -# -# require_relative './sp_shipping/models/service_type' -# -# -# require_relative './sp_shipping/models/service_type_list' -# -# -# require_relative './sp_shipping/models/shipment' -# -# -# require_relative './sp_shipping/models/shipment_id' -# -# -# require_relative './sp_shipping/models/shipping_promise_set' -# -# -# require_relative './sp_shipping/models/state_or_region' -# -# -# require_relative './sp_shipping/models/time_range' -# -# -# require_relative './sp_shipping/models/tracking_id' -# -# -# require_relative './sp_shipping/models/tracking_information' -# -# -# require_relative './sp_shipping/models/tracking_summary' -# -# -# require_relative './sp_shipping/models/weight' -# - -# APIs -require_relative './sp_shipping/api/shipping_api' diff --git a/vendor/shipping/lib/sp_shipping/api/shipping_api.rb b/vendor/shipping/lib/sp_shipping/api/shipping_api.rb deleted file mode 100644 index 9957f24..0000000 --- a/vendor/shipping/lib/sp_shipping/api/shipping_api.rb +++ /dev/null @@ -1,530 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpShipping - class ShippingApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param shipment_id Shipment Id to cancel a shipment - # @param [Hash] opts the optional parameters - # @return [CancelShipmentResponse] - def cancel_shipment(shipment_id, opts = {}) - data = cancel_shipment_with_http_info(shipment_id, opts) - return data - end - - # Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param shipment_id Shipment Id to cancel a shipment - # @param [Hash] opts the optional parameters - # @return [Array<(CancelShipmentResponse)>] CancelShipmentResponse data, response status code and response headers - def cancel_shipment_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.cancel_shipment ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShippingApi.cancel_shipment" - end - # resource path - local_var_path = '/shipping/v1/shipments/{shipmentId}/cancel'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#cancel_shipment\nData: #{data.inspect}" - end - return data - end - # Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body CreateShipmentRequest Body - # @param [Hash] opts the optional parameters - # @return [CreateShipmentResponse] - def create_shipment(body, opts = {}) - data = create_shipment_with_http_info(body, opts) - return data - end - - # Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). - # @param body CreateShipmentRequest Body - # @param [Hash] opts the optional parameters - # @return [Array<(CreateShipmentResponse)>] CreateShipmentResponse data, response status code and response headers - def create_shipment_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.create_shipment ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ShippingApi.create_shipment" - end - # resource path - local_var_path = '/shipping/v1/shipments' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#create_shipment\nData: #{data.inspect}" - end - return data - end - # Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param [Hash] opts the optional parameters - # @return [GetAccountResponse] - def get_account(opts = {}) - data = get_account_with_http_info(opts) - return data - end - - # Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param [Hash] opts the optional parameters - # @return [Array<(GetAccountResponse)>] GetAccountResponse data, response status code and response headers - def get_account_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.get_account ...' - end - # resource path - local_var_path = '/shipping/v1/account' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#get_account\nData: #{data.inspect}" - end - return data - end - # Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body GetRatesRequest body - # @param [Hash] opts the optional parameters - # @return [GetRatesResponse] - def get_rates(body, opts = {}) - data = get_rates_with_http_info(body, opts) - return data - end - - # Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body GetRatesRequest body - # @param [Hash] opts the optional parameters - # @return [Array<(GetRatesResponse)>] GetRatesResponse data, response status code and response headers - def get_rates_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.get_rates ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ShippingApi.get_rates" - end - # resource path - local_var_path = '/shipping/v1/rates' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#get_rates\nData: #{data.inspect}" - end - return data - end - # Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param shipment_id Shipment id to return the entire shipment object - # @param [Hash] opts the optional parameters - # @return [GetShipmentResponse] - def get_shipment(shipment_id, opts = {}) - data = get_shipment_with_http_info(shipment_id, opts) - return data - end - - # Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param shipment_id Shipment id to return the entire shipment object - # @param [Hash] opts the optional parameters - # @return [Array<(GetShipmentResponse)>] GetShipmentResponse data, response status code and response headers - def get_shipment_with_http_info(shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.get_shipment ...' - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShippingApi.get_shipment" - end - # resource path - local_var_path = '/shipping/v1/shipments/{shipmentId}'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#get_shipment\nData: #{data.inspect}" - end - return data - end - # Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param tracking_id Tracking Id - # @param [Hash] opts the optional parameters - # @return [GetTrackingInformationResponse] - def get_tracking_information(tracking_id, opts = {}) - data = get_tracking_information_with_http_info(tracking_id, opts) - return data - end - - # Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param tracking_id Tracking Id - # @param [Hash] opts the optional parameters - # @return [Array<(GetTrackingInformationResponse)>] GetTrackingInformationResponse data, response status code and response headers - def get_tracking_information_with_http_info(tracking_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.get_tracking_information ...' - end - # verify the required parameter 'tracking_id' is set - if @api_client.config.client_side_validation && tracking_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_id' when calling ShippingApi.get_tracking_information" - end - # resource path - local_var_path = '/shipping/v1/tracking/{trackingId}'.sub('{' + 'trackingId' + '}', tracking_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#get_tracking_information\nData: #{data.inspect}" - end - return data - end - # Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body PurchaseShippingLabelRequest body - # @param shipment_id Shipment id for purchase shipping label - # @param [Hash] opts the optional parameters - # @return [PurchaseLabelsResponse] - def purchase_labels(body, shipment_id, opts = {}) - data = purchase_labels_with_http_info(body, shipment_id, opts) - return data - end - - # Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body PurchaseShippingLabelRequest body - # @param shipment_id Shipment id for purchase shipping label - # @param [Hash] opts the optional parameters - # @return [Array<(PurchaseLabelsResponse)>] PurchaseLabelsResponse data, response status code and response headers - def purchase_labels_with_http_info(body, shipment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.purchase_labels ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ShippingApi.purchase_labels" - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShippingApi.purchase_labels" - end - # resource path - local_var_path = '/shipping/v1/shipments/{shipmentId}/purchaseLabels'.sub('{' + 'shipmentId' + '}', shipment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#purchase_labels\nData: #{data.inspect}" - end - return data - end - # Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body PurchaseShipmentRequest body - # @param [Hash] opts the optional parameters - # @return [PurchaseShipmentResponse] - def purchase_shipment(body, opts = {}) - data = purchase_shipment_with_http_info(body, opts) - return data - end - - # Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body PurchaseShipmentRequest body - # @param [Hash] opts the optional parameters - # @return [Array<(PurchaseShipmentResponse)>] PurchaseShipmentResponse data, response status code and response headers - def purchase_shipment_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.purchase_shipment ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ShippingApi.purchase_shipment" - end - # resource path - local_var_path = '/shipping/v1/purchaseShipment' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#purchase_shipment\nData: #{data.inspect}" - end - return data - end - # Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body RetrieveShippingLabelRequest body - # @param shipment_id Shipment Id to retreive label - # @param tracking_id Tracking Id - # @param [Hash] opts the optional parameters - # @return [RetrieveShippingLabelResponse] - def retrieve_shipping_label(body, shipment_id, tracking_id, opts = {}) - data = retrieve_shipping_label_with_http_info(body, shipment_id, tracking_id, opts) - return data - end - - # Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation. - # @param body RetrieveShippingLabelRequest body - # @param shipment_id Shipment Id to retreive label - # @param tracking_id Tracking Id - # @param [Hash] opts the optional parameters - # @return [Array<(RetrieveShippingLabelResponse)>] RetrieveShippingLabelResponse data, response status code and response headers - def retrieve_shipping_label_with_http_info(body, shipment_id, tracking_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ShippingApi.retrieve_shipping_label ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ShippingApi.retrieve_shipping_label" - end - # verify the required parameter 'shipment_id' is set - if @api_client.config.client_side_validation && shipment_id.nil? - fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShippingApi.retrieve_shipping_label" - end - # verify the required parameter 'tracking_id' is set - if @api_client.config.client_side_validation && tracking_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_id' when calling ShippingApi.retrieve_shipping_label" - end - # resource path - local_var_path = '/shipping/v1/shipments/{shipmentId}/containers/{trackingId}/label'.sub('{' + 'shipmentId' + '}', shipment_id.to_s).sub('{' + 'trackingId' + '}', tracking_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ShippingApi#retrieve_shipping_label\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/shipping/lib/sp_shipping/api_client.rb b/vendor/shipping/lib/sp_shipping/api_client.rb deleted file mode 100644 index c9cc4da..0000000 --- a/vendor/shipping/lib/sp_shipping/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpShipping - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpShipping.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/shipping/lib/sp_shipping/api_error.rb b/vendor/shipping/lib/sp_shipping/api_error.rb deleted file mode 100644 index a72e298..0000000 --- a/vendor/shipping/lib/sp_shipping/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpShipping - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/shipping/lib/sp_shipping/configuration.rb b/vendor/shipping/lib/sp_shipping/configuration.rb deleted file mode 100644 index 84f552b..0000000 --- a/vendor/shipping/lib/sp_shipping/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpShipping - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/accepted_rate.rb b/vendor/shipping/lib/sp_shipping/models/accepted_rate.rb deleted file mode 100644 index 3abe5a1..0000000 --- a/vendor/shipping/lib/sp_shipping/models/accepted_rate.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The specific rate purchased for the shipment, or null if unpurchased. - class AcceptedRate - attr_accessor :total_charge - - attr_accessor :billed_weight - - attr_accessor :service_type - - attr_accessor :promise - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_charge' => :'totalCharge', - :'billed_weight' => :'billedWeight', - :'service_type' => :'serviceType', - :'promise' => :'promise' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_charge' => :'Object', - :'billed_weight' => :'Object', - :'service_type' => :'Object', - :'promise' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::AcceptedRate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::AcceptedRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_charge') - self.total_charge = attributes[:'total_charge'] - end - - if attributes.key?(:'billed_weight') - self.billed_weight = attributes[:'billed_weight'] - end - - if attributes.key?(:'service_type') - self.service_type = attributes[:'service_type'] - end - - if attributes.key?(:'promise') - self.promise = attributes[:'promise'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_charge == o.total_charge && - billed_weight == o.billed_weight && - service_type == o.service_type && - promise == o.promise - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_charge, billed_weight, service_type, promise].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/account.rb b/vendor/shipping/lib/sp_shipping/models/account.rb deleted file mode 100644 index 25b7b98..0000000 --- a/vendor/shipping/lib/sp_shipping/models/account.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The account related data. - class Account - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'accountId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Account` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/account_id.rb b/vendor/shipping/lib/sp_shipping/models/account_id.rb deleted file mode 100644 index 152ac6c..0000000 --- a/vendor/shipping/lib/sp_shipping/models/account_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # This is the Amazon Shipping account id generated during the Amazon Shipping onboarding process. - class AccountId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::AccountId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::AccountId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/address.rb b/vendor/shipping/lib/sp_shipping/models/address.rb deleted file mode 100644 index 370e587..0000000 --- a/vendor/shipping/lib/sp_shipping/models/address.rb +++ /dev/null @@ -1,340 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The address. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of that address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - attr_accessor :state_or_region - - attr_accessor :city - - attr_accessor :country_code - - attr_accessor :postal_code - - # The email address of the contact associated with the address. - attr_accessor :email - - # The email cc addresses of the contact associated with the address. - attr_accessor :copy_emails - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'state_or_region' => :'stateOrRegion', - :'city' => :'city', - :'country_code' => :'countryCode', - :'postal_code' => :'postalCode', - :'email' => :'email', - :'copy_emails' => :'copyEmails', - :'phone_number' => :'phoneNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'state_or_region' => :'Object', - :'city' => :'Object', - :'country_code' => :'Object', - :'postal_code' => :'Object', - :'email' => :'Object', - :'copy_emails' => :'Object', - :'phone_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'copy_emails') - if (value = attributes[:'copy_emails']).is_a?(Array) - self.copy_emails = value - end - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @state_or_region.nil? - invalid_properties.push('invalid value for "state_or_region", state_or_region cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @state_or_region.nil? - return false if @city.nil? - return false if @country_code.nil? - return false if @postal_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - state_or_region == o.state_or_region && - city == o.city && - country_code == o.country_code && - postal_code == o.postal_code && - email == o.email && - copy_emails == o.copy_emails && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, state_or_region, city, country_code, postal_code, email, copy_emails, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/cancel_shipment_response.rb b/vendor/shipping/lib/sp_shipping/models/cancel_shipment_response.rb deleted file mode 100644 index e43f2a5..0000000 --- a/vendor/shipping/lib/sp_shipping/models/cancel_shipment_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the cancelShipment operation. - class CancelShipmentResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::CancelShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::CancelShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/city.rb b/vendor/shipping/lib/sp_shipping/models/city.rb deleted file mode 100644 index f5b0d21..0000000 --- a/vendor/shipping/lib/sp_shipping/models/city.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The city where the person, business or institution is located. - class City - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::City` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::City`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/client_reference_id.rb b/vendor/shipping/lib/sp_shipping/models/client_reference_id.rb deleted file mode 100644 index 6f3c4ee..0000000 --- a/vendor/shipping/lib/sp_shipping/models/client_reference_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Client reference id. - class ClientReferenceId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ClientReferenceId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ClientReferenceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container.rb b/vendor/shipping/lib/sp_shipping/models/container.rb deleted file mode 100644 index a49a212..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Container in the shipment. - class Container - # The type of physical container being used. (always 'PACKAGE') - attr_accessor :container_type - - attr_accessor :container_reference_id - - attr_accessor :value - - attr_accessor :dimensions - - # A list of the items in the container. - attr_accessor :items - - attr_accessor :weight - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_type' => :'containerType', - :'container_reference_id' => :'containerReferenceId', - :'value' => :'value', - :'dimensions' => :'dimensions', - :'items' => :'items', - :'weight' => :'weight' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_type' => :'Object', - :'container_reference_id' => :'Object', - :'value' => :'Object', - :'dimensions' => :'Object', - :'items' => :'Object', - :'weight' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Container` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Container`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_type') - self.container_type = attributes[:'container_type'] - end - - if attributes.key?(:'container_reference_id') - self.container_reference_id = attributes[:'container_reference_id'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @container_reference_id.nil? - invalid_properties.push('invalid value for "container_reference_id", container_reference_id cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @dimensions.nil? - invalid_properties.push('invalid value for "dimensions", dimensions cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @weight.nil? - invalid_properties.push('invalid value for "weight", weight cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - container_type_validator = EnumAttributeValidator.new('Object', ['PACKAGE']) - return false unless container_type_validator.valid?(@container_type) - return false if @container_reference_id.nil? - return false if @value.nil? - return false if @dimensions.nil? - return false if @items.nil? - return false if @weight.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] container_type Object to be assigned - def container_type=(container_type) - validator = EnumAttributeValidator.new('Object', ['PACKAGE']) - unless validator.valid?(container_type) - fail ArgumentError, "invalid value for \"container_type\", must be one of #{validator.allowable_values}." - end - @container_type = container_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_type == o.container_type && - container_reference_id == o.container_reference_id && - value == o.value && - dimensions == o.dimensions && - items == o.items && - weight == o.weight - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_type, container_reference_id, value, dimensions, items, weight].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container_item.rb b/vendor/shipping/lib/sp_shipping/models/container_item.rb deleted file mode 100644 index e0f05a2..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container_item.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Item in the container. - class ContainerItem - # The quantity of the items of this type in the container. - attr_accessor :quantity - - attr_accessor :unit_price - - attr_accessor :unit_weight - - # A descriptive title of the item. - attr_accessor :title - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'quantity' => :'quantity', - :'unit_price' => :'unitPrice', - :'unit_weight' => :'unitWeight', - :'title' => :'title' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'quantity' => :'Object', - :'unit_price' => :'Object', - :'unit_weight' => :'Object', - :'title' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ContainerItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ContainerItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'unit_price') - self.unit_price = attributes[:'unit_price'] - end - - if attributes.key?(:'unit_weight') - self.unit_weight = attributes[:'unit_weight'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @unit_price.nil? - invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.') - end - - if @unit_weight.nil? - invalid_properties.push('invalid value for "unit_weight", unit_weight cannot be nil.') - end - - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @quantity.nil? - return false if @unit_price.nil? - return false if @unit_weight.nil? - return false if @title.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - quantity == o.quantity && - unit_price == o.unit_price && - unit_weight == o.unit_weight && - title == o.title - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [quantity, unit_price, unit_weight, title].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container_list.rb b/vendor/shipping/lib/sp_shipping/models/container_list.rb deleted file mode 100644 index 58d8bac..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of container. - class ContainerList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ContainerList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ContainerList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container_reference_id.rb b/vendor/shipping/lib/sp_shipping/models/container_reference_id.rb deleted file mode 100644 index 351d7cb..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container_reference_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # An identifier for the container. This must be unique within all the containers in the same shipment. - class ContainerReferenceId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ContainerReferenceId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ContainerReferenceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container_specification.rb b/vendor/shipping/lib/sp_shipping/models/container_specification.rb deleted file mode 100644 index d1896d0..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container_specification.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Container specification for checking the service rate. - class ContainerSpecification - attr_accessor :dimensions - - attr_accessor :weight - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dimensions' => :'dimensions', - :'weight' => :'weight' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'dimensions' => :'Object', - :'weight' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ContainerSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ContainerSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @dimensions.nil? - invalid_properties.push('invalid value for "dimensions", dimensions cannot be nil.') - end - - if @weight.nil? - invalid_properties.push('invalid value for "weight", weight cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @dimensions.nil? - return false if @weight.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dimensions == o.dimensions && - weight == o.weight - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dimensions, weight].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/container_specification_list.rb b/vendor/shipping/lib/sp_shipping/models/container_specification_list.rb deleted file mode 100644 index 4b5a5b1..0000000 --- a/vendor/shipping/lib/sp_shipping/models/container_specification_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of container specifications. - class ContainerSpecificationList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ContainerSpecificationList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ContainerSpecificationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/country_code.rb b/vendor/shipping/lib/sp_shipping/models/country_code.rb deleted file mode 100644 index b81ab3f..0000000 --- a/vendor/shipping/lib/sp_shipping/models/country_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The two digit country code. In ISO 3166-1 alpha-2 format. - class CountryCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::CountryCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::CountryCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/create_shipment_request.rb b/vendor/shipping/lib/sp_shipping/models/create_shipment_request.rb deleted file mode 100644 index 7cc93f4..0000000 --- a/vendor/shipping/lib/sp_shipping/models/create_shipment_request.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The request schema for the createShipment operation. - class CreateShipmentRequest - attr_accessor :client_reference_id - - attr_accessor :ship_to - - attr_accessor :ship_from - - attr_accessor :containers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_reference_id' => :'clientReferenceId', - :'ship_to' => :'shipTo', - :'ship_from' => :'shipFrom', - :'containers' => :'containers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_reference_id' => :'Object', - :'ship_to' => :'Object', - :'ship_from' => :'Object', - :'containers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::CreateShipmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::CreateShipmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_reference_id') - self.client_reference_id = attributes[:'client_reference_id'] - end - - if attributes.key?(:'ship_to') - self.ship_to = attributes[:'ship_to'] - end - - if attributes.key?(:'ship_from') - self.ship_from = attributes[:'ship_from'] - end - - if attributes.key?(:'containers') - self.containers = attributes[:'containers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_reference_id.nil? - invalid_properties.push('invalid value for "client_reference_id", client_reference_id cannot be nil.') - end - - if @ship_to.nil? - invalid_properties.push('invalid value for "ship_to", ship_to cannot be nil.') - end - - if @ship_from.nil? - invalid_properties.push('invalid value for "ship_from", ship_from cannot be nil.') - end - - if @containers.nil? - invalid_properties.push('invalid value for "containers", containers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_reference_id.nil? - return false if @ship_to.nil? - return false if @ship_from.nil? - return false if @containers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_reference_id == o.client_reference_id && - ship_to == o.ship_to && - ship_from == o.ship_from && - containers == o.containers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_reference_id, ship_to, ship_from, containers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/create_shipment_response.rb b/vendor/shipping/lib/sp_shipping/models/create_shipment_response.rb deleted file mode 100644 index a847c94..0000000 --- a/vendor/shipping/lib/sp_shipping/models/create_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the createShipment operation. - class CreateShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::CreateShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::CreateShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/create_shipment_result.rb b/vendor/shipping/lib/sp_shipping/models/create_shipment_result.rb deleted file mode 100644 index 1eaad4a..0000000 --- a/vendor/shipping/lib/sp_shipping/models/create_shipment_result.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the createShipment operation. - class CreateShipmentResult - attr_accessor :shipment_id - - attr_accessor :eligible_rates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'shipmentId', - :'eligible_rates' => :'eligibleRates' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'eligible_rates' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::CreateShipmentResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::CreateShipmentResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'eligible_rates') - self.eligible_rates = attributes[:'eligible_rates'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_id.nil? - invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') - end - - if @eligible_rates.nil? - invalid_properties.push('invalid value for "eligible_rates", eligible_rates cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_id.nil? - return false if @eligible_rates.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - eligible_rates == o.eligible_rates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, eligible_rates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/currency.rb b/vendor/shipping/lib/sp_shipping/models/currency.rb deleted file mode 100644 index dfdb7fb..0000000 --- a/vendor/shipping/lib/sp_shipping/models/currency.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The total value of all items in the container. - class Currency - # The amount of currency. - attr_accessor :value - - # A 3-character currency code. - attr_accessor :unit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'unit' => :'unit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Currency` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Currency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @unit.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - unit == o.unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/dimensions.rb b/vendor/shipping/lib/sp_shipping/models/dimensions.rb deleted file mode 100644 index b784fa2..0000000 --- a/vendor/shipping/lib/sp_shipping/models/dimensions.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A set of measurements for a three-dimensional object. - class Dimensions - # The length of the container. - attr_accessor :length - - # The width of the container. - attr_accessor :width - - # The height of the container. - attr_accessor :height - - # The unit of these measurements. - attr_accessor :unit - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'length', - :'width' => :'width', - :'height' => :'height', - :'unit' => :'unit' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Object', - :'width' => :'Object', - :'height' => :'Object', - :'unit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Dimensions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Dimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @length.nil? - invalid_properties.push('invalid value for "length", length cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - if @height.nil? - invalid_properties.push('invalid value for "height", height cannot be nil.') - end - - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @length.nil? - return false if @width.nil? - return false if @height.nil? - return false if @unit.nil? - unit_validator = EnumAttributeValidator.new('Object', ['IN', 'CM']) - return false unless unit_validator.valid?(@unit) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('Object', ['IN', 'CM']) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length && - width == o.width && - height == o.height && - unit == o.unit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length, width, height, unit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/error.rb b/vendor/shipping/lib/sp_shipping/models/error.rb deleted file mode 100644 index b4186cf..0000000 --- a/vendor/shipping/lib/sp_shipping/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/error_list.rb b/vendor/shipping/lib/sp_shipping/models/error_list.rb deleted file mode 100644 index 369ddc4..0000000 --- a/vendor/shipping/lib/sp_shipping/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/event.rb b/vendor/shipping/lib/sp_shipping/models/event.rb deleted file mode 100644 index bd76773..0000000 --- a/vendor/shipping/lib/sp_shipping/models/event.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # An event of a shipment - class Event - attr_accessor :event_code - - # The date and time of an event for a shipment. - attr_accessor :event_time - - attr_accessor :location - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_code' => :'eventCode', - :'event_time' => :'eventTime', - :'location' => :'location' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_code' => :'Object', - :'event_time' => :'Object', - :'location' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Event` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_code') - self.event_code = attributes[:'event_code'] - end - - if attributes.key?(:'event_time') - self.event_time = attributes[:'event_time'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @event_code.nil? - invalid_properties.push('invalid value for "event_code", event_code cannot be nil.') - end - - if @event_time.nil? - invalid_properties.push('invalid value for "event_time", event_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_code.nil? - return false if @event_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_code == o.event_code && - event_time == o.event_time && - location == o.location - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_code, event_time, location].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/event_code.rb b/vendor/shipping/lib/sp_shipping/models/event_code.rb deleted file mode 100644 index 93e2c79..0000000 --- a/vendor/shipping/lib/sp_shipping/models/event_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The event code of a shipment, such as Departed, Received, and ReadyForReceive. - class EventCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::EventCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::EventCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/event_list.rb b/vendor/shipping/lib/sp_shipping/models/event_list.rb deleted file mode 100644 index 0e67b8e..0000000 --- a/vendor/shipping/lib/sp_shipping/models/event_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of events of a shipment. - class EventList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::EventList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::EventList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_account_response.rb b/vendor/shipping/lib/sp_shipping/models/get_account_response.rb deleted file mode 100644 index 658a9d9..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_account_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the getAccount operation. - class GetAccountResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetAccountResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_rates_request.rb b/vendor/shipping/lib/sp_shipping/models/get_rates_request.rb deleted file mode 100644 index f5676a1..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_rates_request.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the getRates operation. - class GetRatesRequest - attr_accessor :ship_to - - attr_accessor :ship_from - - attr_accessor :service_types - - # The start date and time. This defaults to the current date and time. - attr_accessor :ship_date - - attr_accessor :container_specifications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ship_to' => :'shipTo', - :'ship_from' => :'shipFrom', - :'service_types' => :'serviceTypes', - :'ship_date' => :'shipDate', - :'container_specifications' => :'containerSpecifications' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'ship_to' => :'Object', - :'ship_from' => :'Object', - :'service_types' => :'Object', - :'ship_date' => :'Object', - :'container_specifications' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetRatesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetRatesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ship_to') - self.ship_to = attributes[:'ship_to'] - end - - if attributes.key?(:'ship_from') - self.ship_from = attributes[:'ship_from'] - end - - if attributes.key?(:'service_types') - self.service_types = attributes[:'service_types'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'container_specifications') - self.container_specifications = attributes[:'container_specifications'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @ship_to.nil? - invalid_properties.push('invalid value for "ship_to", ship_to cannot be nil.') - end - - if @ship_from.nil? - invalid_properties.push('invalid value for "ship_from", ship_from cannot be nil.') - end - - if @service_types.nil? - invalid_properties.push('invalid value for "service_types", service_types cannot be nil.') - end - - if @container_specifications.nil? - invalid_properties.push('invalid value for "container_specifications", container_specifications cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @ship_to.nil? - return false if @ship_from.nil? - return false if @service_types.nil? - return false if @container_specifications.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ship_to == o.ship_to && - ship_from == o.ship_from && - service_types == o.service_types && - ship_date == o.ship_date && - container_specifications == o.container_specifications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ship_to, ship_from, service_types, ship_date, container_specifications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_rates_response.rb b/vendor/shipping/lib/sp_shipping/models/get_rates_response.rb deleted file mode 100644 index 710807a..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_rates_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the getRates operation. - class GetRatesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetRatesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetRatesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_rates_result.rb b/vendor/shipping/lib/sp_shipping/models/get_rates_result.rb deleted file mode 100644 index f4671a0..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_rates_result.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the getRates operation. - class GetRatesResult - attr_accessor :service_rates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service_rates' => :'serviceRates' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'service_rates' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetRatesResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetRatesResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service_rates') - self.service_rates = attributes[:'service_rates'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @service_rates.nil? - invalid_properties.push('invalid value for "service_rates", service_rates cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @service_rates.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service_rates == o.service_rates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service_rates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_shipment_response.rb b/vendor/shipping/lib/sp_shipping/models/get_shipment_response.rb deleted file mode 100644 index 1aae0ff..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the getShipment operation. - class GetShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/get_tracking_information_response.rb b/vendor/shipping/lib/sp_shipping/models/get_tracking_information_response.rb deleted file mode 100644 index 4097883..0000000 --- a/vendor/shipping/lib/sp_shipping/models/get_tracking_information_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the getTrackingInformation operation. - class GetTrackingInformationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::GetTrackingInformationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::GetTrackingInformationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/label.rb b/vendor/shipping/lib/sp_shipping/models/label.rb deleted file mode 100644 index c55e144..0000000 --- a/vendor/shipping/lib/sp_shipping/models/label.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The label details of the container. - class Label - attr_accessor :label_stream - - attr_accessor :label_specification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_stream' => :'labelStream', - :'label_specification' => :'labelSpecification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_stream' => :'Object', - :'label_specification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Label` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Label`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_stream') - self.label_stream = attributes[:'label_stream'] - end - - if attributes.key?(:'label_specification') - self.label_specification = attributes[:'label_specification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_stream == o.label_stream && - label_specification == o.label_specification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_stream, label_specification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/label_result.rb b/vendor/shipping/lib/sp_shipping/models/label_result.rb deleted file mode 100644 index b7af753..0000000 --- a/vendor/shipping/lib/sp_shipping/models/label_result.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Label details including label stream, format, size. - class LabelResult - attr_accessor :container_reference_id - - # The tracking identifier assigned to the container. - attr_accessor :tracking_id - - attr_accessor :label - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_reference_id' => :'containerReferenceId', - :'tracking_id' => :'trackingId', - :'label' => :'label' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_reference_id' => :'Object', - :'tracking_id' => :'Object', - :'label' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::LabelResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::LabelResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_reference_id') - self.container_reference_id = attributes[:'container_reference_id'] - end - - if attributes.key?(:'tracking_id') - self.tracking_id = attributes[:'tracking_id'] - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_reference_id == o.container_reference_id && - tracking_id == o.tracking_id && - label == o.label - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_reference_id, tracking_id, label].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/label_result_list.rb b/vendor/shipping/lib/sp_shipping/models/label_result_list.rb deleted file mode 100644 index dd4d317..0000000 --- a/vendor/shipping/lib/sp_shipping/models/label_result_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of label results - class LabelResultList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::LabelResultList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::LabelResultList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/label_specification.rb b/vendor/shipping/lib/sp_shipping/models/label_specification.rb deleted file mode 100644 index 58b3be5..0000000 --- a/vendor/shipping/lib/sp_shipping/models/label_specification.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The label specification info. - class LabelSpecification - # The format of the label. Enum of PNG only for now. - attr_accessor :label_format - - # The label stock size specification in length and height. Enum of 4x6 only for now. - attr_accessor :label_stock_size - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_format' => :'labelFormat', - :'label_stock_size' => :'labelStockSize' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_format' => :'Object', - :'label_stock_size' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::LabelSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::LabelSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - - if attributes.key?(:'label_stock_size') - self.label_stock_size = attributes[:'label_stock_size'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @label_format.nil? - invalid_properties.push('invalid value for "label_format", label_format cannot be nil.') - end - - if @label_stock_size.nil? - invalid_properties.push('invalid value for "label_stock_size", label_stock_size cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @label_format.nil? - label_format_validator = EnumAttributeValidator.new('Object', ['PNG']) - return false unless label_format_validator.valid?(@label_format) - return false if @label_stock_size.nil? - label_stock_size_validator = EnumAttributeValidator.new('Object', ['4x6']) - return false unless label_stock_size_validator.valid?(@label_stock_size) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] label_format Object to be assigned - def label_format=(label_format) - validator = EnumAttributeValidator.new('Object', ['PNG']) - unless validator.valid?(label_format) - fail ArgumentError, "invalid value for \"label_format\", must be one of #{validator.allowable_values}." - end - @label_format = label_format - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] label_stock_size Object to be assigned - def label_stock_size=(label_stock_size) - validator = EnumAttributeValidator.new('Object', ['4x6']) - unless validator.valid?(label_stock_size) - fail ArgumentError, "invalid value for \"label_stock_size\", must be one of #{validator.allowable_values}." - end - @label_stock_size = label_stock_size - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_format == o.label_format && - label_stock_size == o.label_stock_size - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_format, label_stock_size].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/label_stream.rb b/vendor/shipping/lib/sp_shipping/models/label_stream.rb deleted file mode 100644 index 4e0ea8b..0000000 --- a/vendor/shipping/lib/sp_shipping/models/label_stream.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # Contains binary image data encoded as a base-64 string. - class LabelStream - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::LabelStream` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::LabelStream`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/location.rb b/vendor/shipping/lib/sp_shipping/models/location.rb deleted file mode 100644 index e2154f3..0000000 --- a/vendor/shipping/lib/sp_shipping/models/location.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The location where the person, business or institution is located. - class Location - attr_accessor :state_or_region - - attr_accessor :city - - attr_accessor :country_code - - attr_accessor :postal_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state_or_region' => :'stateOrRegion', - :'city' => :'city', - :'country_code' => :'countryCode', - :'postal_code' => :'postalCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'state_or_region' => :'Object', - :'city' => :'Object', - :'country_code' => :'Object', - :'postal_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Location` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Location`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state_or_region == o.state_or_region && - city == o.city && - country_code == o.country_code && - postal_code == o.postal_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state_or_region, city, country_code, postal_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/party.rb b/vendor/shipping/lib/sp_shipping/models/party.rb deleted file mode 100644 index d13ead9..0000000 --- a/vendor/shipping/lib/sp_shipping/models/party.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The account related with the shipment. - class Party - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'accountId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Party` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Party`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/postal_code.rb b/vendor/shipping/lib/sp_shipping/models/postal_code.rb deleted file mode 100644 index dc79f72..0000000 --- a/vendor/shipping/lib/sp_shipping/models/postal_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation. - class PostalCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PostalCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PostalCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/promised_delivery_date.rb b/vendor/shipping/lib/sp_shipping/models/promised_delivery_date.rb deleted file mode 100644 index b60b6a9..0000000 --- a/vendor/shipping/lib/sp_shipping/models/promised_delivery_date.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The promised delivery date and time of a shipment. - class PromisedDeliveryDate - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PromisedDeliveryDate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PromisedDeliveryDate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_labels_request.rb b/vendor/shipping/lib/sp_shipping/models/purchase_labels_request.rb deleted file mode 100644 index 065644b..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_labels_request.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The request schema for the purchaseLabels operation. - class PurchaseLabelsRequest - attr_accessor :rate_id - - attr_accessor :label_specification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rate_id' => :'rateId', - :'label_specification' => :'labelSpecification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'rate_id' => :'Object', - :'label_specification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseLabelsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseLabelsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rate_id') - self.rate_id = attributes[:'rate_id'] - end - - if attributes.key?(:'label_specification') - self.label_specification = attributes[:'label_specification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rate_id.nil? - invalid_properties.push('invalid value for "rate_id", rate_id cannot be nil.') - end - - if @label_specification.nil? - invalid_properties.push('invalid value for "label_specification", label_specification cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rate_id.nil? - return false if @label_specification.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rate_id == o.rate_id && - label_specification == o.label_specification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rate_id, label_specification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_labels_response.rb b/vendor/shipping/lib/sp_shipping/models/purchase_labels_response.rb deleted file mode 100644 index c5cded1..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_labels_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the purchaseLabels operation. - class PurchaseLabelsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseLabelsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseLabelsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_labels_result.rb b/vendor/shipping/lib/sp_shipping/models/purchase_labels_result.rb deleted file mode 100644 index 00b67f8..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_labels_result.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the purchaseLabels operation. - class PurchaseLabelsResult - attr_accessor :shipment_id - - attr_accessor :client_reference_id - - attr_accessor :accepted_rate - - attr_accessor :label_results - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'shipmentId', - :'client_reference_id' => :'clientReferenceId', - :'accepted_rate' => :'acceptedRate', - :'label_results' => :'labelResults' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'client_reference_id' => :'Object', - :'accepted_rate' => :'Object', - :'label_results' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseLabelsResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseLabelsResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'client_reference_id') - self.client_reference_id = attributes[:'client_reference_id'] - end - - if attributes.key?(:'accepted_rate') - self.accepted_rate = attributes[:'accepted_rate'] - end - - if attributes.key?(:'label_results') - self.label_results = attributes[:'label_results'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_id.nil? - invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') - end - - if @accepted_rate.nil? - invalid_properties.push('invalid value for "accepted_rate", accepted_rate cannot be nil.') - end - - if @label_results.nil? - invalid_properties.push('invalid value for "label_results", label_results cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_id.nil? - return false if @accepted_rate.nil? - return false if @label_results.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - client_reference_id == o.client_reference_id && - accepted_rate == o.accepted_rate && - label_results == o.label_results - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, client_reference_id, accepted_rate, label_results].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_request.rb b/vendor/shipping/lib/sp_shipping/models/purchase_shipment_request.rb deleted file mode 100644 index 5a723c1..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_request.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the purchaseShipment operation. - class PurchaseShipmentRequest - attr_accessor :client_reference_id - - attr_accessor :ship_to - - attr_accessor :ship_from - - # The start date and time. This defaults to the current date and time. - attr_accessor :ship_date - - attr_accessor :service_type - - attr_accessor :containers - - attr_accessor :label_specification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_reference_id' => :'clientReferenceId', - :'ship_to' => :'shipTo', - :'ship_from' => :'shipFrom', - :'ship_date' => :'shipDate', - :'service_type' => :'serviceType', - :'containers' => :'containers', - :'label_specification' => :'labelSpecification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_reference_id' => :'Object', - :'ship_to' => :'Object', - :'ship_from' => :'Object', - :'ship_date' => :'Object', - :'service_type' => :'Object', - :'containers' => :'Object', - :'label_specification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseShipmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseShipmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_reference_id') - self.client_reference_id = attributes[:'client_reference_id'] - end - - if attributes.key?(:'ship_to') - self.ship_to = attributes[:'ship_to'] - end - - if attributes.key?(:'ship_from') - self.ship_from = attributes[:'ship_from'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'service_type') - self.service_type = attributes[:'service_type'] - end - - if attributes.key?(:'containers') - self.containers = attributes[:'containers'] - end - - if attributes.key?(:'label_specification') - self.label_specification = attributes[:'label_specification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_reference_id.nil? - invalid_properties.push('invalid value for "client_reference_id", client_reference_id cannot be nil.') - end - - if @ship_to.nil? - invalid_properties.push('invalid value for "ship_to", ship_to cannot be nil.') - end - - if @ship_from.nil? - invalid_properties.push('invalid value for "ship_from", ship_from cannot be nil.') - end - - if @service_type.nil? - invalid_properties.push('invalid value for "service_type", service_type cannot be nil.') - end - - if @containers.nil? - invalid_properties.push('invalid value for "containers", containers cannot be nil.') - end - - if @label_specification.nil? - invalid_properties.push('invalid value for "label_specification", label_specification cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_reference_id.nil? - return false if @ship_to.nil? - return false if @ship_from.nil? - return false if @service_type.nil? - return false if @containers.nil? - return false if @label_specification.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_reference_id == o.client_reference_id && - ship_to == o.ship_to && - ship_from == o.ship_from && - ship_date == o.ship_date && - service_type == o.service_type && - containers == o.containers && - label_specification == o.label_specification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_reference_id, ship_to, ship_from, ship_date, service_type, containers, label_specification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_response.rb b/vendor/shipping/lib/sp_shipping/models/purchase_shipment_response.rb deleted file mode 100644 index 5187d09..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the purchaseShipment operation. - class PurchaseShipmentResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseShipmentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseShipmentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_result.rb b/vendor/shipping/lib/sp_shipping/models/purchase_shipment_result.rb deleted file mode 100644 index f9144c7..0000000 --- a/vendor/shipping/lib/sp_shipping/models/purchase_shipment_result.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the purchaseShipment operation. - class PurchaseShipmentResult - attr_accessor :shipment_id - - attr_accessor :service_rate - - attr_accessor :label_results - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'shipmentId', - :'service_rate' => :'serviceRate', - :'label_results' => :'labelResults' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'service_rate' => :'Object', - :'label_results' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::PurchaseShipmentResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::PurchaseShipmentResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'service_rate') - self.service_rate = attributes[:'service_rate'] - end - - if attributes.key?(:'label_results') - self.label_results = attributes[:'label_results'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_id.nil? - invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') - end - - if @service_rate.nil? - invalid_properties.push('invalid value for "service_rate", service_rate cannot be nil.') - end - - if @label_results.nil? - invalid_properties.push('invalid value for "label_results", label_results cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_id.nil? - return false if @service_rate.nil? - return false if @label_results.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - service_rate == o.service_rate && - label_results == o.label_results - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, service_rate, label_results].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/rate.rb b/vendor/shipping/lib/sp_shipping/models/rate.rb deleted file mode 100644 index b73d0e0..0000000 --- a/vendor/shipping/lib/sp_shipping/models/rate.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The available rate that can be used to send the shipment - class Rate - # An identifier for the rate. - attr_accessor :rate_id - - attr_accessor :total_charge - - attr_accessor :billed_weight - - # The time after which the offering will expire. - attr_accessor :expiration_time - - attr_accessor :service_type - - attr_accessor :promise - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rate_id' => :'rateId', - :'total_charge' => :'totalCharge', - :'billed_weight' => :'billedWeight', - :'expiration_time' => :'expirationTime', - :'service_type' => :'serviceType', - :'promise' => :'promise' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'rate_id' => :'Object', - :'total_charge' => :'Object', - :'billed_weight' => :'Object', - :'expiration_time' => :'Object', - :'service_type' => :'Object', - :'promise' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Rate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Rate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rate_id') - self.rate_id = attributes[:'rate_id'] - end - - if attributes.key?(:'total_charge') - self.total_charge = attributes[:'total_charge'] - end - - if attributes.key?(:'billed_weight') - self.billed_weight = attributes[:'billed_weight'] - end - - if attributes.key?(:'expiration_time') - self.expiration_time = attributes[:'expiration_time'] - end - - if attributes.key?(:'service_type') - self.service_type = attributes[:'service_type'] - end - - if attributes.key?(:'promise') - self.promise = attributes[:'promise'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rate_id == o.rate_id && - total_charge == o.total_charge && - billed_weight == o.billed_weight && - expiration_time == o.expiration_time && - service_type == o.service_type && - promise == o.promise - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rate_id, total_charge, billed_weight, expiration_time, service_type, promise].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/rate_id.rb b/vendor/shipping/lib/sp_shipping/models/rate_id.rb deleted file mode 100644 index b349a30..0000000 --- a/vendor/shipping/lib/sp_shipping/models/rate_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # An identifier for the rating. - class RateId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::RateId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::RateId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/rate_list.rb b/vendor/shipping/lib/sp_shipping/models/rate_list.rb deleted file mode 100644 index 398cffa..0000000 --- a/vendor/shipping/lib/sp_shipping/models/rate_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of all the available rates that can be used to send the shipment. - class RateList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::RateList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::RateList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_request.rb b/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_request.rb deleted file mode 100644 index 7a37ffa..0000000 --- a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The request schema for the retrieveShippingLabel operation. - class RetrieveShippingLabelRequest - attr_accessor :label_specification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_specification' => :'labelSpecification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_specification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::RetrieveShippingLabelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::RetrieveShippingLabelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_specification') - self.label_specification = attributes[:'label_specification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @label_specification.nil? - invalid_properties.push('invalid value for "label_specification", label_specification cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @label_specification.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_specification == o.label_specification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_specification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_response.rb b/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_response.rb deleted file mode 100644 index f279567..0000000 --- a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The response schema for the retrieveShippingLabel operation. - class RetrieveShippingLabelResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::RetrieveShippingLabelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::RetrieveShippingLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_result.rb b/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_result.rb deleted file mode 100644 index 998f420..0000000 --- a/vendor/shipping/lib/sp_shipping/models/retrieve_shipping_label_result.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the retrieveShippingLabel operation. - class RetrieveShippingLabelResult - attr_accessor :label_stream - - attr_accessor :label_specification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_stream' => :'labelStream', - :'label_specification' => :'labelSpecification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_stream' => :'Object', - :'label_specification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::RetrieveShippingLabelResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::RetrieveShippingLabelResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_stream') - self.label_stream = attributes[:'label_stream'] - end - - if attributes.key?(:'label_specification') - self.label_specification = attributes[:'label_specification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @label_stream.nil? - invalid_properties.push('invalid value for "label_stream", label_stream cannot be nil.') - end - - if @label_specification.nil? - invalid_properties.push('invalid value for "label_specification", label_specification cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @label_stream.nil? - return false if @label_specification.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_stream == o.label_stream && - label_specification == o.label_specification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_stream, label_specification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/service_rate.rb b/vendor/shipping/lib/sp_shipping/models/service_rate.rb deleted file mode 100644 index c427dd4..0000000 --- a/vendor/shipping/lib/sp_shipping/models/service_rate.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The specific rate for a shipping service, or null if no service available. - class ServiceRate - attr_accessor :total_charge - - attr_accessor :billable_weight - - attr_accessor :service_type - - attr_accessor :promise - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_charge' => :'totalCharge', - :'billable_weight' => :'billableWeight', - :'service_type' => :'serviceType', - :'promise' => :'promise' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_charge' => :'Object', - :'billable_weight' => :'Object', - :'service_type' => :'Object', - :'promise' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ServiceRate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ServiceRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_charge') - self.total_charge = attributes[:'total_charge'] - end - - if attributes.key?(:'billable_weight') - self.billable_weight = attributes[:'billable_weight'] - end - - if attributes.key?(:'service_type') - self.service_type = attributes[:'service_type'] - end - - if attributes.key?(:'promise') - self.promise = attributes[:'promise'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @total_charge.nil? - invalid_properties.push('invalid value for "total_charge", total_charge cannot be nil.') - end - - if @billable_weight.nil? - invalid_properties.push('invalid value for "billable_weight", billable_weight cannot be nil.') - end - - if @service_type.nil? - invalid_properties.push('invalid value for "service_type", service_type cannot be nil.') - end - - if @promise.nil? - invalid_properties.push('invalid value for "promise", promise cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @total_charge.nil? - return false if @billable_weight.nil? - return false if @service_type.nil? - return false if @promise.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_charge == o.total_charge && - billable_weight == o.billable_weight && - service_type == o.service_type && - promise == o.promise - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_charge, billable_weight, service_type, promise].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/service_rate_list.rb b/vendor/shipping/lib/sp_shipping/models/service_rate_list.rb deleted file mode 100644 index 0f10493..0000000 --- a/vendor/shipping/lib/sp_shipping/models/service_rate_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of service rates. - class ServiceRateList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ServiceRateList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ServiceRateList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/service_type.rb b/vendor/shipping/lib/sp_shipping/models/service_type.rb deleted file mode 100644 index 2558e74..0000000 --- a/vendor/shipping/lib/sp_shipping/models/service_type.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - class ServiceType - GROUND = 'Amazon Shipping Ground'.freeze - STANDARD = 'Amazon Shipping Standard'.freeze - PREMIUM = 'Amazon Shipping Premium'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ServiceType.constants.select { |c| ServiceType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ServiceType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/service_type_list.rb b/vendor/shipping/lib/sp_shipping/models/service_type_list.rb deleted file mode 100644 index 958e7cd..0000000 --- a/vendor/shipping/lib/sp_shipping/models/service_type_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # A list of service types that can be used to send the shipment. - class ServiceTypeList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ServiceTypeList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ServiceTypeList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/shipment.rb b/vendor/shipping/lib/sp_shipping/models/shipment.rb deleted file mode 100644 index 85e9843..0000000 --- a/vendor/shipping/lib/sp_shipping/models/shipment.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The shipment related data. - class Shipment - attr_accessor :shipment_id - - attr_accessor :client_reference_id - - attr_accessor :ship_from - - attr_accessor :ship_to - - attr_accessor :accepted_rate - - attr_accessor :shipper - - attr_accessor :containers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_id' => :'shipmentId', - :'client_reference_id' => :'clientReferenceId', - :'ship_from' => :'shipFrom', - :'ship_to' => :'shipTo', - :'accepted_rate' => :'acceptedRate', - :'shipper' => :'shipper', - :'containers' => :'containers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_id' => :'Object', - :'client_reference_id' => :'Object', - :'ship_from' => :'Object', - :'ship_to' => :'Object', - :'accepted_rate' => :'Object', - :'shipper' => :'Object', - :'containers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Shipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Shipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_id') - self.shipment_id = attributes[:'shipment_id'] - end - - if attributes.key?(:'client_reference_id') - self.client_reference_id = attributes[:'client_reference_id'] - end - - if attributes.key?(:'ship_from') - self.ship_from = attributes[:'ship_from'] - end - - if attributes.key?(:'ship_to') - self.ship_to = attributes[:'ship_to'] - end - - if attributes.key?(:'accepted_rate') - self.accepted_rate = attributes[:'accepted_rate'] - end - - if attributes.key?(:'shipper') - self.shipper = attributes[:'shipper'] - end - - if attributes.key?(:'containers') - self.containers = attributes[:'containers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_id.nil? - invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') - end - - if @client_reference_id.nil? - invalid_properties.push('invalid value for "client_reference_id", client_reference_id cannot be nil.') - end - - if @ship_from.nil? - invalid_properties.push('invalid value for "ship_from", ship_from cannot be nil.') - end - - if @ship_to.nil? - invalid_properties.push('invalid value for "ship_to", ship_to cannot be nil.') - end - - if @containers.nil? - invalid_properties.push('invalid value for "containers", containers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_id.nil? - return false if @client_reference_id.nil? - return false if @ship_from.nil? - return false if @ship_to.nil? - return false if @containers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_id == o.shipment_id && - client_reference_id == o.client_reference_id && - ship_from == o.ship_from && - ship_to == o.ship_to && - accepted_rate == o.accepted_rate && - shipper == o.shipper && - containers == o.containers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_id, client_reference_id, ship_from, ship_to, accepted_rate, shipper, containers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/shipment_id.rb b/vendor/shipping/lib/sp_shipping/models/shipment_id.rb deleted file mode 100644 index 230a667..0000000 --- a/vendor/shipping/lib/sp_shipping/models/shipment_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The unique shipment identifier. - class ShipmentId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ShipmentId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ShipmentId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/shipping_promise_set.rb b/vendor/shipping/lib/sp_shipping/models/shipping_promise_set.rb deleted file mode 100644 index c47a7b9..0000000 --- a/vendor/shipping/lib/sp_shipping/models/shipping_promise_set.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The promised delivery time and pickup time. - class ShippingPromiseSet - attr_accessor :delivery_window - - attr_accessor :receive_window - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_window' => :'deliveryWindow', - :'receive_window' => :'receiveWindow' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_window' => :'Object', - :'receive_window' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::ShippingPromiseSet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::ShippingPromiseSet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_window') - self.delivery_window = attributes[:'delivery_window'] - end - - if attributes.key?(:'receive_window') - self.receive_window = attributes[:'receive_window'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_window == o.delivery_window && - receive_window == o.receive_window - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_window, receive_window].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/state_or_region.rb b/vendor/shipping/lib/sp_shipping/models/state_or_region.rb deleted file mode 100644 index a2e1c6d..0000000 --- a/vendor/shipping/lib/sp_shipping/models/state_or_region.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The state or region where the person, business or institution is located. - class StateOrRegion - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::StateOrRegion` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::StateOrRegion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/time_range.rb b/vendor/shipping/lib/sp_shipping/models/time_range.rb deleted file mode 100644 index 7d1d25e..0000000 --- a/vendor/shipping/lib/sp_shipping/models/time_range.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The time range. - class TimeRange - # The start date and time. This defaults to the current date and time. - attr_accessor :start - - # The end date and time. This must come after the value of start. This defaults to the next business day from the start. - attr_accessor :_end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start' => :'start', - :'_end' => :'end' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start' => :'Object', - :'_end' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::TimeRange` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::TimeRange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start') - self.start = attributes[:'start'] - end - - if attributes.key?(:'_end') - self._end = attributes[:'_end'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start == o.start && - _end == o._end - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start, _end].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/tracking_id.rb b/vendor/shipping/lib/sp_shipping/models/tracking_id.rb deleted file mode 100644 index acae204..0000000 --- a/vendor/shipping/lib/sp_shipping/models/tracking_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The tracking id generated to each shipment. It contains a series of letters or digits or both. - class TrackingId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::TrackingId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::TrackingId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/tracking_information.rb b/vendor/shipping/lib/sp_shipping/models/tracking_information.rb deleted file mode 100644 index e877f9c..0000000 --- a/vendor/shipping/lib/sp_shipping/models/tracking_information.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The payload schema for the getTrackingInformation operation. - class TrackingInformation - attr_accessor :tracking_id - - attr_accessor :summary - - attr_accessor :promised_delivery_date - - attr_accessor :event_history - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_id' => :'trackingId', - :'summary' => :'summary', - :'promised_delivery_date' => :'promisedDeliveryDate', - :'event_history' => :'eventHistory' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_id' => :'Object', - :'summary' => :'Object', - :'promised_delivery_date' => :'Object', - :'event_history' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::TrackingInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::TrackingInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_id') - self.tracking_id = attributes[:'tracking_id'] - end - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - - if attributes.key?(:'promised_delivery_date') - self.promised_delivery_date = attributes[:'promised_delivery_date'] - end - - if attributes.key?(:'event_history') - self.event_history = attributes[:'event_history'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tracking_id.nil? - invalid_properties.push('invalid value for "tracking_id", tracking_id cannot be nil.') - end - - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - if @promised_delivery_date.nil? - invalid_properties.push('invalid value for "promised_delivery_date", promised_delivery_date cannot be nil.') - end - - if @event_history.nil? - invalid_properties.push('invalid value for "event_history", event_history cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tracking_id.nil? - return false if @summary.nil? - return false if @promised_delivery_date.nil? - return false if @event_history.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_id == o.tracking_id && - summary == o.summary && - promised_delivery_date == o.promised_delivery_date && - event_history == o.event_history - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_id, summary, promised_delivery_date, event_history].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/tracking_summary.rb b/vendor/shipping/lib/sp_shipping/models/tracking_summary.rb deleted file mode 100644 index 980dc22..0000000 --- a/vendor/shipping/lib/sp_shipping/models/tracking_summary.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The tracking summary. - class TrackingSummary - # The derived status based on the events in the eventHistory. - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::TrackingSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::TrackingSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/models/weight.rb b/vendor/shipping/lib/sp_shipping/models/weight.rb deleted file mode 100644 index 8cb3ef5..0000000 --- a/vendor/shipping/lib/sp_shipping/models/weight.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpShipping - # The weight. - class Weight - # The unit of measurement. - attr_accessor :unit - - # The measurement value. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit' => :'unit', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpShipping::Weight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpShipping::Weight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit.nil? - unit_validator = EnumAttributeValidator.new('Object', ['g', 'kg', 'oz', 'lb']) - return false unless unit_validator.valid?(@unit) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('Object', ['g', 'kg', 'oz', 'lb']) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit == o.unit && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpShipping.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/shipping/lib/sp_shipping/version.rb b/vendor/shipping/lib/sp_shipping/version.rb deleted file mode 100644 index 3c09a0e..0000000 --- a/vendor/shipping/lib/sp_shipping/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpShipping - VERSION = '1.0.0' -end diff --git a/vendor/shipping/sp_shipping.gemspec b/vendor/shipping/sp_shipping.gemspec deleted file mode 100644 index f3c7565..0000000 --- a/vendor/shipping/sp_shipping.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Shipping - -#Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_shipping/version" - -Gem::Specification.new do |s| - s.name = "sp_shipping" - s.version = SpShipping::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Shipping Ruby Gem" - s.description = "Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of Amazon Shipping API (v2) on the Amazon Shipping Developer Documentation site." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/solicitations/.gitignore b/vendor/solicitations/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/solicitations/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/solicitations/.rspec b/vendor/solicitations/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/solicitations/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/solicitations/.rubocop.yml b/vendor/solicitations/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/solicitations/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/solicitations/.swagger-codegen-ignore b/vendor/solicitations/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/solicitations/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/solicitations/.swagger-codegen/VERSION b/vendor/solicitations/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/solicitations/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/solicitations/Gemfile b/vendor/solicitations/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/solicitations/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/solicitations/README.md b/vendor/solicitations/README.md deleted file mode 100644 index 7526ed7..0000000 --- a/vendor/solicitations/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# sp_solicitations - -SpSolicitations - the Ruby gem for the Selling Partner API for Solicitations - -With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_solicitations.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_solicitations-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_solicitations-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_solicitations', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_solicitations', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_solicitations' - -api_instance = SpSolicitations::SolicitationsApi.new -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a solicitation is sent. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - - -begin - result = api_instance.create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids) - p result -rescue SpSolicitations::ApiError => e - puts "Exception when calling SolicitationsApi->create_product_review_and_seller_feedback_solicitation: #{e}" -end - -api_instance = SpSolicitations::SolicitationsApi.new -amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which you want a list of available solicitation types. -marketplace_ids = ['marketplace_ids_example'] # Array | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - - -begin - result = api_instance.get_solicitation_actions_for_order(amazon_order_id, marketplace_ids) - p result -rescue SpSolicitations::ApiError => e - puts "Exception when calling SolicitationsApi->get_solicitation_actions_for_order: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpSolicitations::SolicitationsApi* | [**create_product_review_and_seller_feedback_solicitation**](docs/SolicitationsApi.md#create_product_review_and_seller_feedback_solicitation) | **POST** /solicitations/v1/orders/{amazonOrderId}/solicitations/productReviewAndSellerFeedback | -*SpSolicitations::SolicitationsApi* | [**get_solicitation_actions_for_order**](docs/SolicitationsApi.md#get_solicitation_actions_for_order) | **GET** /solicitations/v1/orders/{amazonOrderId} | - -## Documentation for Models - - - [SpSolicitations::CreateProductReviewAndSellerFeedbackSolicitationResponse](docs/CreateProductReviewAndSellerFeedbackSolicitationResponse.md) - - [SpSolicitations::Error](docs/Error.md) - - [SpSolicitations::ErrorList](docs/ErrorList.md) - - [SpSolicitations::GetSchemaResponse](docs/GetSchemaResponse.md) - - [SpSolicitations::GetSchemaResponseLinks](docs/GetSchemaResponseLinks.md) - - [SpSolicitations::GetSolicitationActionResponse](docs/GetSolicitationActionResponse.md) - - [SpSolicitations::GetSolicitationActionResponseEmbedded](docs/GetSolicitationActionResponseEmbedded.md) - - [SpSolicitations::GetSolicitationActionResponseLinks](docs/GetSolicitationActionResponseLinks.md) - - [SpSolicitations::GetSolicitationActionsForOrderResponse](docs/GetSolicitationActionsForOrderResponse.md) - - [SpSolicitations::GetSolicitationActionsForOrderResponseEmbedded](docs/GetSolicitationActionsForOrderResponseEmbedded.md) - - [SpSolicitations::GetSolicitationActionsForOrderResponseLinks](docs/GetSolicitationActionsForOrderResponseLinks.md) - - [SpSolicitations::LinkObject](docs/LinkObject.md) - - [SpSolicitations::Schema](docs/Schema.md) - - [SpSolicitations::SolicitationsAction](docs/SolicitationsAction.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/solicitations/Rakefile b/vendor/solicitations/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/solicitations/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/solicitations/git_push.sh b/vendor/solicitations/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/solicitations/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/solicitations/lib/sp_solicitations.rb b/vendor/solicitations/lib/sp_solicitations.rb deleted file mode 100644 index df9e063..0000000 --- a/vendor/solicitations/lib/sp_solicitations.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_solicitations/api_client' -# require 'sp_solicitations/api_error' -# require 'sp_solicitations/version' -# require 'sp_solicitations/configuration' - -# Models -# -# -# require_relative './sp_solicitations/models/create_product_review_and_seller_feedback_solicitation_response' -# -# -# require_relative './sp_solicitations/models/error' -# -# -# require_relative './sp_solicitations/models/error_list' -# -# -# require_relative './sp_solicitations/models/get_schema_response' -# -# -# require_relative './sp_solicitations/models/get_schema_response__links' -# -# -# require_relative './sp_solicitations/models/get_solicitation_action_response' -# -# -# require_relative './sp_solicitations/models/get_solicitation_action_response__embedded' -# -# -# require_relative './sp_solicitations/models/get_solicitation_action_response__links' -# -# -# require_relative './sp_solicitations/models/get_solicitation_actions_for_order_response' -# -# -# require_relative './sp_solicitations/models/get_solicitation_actions_for_order_response__embedded' -# -# -# require_relative './sp_solicitations/models/get_solicitation_actions_for_order_response__links' -# -# -# require_relative './sp_solicitations/models/link_object' -# -# -# require_relative './sp_solicitations/models/schema' -# -# -# require_relative './sp_solicitations/models/solicitations_action' -# - -# APIs -require_relative './sp_solicitations/api/solicitations_api' diff --git a/vendor/solicitations/lib/sp_solicitations/api/solicitations_api.rb b/vendor/solicitations/lib/sp_solicitations/api/solicitations_api.rb deleted file mode 100644 index 75c5b9f..0000000 --- a/vendor/solicitations/lib/sp_solicitations/api/solicitations_api.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSolicitations - class SolicitationsApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Sends a solicitation to a buyer asking for seller feedback and a product review for the specified order. Send only one productReviewAndSellerFeedback or free form proactive message per order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which a solicitation is sent. - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - # @param [Hash] opts the optional parameters - # @return [CreateProductReviewAndSellerFeedbackSolicitationResponse] - def create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids, opts = {}) - data = create_product_review_and_seller_feedback_solicitation_with_http_info(amazon_order_id, marketplace_ids, opts) - return data - end - - # Sends a solicitation to a buyer asking for seller feedback and a product review for the specified order. Send only one productReviewAndSellerFeedback or free form proactive message per order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which a solicitation is sent. - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - # @param [Hash] opts the optional parameters - # @return [Array<(CreateProductReviewAndSellerFeedbackSolicitationResponse)>] CreateProductReviewAndSellerFeedbackSolicitationResponse data, response status code and response headers - def create_product_review_and_seller_feedback_solicitation_with_http_info(amazon_order_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SolicitationsApi.create_product_review_and_seller_feedback_solicitation ...' - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling SolicitationsApi.create_product_review_and_seller_feedback_solicitation" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling SolicitationsApi.create_product_review_and_seller_feedback_solicitation" - end - # resource path - local_var_path = '/solicitations/v1/orders/{amazonOrderId}/solicitations/productReviewAndSellerFeedback'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SolicitationsApi#create_product_review_and_seller_feedback_solicitation\nData: #{data.inspect}" - end - return data - end - # Returns a list of solicitation types that are available for an order that you specify. A solicitation type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a solicitation. Currently only the productReviewAndSellerFeedbackSolicitation solicitation type is available. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which you want a list of available solicitation types. - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - # @param [Hash] opts the optional parameters - # @return [GetSolicitationActionsForOrderResponse] - def get_solicitation_actions_for_order(amazon_order_id, marketplace_ids, opts = {}) - data = get_solicitation_actions_for_order_with_http_info(amazon_order_id, marketplace_ids, opts) - return data - end - - # Returns a list of solicitation types that are available for an order that you specify. A solicitation type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a solicitation. Currently only the productReviewAndSellerFeedbackSolicitation solicitation type is available. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param amazon_order_id An Amazon order identifier. This specifies the order for which you want a list of available solicitation types. - # @param marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. - # @param [Hash] opts the optional parameters - # @return [Array<(GetSolicitationActionsForOrderResponse)>] GetSolicitationActionsForOrderResponse data, response status code and response headers - def get_solicitation_actions_for_order_with_http_info(amazon_order_id, marketplace_ids, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SolicitationsApi.get_solicitation_actions_for_order ...' - end - # verify the required parameter 'amazon_order_id' is set - if @api_client.config.client_side_validation && amazon_order_id.nil? - fail ArgumentError, "Missing the required parameter 'amazon_order_id' when calling SolicitationsApi.get_solicitation_actions_for_order" - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling SolicitationsApi.get_solicitation_actions_for_order" - end - # resource path - local_var_path = '/solicitations/v1/orders/{amazonOrderId}'.sub('{' + 'amazonOrderId' + '}', amazon_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/hal+json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SolicitationsApi#get_solicitation_actions_for_order\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/api_client.rb b/vendor/solicitations/lib/sp_solicitations/api_client.rb deleted file mode 100644 index e14c90a..0000000 --- a/vendor/solicitations/lib/sp_solicitations/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpSolicitations - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpSolicitations.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/api_error.rb b/vendor/solicitations/lib/sp_solicitations/api_error.rb deleted file mode 100644 index 7ff062c..0000000 --- a/vendor/solicitations/lib/sp_solicitations/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSolicitations - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/configuration.rb b/vendor/solicitations/lib/sp_solicitations/configuration.rb deleted file mode 100644 index 9c51cbd..0000000 --- a/vendor/solicitations/lib/sp_solicitations/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpSolicitations - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/create_product_review_and_seller_feedback_solicitation_response.rb b/vendor/solicitations/lib/sp_solicitations/models/create_product_review_and_seller_feedback_solicitation_response.rb deleted file mode 100644 index 888ee5a..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/create_product_review_and_seller_feedback_solicitation_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # The response schema for the createProductReviewAndSellerFeedbackSolicitation operation. - class CreateProductReviewAndSellerFeedbackSolicitationResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::CreateProductReviewAndSellerFeedbackSolicitationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::CreateProductReviewAndSellerFeedbackSolicitationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/error.rb b/vendor/solicitations/lib/sp_solicitations/models/error.rb deleted file mode 100644 index 967b63d..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/error_list.rb b/vendor/solicitations/lib/sp_solicitations/models/error_list.rb deleted file mode 100644 index 4100fda..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_schema_response.rb b/vendor/solicitations/lib/sp_solicitations/models/get_schema_response.rb deleted file mode 100644 index dc6151b..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_schema_response.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSchemaResponse - attr_accessor :_links - - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSchemaResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSchemaResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_schema_response__links.rb b/vendor/solicitations/lib/sp_solicitations/models/get_schema_response__links.rb deleted file mode 100644 index 74e85b5..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_schema_response__links.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSchemaResponseLinks - attr_accessor :_self - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSchemaResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSchemaResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response.rb deleted file mode 100644 index 233569c..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # Describes a solicitation action that can be taken for an order. Provides a JSON Hypertext Application Language (HAL) link to the JSON schema document that describes the expected input. - class GetSolicitationActionResponse - attr_accessor :_links - - attr_accessor :_embedded - - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'_embedded' => :'_embedded', - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'_embedded' => :'Object', - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'_embedded') - self._embedded = attributes[:'_embedded'] - end - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - _embedded == o._embedded && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, _embedded, payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__embedded.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__embedded.rb deleted file mode 100644 index 9a66b06..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__embedded.rb +++ /dev/null @@ -1,210 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSolicitationActionResponseEmbedded - attr_accessor :schema - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'schema' => :'schema' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'schema' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponseEmbedded` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponseEmbedded`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'schema') - self.schema = attributes[:'schema'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - schema == o.schema - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [schema].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__links.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__links.rb deleted file mode 100644 index ff49afb..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_action_response__links.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSolicitationActionResponseLinks - attr_accessor :_self - - attr_accessor :schema - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self', - :'schema' => :'schema' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object', - :'schema' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - - if attributes.key?(:'schema') - self.schema = attributes[:'schema'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - if @schema.nil? - invalid_properties.push('invalid value for "schema", schema cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - return false if @schema.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self && - schema == o.schema - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self, schema].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response.rb deleted file mode 100644 index 9c22ed4..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # The response schema for the getSolicitationActionsForOrder operation. - class GetSolicitationActionsForOrderResponse - attr_accessor :_links - - attr_accessor :_embedded - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_links' => :'_links', - :'_embedded' => :'_embedded', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_links' => :'Object', - :'_embedded' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_links') - self._links = attributes[:'_links'] - end - - if attributes.key?(:'_embedded') - self._embedded = attributes[:'_embedded'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _links == o._links && - _embedded == o._embedded && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_links, _embedded, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__embedded.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__embedded.rb deleted file mode 100644 index dca45de..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__embedded.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSolicitationActionsForOrderResponseEmbedded - attr_accessor :actions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'actions' => :'actions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'actions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponseEmbedded` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponseEmbedded`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'actions') - if (value = attributes[:'actions']).is_a?(Array) - self.actions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @actions.nil? - invalid_properties.push('invalid value for "actions", actions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @actions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - actions == o.actions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [actions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__links.rb b/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__links.rb deleted file mode 100644 index 159ae51..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/get_solicitation_actions_for_order_response__links.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - class GetSolicitationActionsForOrderResponseLinks - attr_accessor :_self - - # Eligible actions for the specified amazonOrderId. - attr_accessor :actions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self', - :'actions' => :'actions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'Object', - :'actions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponseLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::GetSolicitationActionsForOrderResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - - if attributes.key?(:'actions') - if (value = attributes[:'actions']).is_a?(Array) - self.actions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @_self.nil? - invalid_properties.push('invalid value for "_self", _self cannot be nil.') - end - - if @actions.nil? - invalid_properties.push('invalid value for "actions", actions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @_self.nil? - return false if @actions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self && - actions == o.actions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self, actions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/link_object.rb b/vendor/solicitations/lib/sp_solicitations/models/link_object.rb deleted file mode 100644 index 5a0bcfd..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/link_object.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # A Link object. - class LinkObject - # A URI for this object. - attr_accessor :href - - # An identifier for this object. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'href' => :'href', - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'href' => :'Object', - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::LinkObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::LinkObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'href') - self.href = attributes[:'href'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @href.nil? - invalid_properties.push('invalid value for "href", href cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @href.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - href == o.href && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [href, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/schema.rb b/vendor/solicitations/lib/sp_solicitations/models/schema.rb deleted file mode 100644 index f3447c4..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/schema.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # A JSON schema document describing the expected payload of the action. This object can be validated against http://json-schema.org/draft-04/schema. - class Schema - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::Schema` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::Schema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/models/solicitations_action.rb b/vendor/solicitations/lib/sp_solicitations/models/solicitations_action.rb deleted file mode 100644 index 5f8aa14..0000000 --- a/vendor/solicitations/lib/sp_solicitations/models/solicitations_action.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpSolicitations - # A simple object containing the name of the template. - class SolicitationsAction - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpSolicitations::SolicitationsAction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpSolicitations::SolicitationsAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpSolicitations.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/solicitations/lib/sp_solicitations/version.rb b/vendor/solicitations/lib/sp_solicitations/version.rb deleted file mode 100644 index 074389a..0000000 --- a/vendor/solicitations/lib/sp_solicitations/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpSolicitations - VERSION = '1.0.0' -end diff --git a/vendor/solicitations/sp_solicitations.gemspec b/vendor/solicitations/sp_solicitations.gemspec deleted file mode 100644 index 6e56bd0..0000000 --- a/vendor/solicitations/sp_solicitations.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Solicitations - -#With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_solicitations/version" - -Gem::Specification.new do |s| - s.name = "sp_solicitations" - s.version = SpSolicitations::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Solicitations Ruby Gem" - s.description = "With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/uploads_2020/.gitignore b/vendor/uploads_2020/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/uploads_2020/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/uploads_2020/.rspec b/vendor/uploads_2020/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/uploads_2020/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/uploads_2020/.rubocop.yml b/vendor/uploads_2020/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/uploads_2020/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/uploads_2020/.swagger-codegen-ignore b/vendor/uploads_2020/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/uploads_2020/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/uploads_2020/.swagger-codegen/VERSION b/vendor/uploads_2020/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/uploads_2020/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/uploads_2020/Gemfile b/vendor/uploads_2020/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/uploads_2020/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/uploads_2020/README.md b/vendor/uploads_2020/README.md deleted file mode 100644 index f82c343..0000000 --- a/vendor/uploads_2020/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# sp_uploads_2020 - -SpUploads2020 - the Ruby gem for the Selling Partner API for Uploads - -The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2020-11-01 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_uploads_2020.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_uploads_2020-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_uploads_2020-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_uploads_2020', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_uploads_2020', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_uploads_2020' - -api_instance = SpUploads2020::UploadsApi.new -marketplace_ids = ['marketplace_ids_example'] # Array | The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). -content_md5 = 'content_md5_example' # String | An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. -resource = 'resource_example' # String | The upload destination for your resource. For example, if you create an upload destination for the `createLegalDisclosure` operation of the Messaging API, the `{resource}` would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you create an upload destination for an Aplus content document, the `{resource}` would be `aplus/2020-11-01/contentDocuments` and the path would be `/uploads/2020-11-01/uploadDestinations/aplus/2020-11-01/contentDocuments`. -opts = { - content_type: 'content_type_example' # String | The content type of the file you upload. -} - -begin - result = api_instance.create_upload_destination_for_resource(marketplace_ids, content_md5, resource, opts) - p result -rescue SpUploads2020::ApiError => e - puts "Exception when calling UploadsApi->create_upload_destination_for_resource: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpUploads2020::UploadsApi* | [**create_upload_destination_for_resource**](docs/UploadsApi.md#create_upload_destination_for_resource) | **POST** /uploads/2020-11-01/uploadDestinations/{resource} | - -## Documentation for Models - - - [SpUploads2020::CreateUploadDestinationResponse](docs/CreateUploadDestinationResponse.md) - - [SpUploads2020::Error](docs/Error.md) - - [SpUploads2020::ErrorList](docs/ErrorList.md) - - [SpUploads2020::UploadDestination](docs/UploadDestination.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/uploads_2020/Rakefile b/vendor/uploads_2020/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/uploads_2020/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/uploads_2020/git_push.sh b/vendor/uploads_2020/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/uploads_2020/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/uploads_2020/lib/sp_uploads_2020.rb b/vendor/uploads_2020/lib/sp_uploads_2020.rb deleted file mode 100644 index 359aed0..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_uploads_2020/api_client' -# require 'sp_uploads_2020/api_error' -# require 'sp_uploads_2020/version' -# require 'sp_uploads_2020/configuration' - -# Models -# -# -# require_relative './sp_uploads_2020/models/create_upload_destination_response' -# -# -# require_relative './sp_uploads_2020/models/error' -# -# -# require_relative './sp_uploads_2020/models/error_list' -# -# -# require_relative './sp_uploads_2020/models/upload_destination' -# - -# APIs -require_relative './sp_uploads_2020/api/uploads_api' diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/api/uploads_api.rb b/vendor/uploads_2020/lib/sp_uploads_2020/api/uploads_api.rb deleted file mode 100644 index f386672..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/api/uploads_api.rb +++ /dev/null @@ -1,93 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpUploads2020 - class UploadsApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Creates an upload destination, returning the information required to upload a file to the destination and to programmatically access the file. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). - # @param content_md5 An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. - # @param resource The upload destination for your resource. For example, if you create an upload destination for the `createLegalDisclosure` operation of the Messaging API, the `{resource}` would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you create an upload destination for an Aplus content document, the `{resource}` would be `aplus/2020-11-01/contentDocuments` and the path would be `/uploads/2020-11-01/uploadDestinations/aplus/2020-11-01/contentDocuments`. - # @param [Hash] opts the optional parameters - # @option opts [String] :content_type The content type of the file you upload. - # @return [CreateUploadDestinationResponse] - def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, opts = {}) - data = create_upload_destination_for_resource_with_http_info(marketplace_ids, content_md5, resource, opts) - return data - end - - # Creates an upload destination, returning the information required to upload a file to the destination and to programmatically access the file. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param marketplace_ids The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). - # @param content_md5 An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. - # @param resource The upload destination for your resource. For example, if you create an upload destination for the `createLegalDisclosure` operation of the Messaging API, the `{resource}` would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you create an upload destination for an Aplus content document, the `{resource}` would be `aplus/2020-11-01/contentDocuments` and the path would be `/uploads/2020-11-01/uploadDestinations/aplus/2020-11-01/contentDocuments`. - # @param [Hash] opts the optional parameters - # @option opts [String] :content_type The content type of the file you upload. - # @return [Array<(CreateUploadDestinationResponse)>] CreateUploadDestinationResponse data, response status code and response headers - def create_upload_destination_for_resource_with_http_info(marketplace_ids, content_md5, resource, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: UploadsApi.create_upload_destination_for_resource ...' - end - # verify the required parameter 'marketplace_ids' is set - if @api_client.config.client_side_validation && marketplace_ids.nil? - fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling UploadsApi.create_upload_destination_for_resource" - end - # verify the required parameter 'content_md5' is set - if @api_client.config.client_side_validation && content_md5.nil? - fail ArgumentError, "Missing the required parameter 'content_md5' when calling UploadsApi.create_upload_destination_for_resource" - end - # verify the required parameter 'resource' is set - if @api_client.config.client_side_validation && resource.nil? - fail ArgumentError, "Missing the required parameter 'resource' when calling UploadsApi.create_upload_destination_for_resource" - end - # resource path - local_var_path = '/uploads/2020-11-01/uploadDestinations/{resource}'.sub('{' + 'resource' + '}', resource.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv) - query_params[:'contentMD5'] = content_md5 - query_params[:'contentType'] = opts[:'content_type'] if !opts[:'content_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: UploadsApi#create_upload_destination_for_resource\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/api_client.rb b/vendor/uploads_2020/lib/sp_uploads_2020/api_client.rb deleted file mode 100644 index 1478e78..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpUploads2020 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpUploads2020.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/api_error.rb b/vendor/uploads_2020/lib/sp_uploads_2020/api_error.rb deleted file mode 100644 index ad717c6..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpUploads2020 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/configuration.rb b/vendor/uploads_2020/lib/sp_uploads_2020/configuration.rb deleted file mode 100644 index 87f03c4..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpUploads2020 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/models/create_upload_destination_response.rb b/vendor/uploads_2020/lib/sp_uploads_2020/models/create_upload_destination_response.rb deleted file mode 100644 index 15f52da..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/models/create_upload_destination_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpUploads2020 - # The response schema for the createUploadDestination operation. - class CreateUploadDestinationResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpUploads2020::CreateUploadDestinationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpUploads2020::CreateUploadDestinationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpUploads2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/models/error.rb b/vendor/uploads_2020/lib/sp_uploads_2020/models/error.rb deleted file mode 100644 index 03a159f..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpUploads2020 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpUploads2020::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpUploads2020::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpUploads2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/models/error_list.rb b/vendor/uploads_2020/lib/sp_uploads_2020/models/error_list.rb deleted file mode 100644 index 572bb4f..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpUploads2020 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpUploads2020::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpUploads2020::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpUploads2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/models/upload_destination.rb b/vendor/uploads_2020/lib/sp_uploads_2020/models/upload_destination.rb deleted file mode 100644 index e0bc75b..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/models/upload_destination.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpUploads2020 - # Information about an upload destination. - class UploadDestination - # The unique identifier for the upload destination. - attr_accessor :upload_destination_id - - # The URL for the upload destination. - attr_accessor :url - - # The headers to include in the upload request. - attr_accessor :headers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'upload_destination_id' => :'uploadDestinationId', - :'url' => :'url', - :'headers' => :'headers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'upload_destination_id' => :'Object', - :'url' => :'Object', - :'headers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpUploads2020::UploadDestination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpUploads2020::UploadDestination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'upload_destination_id') - self.upload_destination_id = attributes[:'upload_destination_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'headers') - self.headers = attributes[:'headers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - upload_destination_id == o.upload_destination_id && - url == o.url && - headers == o.headers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [upload_destination_id, url, headers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpUploads2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/uploads_2020/lib/sp_uploads_2020/version.rb b/vendor/uploads_2020/lib/sp_uploads_2020/version.rb deleted file mode 100644 index 80f89be..0000000 --- a/vendor/uploads_2020/lib/sp_uploads_2020/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpUploads2020 - VERSION = '1.0.0' -end diff --git a/vendor/uploads_2020/sp_uploads_2020.gemspec b/vendor/uploads_2020/sp_uploads_2020.gemspec deleted file mode 100644 index 2faab6b..0000000 --- a/vendor/uploads_2020/sp_uploads_2020.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Uploads - -#The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API. - -OpenAPI spec version: 2020-11-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_uploads_2020/version" - -Gem::Specification.new do |s| - s.name = "sp_uploads_2020" - s.version = SpUploads2020::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Uploads Ruby Gem" - s.description = "The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vdf_payments_v1/.gitignore b/vendor/vdf_payments_v1/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vdf_payments_v1/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vdf_payments_v1/.rspec b/vendor/vdf_payments_v1/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vdf_payments_v1/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vdf_payments_v1/.rubocop.yml b/vendor/vdf_payments_v1/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vdf_payments_v1/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vdf_payments_v1/.swagger-codegen-ignore b/vendor/vdf_payments_v1/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vdf_payments_v1/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vdf_payments_v1/.swagger-codegen/VERSION b/vendor/vdf_payments_v1/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vdf_payments_v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vdf_payments_v1/Gemfile b/vendor/vdf_payments_v1/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vdf_payments_v1/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vdf_payments_v1/README.md b/vendor/vdf_payments_v1/README.md deleted file mode 100644 index f7d7834..0000000 --- a/vendor/vdf_payments_v1/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# sp_vdf_payments_v1 - -SpVdfPaymentsV1 - the Ruby gem for the Selling Partner API for Direct Fulfillment Payments - -The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vdf_payments_v1.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vdf_payments_v1-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vdf_payments_v1-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vdf_payments_v1', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vdf_payments_v1', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vdf_payments_v1' - -api_instance = SpVdfPaymentsV1::VendorInvoiceApi.new -body = SpVdfPaymentsV1::SubmitInvoiceRequest.new # SubmitInvoiceRequest | The request body containing one or more invoices for vendor orders. - - -begin - result = api_instance.submit_invoice(body) - p result -rescue SpVdfPaymentsV1::ApiError => e - puts "Exception when calling VendorInvoiceApi->submit_invoice: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVdfPaymentsV1::VendorInvoiceApi* | [**submit_invoice**](docs/VendorInvoiceApi.md#submit_invoice) | **POST** /vendor/directFulfillment/payments/v1/invoices | - -## Documentation for Models - - - [SpVdfPaymentsV1::AdditionalDetails](docs/AdditionalDetails.md) - - [SpVdfPaymentsV1::Address](docs/Address.md) - - [SpVdfPaymentsV1::ChargeDetails](docs/ChargeDetails.md) - - [SpVdfPaymentsV1::Decimal](docs/Decimal.md) - - [SpVdfPaymentsV1::Error](docs/Error.md) - - [SpVdfPaymentsV1::ErrorList](docs/ErrorList.md) - - [SpVdfPaymentsV1::InvoiceDetail](docs/InvoiceDetail.md) - - [SpVdfPaymentsV1::InvoiceItem](docs/InvoiceItem.md) - - [SpVdfPaymentsV1::ItemQuantity](docs/ItemQuantity.md) - - [SpVdfPaymentsV1::Money](docs/Money.md) - - [SpVdfPaymentsV1::PartyIdentification](docs/PartyIdentification.md) - - [SpVdfPaymentsV1::SubmitInvoiceRequest](docs/SubmitInvoiceRequest.md) - - [SpVdfPaymentsV1::SubmitInvoiceResponse](docs/SubmitInvoiceResponse.md) - - [SpVdfPaymentsV1::TaxDetail](docs/TaxDetail.md) - - [SpVdfPaymentsV1::TaxRegistrationDetail](docs/TaxRegistrationDetail.md) - - [SpVdfPaymentsV1::TransactionReference](docs/TransactionReference.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vdf_payments_v1/Rakefile b/vendor/vdf_payments_v1/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vdf_payments_v1/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vdf_payments_v1/git_push.sh b/vendor/vdf_payments_v1/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vdf_payments_v1/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1.rb deleted file mode 100644 index b3fb538..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1.rb +++ /dev/null @@ -1,70 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_vdf_payments_v1/api_client' -# require 'sp_vdf_payments_v1/api_error' -# require 'sp_vdf_payments_v1/version' -# require 'sp_vdf_payments_v1/configuration' - -# Models -# -# -# require_relative './sp_vdf_payments_v1/models/additional_details' -# -# -# require_relative './sp_vdf_payments_v1/models/address' -# -# -# require_relative './sp_vdf_payments_v1/models/charge_details' -# -# -# require_relative './sp_vdf_payments_v1/models/decimal' -# -# -# require_relative './sp_vdf_payments_v1/models/error' -# -# -# require_relative './sp_vdf_payments_v1/models/error_list' -# -# -# require_relative './sp_vdf_payments_v1/models/invoice_detail' -# -# -# require_relative './sp_vdf_payments_v1/models/invoice_item' -# -# -# require_relative './sp_vdf_payments_v1/models/item_quantity' -# -# -# require_relative './sp_vdf_payments_v1/models/money' -# -# -# require_relative './sp_vdf_payments_v1/models/party_identification' -# -# -# require_relative './sp_vdf_payments_v1/models/submit_invoice_request' -# -# -# require_relative './sp_vdf_payments_v1/models/submit_invoice_response' -# -# -# require_relative './sp_vdf_payments_v1/models/tax_detail' -# -# -# require_relative './sp_vdf_payments_v1/models/tax_registration_detail' -# -# -# require_relative './sp_vdf_payments_v1/models/transaction_reference' -# - -# APIs -require_relative './sp_vdf_payments_v1/api/vendor_invoice_api' diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api/vendor_invoice_api.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api/vendor_invoice_api.rb deleted file mode 100644 index a6f58d3..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api/vendor_invoice_api.rb +++ /dev/null @@ -1,78 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfPaymentsV1 - class VendorInvoiceApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Submits one or more invoices for a vendor's direct fulfillment orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request body containing one or more invoices for vendor orders. - # @param [Hash] opts the optional parameters - # @return [SubmitInvoiceResponse] - def submit_invoice(body, opts = {}) - data = submit_invoice_with_http_info(body, opts) - return data - end - - # Submits one or more invoices for a vendor's direct fulfillment orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body The request body containing one or more invoices for vendor orders. - # @param [Hash] opts the optional parameters - # @return [Array<(SubmitInvoiceResponse)>] SubmitInvoiceResponse data, response status code and response headers - def submit_invoice_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: VendorInvoiceApi.submit_invoice ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling VendorInvoiceApi.submit_invoice" - end - # resource path - local_var_path = '/vendor/directFulfillment/payments/v1/invoices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: VendorInvoiceApi#submit_invoice\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_client.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_client.rb deleted file mode 100644 index 70739dc..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVdfPaymentsV1 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVdfPaymentsV1.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_error.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_error.rb deleted file mode 100644 index 3b9a4bf..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfPaymentsV1 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/configuration.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/configuration.rb deleted file mode 100644 index 3e9771b..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfPaymentsV1 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/additional_details.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/additional_details.rb deleted file mode 100644 index adf9403..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/additional_details.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # A field where the selling party can provide additional information for tax-related or any other purposes. - class AdditionalDetails - # The type of the additional information provided by the selling party. - attr_accessor :type - - # The detail of the additional information provided by the selling party. - attr_accessor :detail - - # The language code of the additional information detail. - attr_accessor :language_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'detail' => :'detail', - :'language_code' => :'languageCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'detail' => :'Object', - :'language_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::AdditionalDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::AdditionalDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - - if attributes.key?(:'language_code') - self.language_code = attributes[:'language_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @detail.nil? - invalid_properties.push('invalid value for "detail", detail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['SUR', 'OCR']) - return false unless type_validator.valid?(@type) - return false if @detail.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['SUR', 'OCR']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - detail == o.detail && - language_code == o.language_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, detail, language_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/address.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/address.rb deleted file mode 100644 index 6f058be..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/address.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Address of the party. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of the address. - attr_accessor :address_line1 - - # Additional street address information, if required. - attr_accessor :address_line2 - - # Additional street address information, if required. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. - attr_accessor :city - - # The county where person, business or institution is located. - attr_accessor :county - - # The district where person, business or institution is located. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of that address. It conatins a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_code - - # The two digit country code in ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @state_or_region.nil? - invalid_properties.push('invalid value for "state_or_region", state_or_region cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @city.nil? - return false if @state_or_region.nil? - return false if @postal_code.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/charge_details.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/charge_details.rb deleted file mode 100644 index 9d8e208..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/charge_details.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Monetary and tax details of the charge. - class ChargeDetails - # Type of charge applied. - attr_accessor :type - - attr_accessor :charge_amount - - # Individual tax details per line item. - attr_accessor :tax_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'charge_amount' => :'chargeAmount', - :'tax_details' => :'taxDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'charge_amount' => :'Object', - :'tax_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::ChargeDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::ChargeDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'charge_amount') - self.charge_amount = attributes[:'charge_amount'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @charge_amount.nil? - invalid_properties.push('invalid value for "charge_amount", charge_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['GIFTWRAP', 'FULFILLMENT', 'MARKETINGINSERT', 'PACKAGING', 'LOADING', 'FREIGHTOUT', 'TAX_COLLECTED_AT_SOURCE']) - return false unless type_validator.valid?(@type) - return false if @charge_amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['GIFTWRAP', 'FULFILLMENT', 'MARKETINGINSERT', 'PACKAGING', 'LOADING', 'FREIGHTOUT', 'TAX_COLLECTED_AT_SOURCE']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - charge_amount == o.charge_amount && - tax_details == o.tax_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, charge_amount, tax_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/decimal.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/decimal.rb deleted file mode 100644 index 9db5fbc..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error.rb deleted file mode 100644 index 13f81ca..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error_list.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error_list.rb deleted file mode 100644 index 2dfa3a6..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_detail.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_detail.rb deleted file mode 100644 index e7edf3a..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_detail.rb +++ /dev/null @@ -1,366 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Represents the details of an invoice, including invoice number, date, parties involved, payment terms, totals, taxes, charges, and line items. - class InvoiceDetail - # The unique invoice number. - attr_accessor :invoice_number - - # Invoice date. - attr_accessor :invoice_date - - # An additional unique reference number used for regulatory or other purposes. - attr_accessor :reference_number - - attr_accessor :remit_to_party - - attr_accessor :ship_from_party - - attr_accessor :bill_to_party - - # Ship-to country code. - attr_accessor :ship_to_country_code - - # The payment terms for the invoice. - attr_accessor :payment_terms_code - - attr_accessor :invoice_total - - # Individual tax details per line item. - attr_accessor :tax_totals - - # Additional details provided by the selling party, for tax-related or other purposes. - attr_accessor :additional_details - - # Total charge amount details for all line items. - attr_accessor :charge_details - - # Provides the details of the items in this invoice. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoice_number' => :'invoiceNumber', - :'invoice_date' => :'invoiceDate', - :'reference_number' => :'referenceNumber', - :'remit_to_party' => :'remitToParty', - :'ship_from_party' => :'shipFromParty', - :'bill_to_party' => :'billToParty', - :'ship_to_country_code' => :'shipToCountryCode', - :'payment_terms_code' => :'paymentTermsCode', - :'invoice_total' => :'invoiceTotal', - :'tax_totals' => :'taxTotals', - :'additional_details' => :'additionalDetails', - :'charge_details' => :'chargeDetails', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoice_number' => :'Object', - :'invoice_date' => :'Object', - :'reference_number' => :'Object', - :'remit_to_party' => :'Object', - :'ship_from_party' => :'Object', - :'bill_to_party' => :'Object', - :'ship_to_country_code' => :'Object', - :'payment_terms_code' => :'Object', - :'invoice_total' => :'Object', - :'tax_totals' => :'Object', - :'additional_details' => :'Object', - :'charge_details' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::InvoiceDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::InvoiceDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoice_number') - self.invoice_number = attributes[:'invoice_number'] - end - - if attributes.key?(:'invoice_date') - self.invoice_date = attributes[:'invoice_date'] - end - - if attributes.key?(:'reference_number') - self.reference_number = attributes[:'reference_number'] - end - - if attributes.key?(:'remit_to_party') - self.remit_to_party = attributes[:'remit_to_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'bill_to_party') - self.bill_to_party = attributes[:'bill_to_party'] - end - - if attributes.key?(:'ship_to_country_code') - self.ship_to_country_code = attributes[:'ship_to_country_code'] - end - - if attributes.key?(:'payment_terms_code') - self.payment_terms_code = attributes[:'payment_terms_code'] - end - - if attributes.key?(:'invoice_total') - self.invoice_total = attributes[:'invoice_total'] - end - - if attributes.key?(:'tax_totals') - if (value = attributes[:'tax_totals']).is_a?(Array) - self.tax_totals = value - end - end - - if attributes.key?(:'additional_details') - if (value = attributes[:'additional_details']).is_a?(Array) - self.additional_details = value - end - end - - if attributes.key?(:'charge_details') - if (value = attributes[:'charge_details']).is_a?(Array) - self.charge_details = value - end - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @invoice_number.nil? - invalid_properties.push('invalid value for "invoice_number", invoice_number cannot be nil.') - end - - if @invoice_date.nil? - invalid_properties.push('invalid value for "invoice_date", invoice_date cannot be nil.') - end - - if @remit_to_party.nil? - invalid_properties.push('invalid value for "remit_to_party", remit_to_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @invoice_total.nil? - invalid_properties.push('invalid value for "invoice_total", invoice_total cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @invoice_number.nil? - return false if @invoice_date.nil? - return false if @remit_to_party.nil? - return false if @ship_from_party.nil? - return false if @invoice_total.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoice_number == o.invoice_number && - invoice_date == o.invoice_date && - reference_number == o.reference_number && - remit_to_party == o.remit_to_party && - ship_from_party == o.ship_from_party && - bill_to_party == o.bill_to_party && - ship_to_country_code == o.ship_to_country_code && - payment_terms_code == o.payment_terms_code && - invoice_total == o.invoice_total && - tax_totals == o.tax_totals && - additional_details == o.additional_details && - charge_details == o.charge_details && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoice_number, invoice_date, reference_number, remit_to_party, ship_from_party, bill_to_party, ship_to_country_code, payment_terms_code, invoice_total, tax_totals, additional_details, charge_details, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_item.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_item.rb deleted file mode 100644 index 6318646..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/invoice_item.rb +++ /dev/null @@ -1,324 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Provides the details of the items in this invoice. - class InvoiceItem - # Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on. - attr_accessor :item_sequence_number - - # Buyer's standard identification number (ASIN) of an item. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. - attr_accessor :vendor_product_identifier - - attr_accessor :invoiced_quantity - - attr_accessor :net_cost - - # The purchase order number for this order. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - # The vendor's order number for this order. - attr_accessor :vendor_order_number - - # Harmonized System of Nomenclature (HSN) tax code. The HSN number cannot contain alphabets. - attr_accessor :hsn_code - - # Individual tax details per line item. - attr_accessor :tax_details - - # Individual charge details per line item. - attr_accessor :charge_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'invoiced_quantity' => :'invoicedQuantity', - :'net_cost' => :'netCost', - :'purchase_order_number' => :'purchaseOrderNumber', - :'vendor_order_number' => :'vendorOrderNumber', - :'hsn_code' => :'hsnCode', - :'tax_details' => :'taxDetails', - :'charge_details' => :'chargeDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'invoiced_quantity' => :'Object', - :'net_cost' => :'Object', - :'purchase_order_number' => :'Object', - :'vendor_order_number' => :'Object', - :'hsn_code' => :'Object', - :'tax_details' => :'Object', - :'charge_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::InvoiceItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::InvoiceItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'invoiced_quantity') - self.invoiced_quantity = attributes[:'invoiced_quantity'] - end - - if attributes.key?(:'net_cost') - self.net_cost = attributes[:'net_cost'] - end - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'vendor_order_number') - self.vendor_order_number = attributes[:'vendor_order_number'] - end - - if attributes.key?(:'hsn_code') - self.hsn_code = attributes[:'hsn_code'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - - if attributes.key?(:'charge_details') - if (value = attributes[:'charge_details']).is_a?(Array) - self.charge_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @invoiced_quantity.nil? - invalid_properties.push('invalid value for "invoiced_quantity", invoiced_quantity cannot be nil.') - end - - if @net_cost.nil? - invalid_properties.push('invalid value for "net_cost", net_cost cannot be nil.') - end - - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @invoiced_quantity.nil? - return false if @net_cost.nil? - return false if @purchase_order_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - invoiced_quantity == o.invoiced_quantity && - net_cost == o.net_cost && - purchase_order_number == o.purchase_order_number && - vendor_order_number == o.vendor_order_number && - hsn_code == o.hsn_code && - tax_details == o.tax_details && - charge_details == o.charge_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, invoiced_quantity, net_cost, purchase_order_number, vendor_order_number, hsn_code, tax_details, charge_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/item_quantity.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/item_quantity.rb deleted file mode 100644 index 6da618c..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/item_quantity.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Details of item quantity. - class ItemQuantity - # Quantity of units available for a specific item. - attr_accessor :amount - - # Unit of measure for the available quantity. - attr_accessor :unit_of_measure - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @unit_of_measure.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/money.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/money.rb deleted file mode 100644 index 808d657..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/money.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # An amount of money, including units in the form of currency. - class Money - # Three digit currency code in ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/party_identification.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/party_identification.rb deleted file mode 100644 index e274b5d..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/party_identification.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Name, address and tax details of a party. - class PartyIdentification - # Assigned Identification for the party. - attr_accessor :party_id - - attr_accessor :address - - # Tax registration details of the entity. - attr_accessor :tax_registration_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId', - :'address' => :'address', - :'tax_registration_details' => :'taxRegistrationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object', - :'address' => :'Object', - :'tax_registration_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_registration_details') - if (value = attributes[:'tax_registration_details']).is_a?(Array) - self.tax_registration_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id && - address == o.address && - tax_registration_details == o.tax_registration_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id, address, tax_registration_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_request.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_request.rb deleted file mode 100644 index 6d17227..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # The request schema for the submitInvoice operation. - class SubmitInvoiceRequest - # An array of invoice details to be submitted. - attr_accessor :invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoices' => :'invoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoices' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::SubmitInvoiceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::SubmitInvoiceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoices') - if (value = attributes[:'invoices']).is_a?(Array) - self.invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoices == o.invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_response.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_response.rb deleted file mode 100644 index 27c2b25..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/submit_invoice_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # The response schema for the submitInvoice operation. - class SubmitInvoiceResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::SubmitInvoiceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::SubmitInvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_detail.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_detail.rb deleted file mode 100644 index a63d8d7..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_detail.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Details of tax amount applied. - class TaxDetail - # Type of the tax applied. - attr_accessor :tax_type - - attr_accessor :tax_rate - - attr_accessor :tax_amount - - attr_accessor :taxable_amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_type' => :'taxType', - :'tax_rate' => :'taxRate', - :'tax_amount' => :'taxAmount', - :'taxable_amount' => :'taxableAmount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_type' => :'Object', - :'tax_rate' => :'Object', - :'tax_amount' => :'Object', - :'taxable_amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::TaxDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::TaxDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tax_rate') - self.tax_rate = attributes[:'tax_rate'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'taxable_amount') - self.taxable_amount = attributes[:'taxable_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_type.nil? - invalid_properties.push('invalid value for "tax_type", tax_type cannot be nil.') - end - - if @tax_amount.nil? - invalid_properties.push('invalid value for "tax_amount", tax_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_type.nil? - tax_type_validator = EnumAttributeValidator.new('Object', ['CGST', 'SGST', 'CESS', 'UTGST', 'IGST', 'MwSt.', 'PST', 'TVA', 'VAT', 'GST', 'ST', 'Consumption', 'MutuallyDefined', 'DomesticVAT']) - return false unless tax_type_validator.valid?(@tax_type) - return false if @tax_amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_type Object to be assigned - def tax_type=(tax_type) - validator = EnumAttributeValidator.new('Object', ['CGST', 'SGST', 'CESS', 'UTGST', 'IGST', 'MwSt.', 'PST', 'TVA', 'VAT', 'GST', 'ST', 'Consumption', 'MutuallyDefined', 'DomesticVAT']) - unless validator.valid?(tax_type) - fail ArgumentError, "invalid value for \"tax_type\", must be one of #{validator.allowable_values}." - end - @tax_type = tax_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_type == o.tax_type && - tax_rate == o.tax_rate && - tax_amount == o.tax_amount && - taxable_amount == o.taxable_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_type, tax_rate, tax_amount, taxable_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_registration_detail.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_registration_detail.rb deleted file mode 100644 index 6a4d8c2..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/tax_registration_detail.rb +++ /dev/null @@ -1,280 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Tax registration details of the entity. - class TaxRegistrationDetail - # Tax registration type for the entity. - attr_accessor :tax_registration_type - - # Tax registration number for the entity. For example, VAT ID, Consumption Tax ID. - attr_accessor :tax_registration_number - - attr_accessor :tax_registration_address - - # Tax registration message that can be used for additional tax related details. - attr_accessor :tax_registration_message - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber', - :'tax_registration_address' => :'taxRegistrationAddress', - :'tax_registration_message' => :'taxRegistrationMessage' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object', - :'tax_registration_address' => :'Object', - :'tax_registration_message' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::TaxRegistrationDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::TaxRegistrationDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - - if attributes.key?(:'tax_registration_address') - self.tax_registration_address = attributes[:'tax_registration_address'] - end - - if attributes.key?(:'tax_registration_message') - self.tax_registration_message = attributes[:'tax_registration_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number && - tax_registration_address == o.tax_registration_address && - tax_registration_message == o.tax_registration_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number, tax_registration_address, tax_registration_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/transaction_reference.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/transaction_reference.rb deleted file mode 100644 index 06b2cd3..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/models/transaction_reference.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfPaymentsV1 - # Response containing the transaction ID. - class TransactionReference - # GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfPaymentsV1::TransactionReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfPaymentsV1::TransactionReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfPaymentsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/version.rb b/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/version.rb deleted file mode 100644 index 8f97d20..0000000 --- a/vendor/vdf_payments_v1/lib/sp_vdf_payments_v1/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVdfPaymentsV1 - VERSION = '1.0.0' -end diff --git a/vendor/vdf_payments_v1/sp_vdf_payments_v1.gemspec b/vendor/vdf_payments_v1/sp_vdf_payments_v1.gemspec deleted file mode 100644 index c631900..0000000 --- a/vendor/vdf_payments_v1/sp_vdf_payments_v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Direct Fulfillment Payments - -#The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vdf_payments_v1/version" - -Gem::Specification.new do |s| - s.name = "sp_vdf_payments_v1" - s.version = SpVdfPaymentsV1::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Direct Fulfillment Payments Ruby Gem" - s.description = "The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vdf_transactions_v1/.gitignore b/vendor/vdf_transactions_v1/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vdf_transactions_v1/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vdf_transactions_v1/.rspec b/vendor/vdf_transactions_v1/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vdf_transactions_v1/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vdf_transactions_v1/.rubocop.yml b/vendor/vdf_transactions_v1/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vdf_transactions_v1/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vdf_transactions_v1/.swagger-codegen-ignore b/vendor/vdf_transactions_v1/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vdf_transactions_v1/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vdf_transactions_v1/.swagger-codegen/VERSION b/vendor/vdf_transactions_v1/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vdf_transactions_v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vdf_transactions_v1/Gemfile b/vendor/vdf_transactions_v1/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vdf_transactions_v1/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vdf_transactions_v1/README.md b/vendor/vdf_transactions_v1/README.md deleted file mode 100644 index c770ce8..0000000 --- a/vendor/vdf_transactions_v1/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# sp_vdf_transactions_v1 - -SpVdfTransactionsV1 - the Ruby gem for the Selling Partner API for Direct Fulfillment Transaction Status - -The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vdf_transactions_v1.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vdf_transactions_v1-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vdf_transactions_v1-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vdf_transactions_v1', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vdf_transactions_v1', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vdf_transactions_v1' - -api_instance = SpVdfTransactionsV1::VendorTransactionApi.new -transaction_id = 'transaction_id_example' # String | Previously returned in the response to the POST request of a specific transaction. - - -begin - result = api_instance.get_transaction_status(transaction_id) - p result -rescue SpVdfTransactionsV1::ApiError => e - puts "Exception when calling VendorTransactionApi->get_transaction_status: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVdfTransactionsV1::VendorTransactionApi* | [**get_transaction_status**](docs/VendorTransactionApi.md#get_transaction_status) | **GET** /vendor/directFulfillment/transactions/v1/transactions/{transactionId} | - -## Documentation for Models - - - [SpVdfTransactionsV1::Error](docs/Error.md) - - [SpVdfTransactionsV1::ErrorList](docs/ErrorList.md) - - [SpVdfTransactionsV1::GetTransactionResponse](docs/GetTransactionResponse.md) - - [SpVdfTransactionsV1::Transaction](docs/Transaction.md) - - [SpVdfTransactionsV1::TransactionStatus](docs/TransactionStatus.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vdf_transactions_v1/Rakefile b/vendor/vdf_transactions_v1/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vdf_transactions_v1/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vdf_transactions_v1/git_push.sh b/vendor/vdf_transactions_v1/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vdf_transactions_v1/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1.rb deleted file mode 100644 index 069ef97..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -# # Common files -# require 'sp_vdf_transactions_v1/api_client' -# require 'sp_vdf_transactions_v1/api_error' -# require 'sp_vdf_transactions_v1/version' -# require 'sp_vdf_transactions_v1/configuration' - -# Models -# -# -# require_relative './sp_vdf_transactions_v1/models/error' -# -# -# require_relative './sp_vdf_transactions_v1/models/error_list' -# -# -# require_relative './sp_vdf_transactions_v1/models/get_transaction_response' -# -# -# require_relative './sp_vdf_transactions_v1/models/transaction' -# -# -# require_relative './sp_vdf_transactions_v1/models/transaction_status' -# - -# APIs -require_relative './sp_vdf_transactions_v1/api/vendor_transaction_api' diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api/vendor_transaction_api.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api/vendor_transaction_api.rb deleted file mode 100644 index 7d896e1..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api/vendor_transaction_api.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfTransactionsV1 - class VendorTransactionApi - attr_accessor :api_client - - def initialize(session) - @api_client = AmazonSpClients::ApiClient.new(session) - end - # Returns the status of the transaction indicated by the specified transactionId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param transaction_id Previously returned in the response to the POST request of a specific transaction. - # @param [Hash] opts the optional parameters - # @return [GetTransactionResponse] - def get_transaction_status(transaction_id, opts = {}) - data = get_transaction_status_with_http_info(transaction_id, opts) - return data - end - - # Returns the status of the transaction indicated by the specified transactionId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param transaction_id Previously returned in the response to the POST request of a specific transaction. - # @param [Hash] opts the optional parameters - # @return [Array<(GetTransactionResponse)>] GetTransactionResponse data, response status code and response headers - def get_transaction_status_with_http_info(transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: VendorTransactionApi.get_transaction_status ...' - end - # verify the required parameter 'transaction_id' is set - if @api_client.config.client_side_validation && transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'transaction_id' when calling VendorTransactionApi.get_transaction_status" - end - # resource path - local_var_path = '/vendor/directFulfillment/transactions/v1/transactions/{transactionId}'.sub('{' + 'transactionId' + '}', transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse' - - auth_names = opts[:auth_names] || [] - data = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type) - - if @api_client.config.debugging - @api_client.config.logger.debug "API called: VendorTransactionApi#get_transaction_status\nData: #{data.inspect}" - end - return data - end - end - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_client.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_client.rb deleted file mode 100644 index 5b5253c..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVdfTransactionsV1 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVdfTransactionsV1.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_error.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_error.rb deleted file mode 100644 index 33f4a94..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfTransactionsV1 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/configuration.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/configuration.rb deleted file mode 100644 index 1d56438..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfTransactionsV1 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error.rb deleted file mode 100644 index 6555a5b..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfTransactionsV1 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfTransactionsV1::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfTransactionsV1::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfTransactionsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error_list.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error_list.rb deleted file mode 100644 index 258c5e2..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfTransactionsV1 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfTransactionsV1::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfTransactionsV1::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfTransactionsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/get_transaction_response.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/get_transaction_response.rb deleted file mode 100644 index fd6fe11..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/get_transaction_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfTransactionsV1 - # The response schema for the getTransactionStatus operation. - class GetTransactionResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfTransactionsV1::GetTransactionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfTransactionsV1::GetTransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfTransactionsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction.rb deleted file mode 100644 index eec0d4a..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfTransactionsV1 - # The transaction status details. - class Transaction - # The unique identifier sent in the 'transactionId' field in response to the post request of a specific transaction. - attr_accessor :transaction_id - - # Current processing status of the transaction. - attr_accessor :status - - attr_accessor :errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId', - :'status' => :'status', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object', - :'status' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfTransactionsV1::Transaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfTransactionsV1::Transaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @status.nil? - status_validator = EnumAttributeValidator.new('Object', ['Failure', 'Processing', 'Success']) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('Object', ['Failure', 'Processing', 'Success']) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id && - status == o.status && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id, status, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfTransactionsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction_status.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction_status.rb deleted file mode 100644 index 2714012..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/models/transaction_status.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfTransactionsV1 - # The payload for the getTransactionStatus operation. - class TransactionStatus - attr_accessor :transaction_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_status' => :'transactionStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfTransactionsV1::TransactionStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfTransactionsV1::TransactionStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_status') - self.transaction_status = attributes[:'transaction_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_status == o.transaction_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfTransactionsV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/version.rb b/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/version.rb deleted file mode 100644 index e23051c..0000000 --- a/vendor/vdf_transactions_v1/lib/sp_vdf_transactions_v1/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVdfTransactionsV1 - VERSION = '1.0.0' -end diff --git a/vendor/vdf_transactions_v1/sp_vdf_transactions_v1.gemspec b/vendor/vdf_transactions_v1/sp_vdf_transactions_v1.gemspec deleted file mode 100644 index e117bee..0000000 --- a/vendor/vdf_transactions_v1/sp_vdf_transactions_v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Direct Fulfillment Transaction Status - -#The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vdf_transactions_v1/version" - -Gem::Specification.new do |s| - s.name = "sp_vdf_transactions_v1" - s.version = SpVdfTransactionsV1::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Direct Fulfillment Transaction Status Ruby Gem" - s.description = "The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct fulfillment vendor's transaction status." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end From a4271a6dc931db3f69a1ccd7a77fcdd1b0d5d418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:54:23 +0200 Subject: [PATCH 13/83] Delete generated scaffolding from vendor modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old swagger-codegen emitted a full standalone gem per module. Only the entry file and the API classes were ever loaded; the new generator emits exactly those. Delete the rest: models/ (1,037 files with zero requires), per-vendor api_client/configuration/api_error/ version (62 of them require the undeclared typhoeus gem), and the gem scaffolding (README, Rakefile, Gemfile, gemspec, git_push.sh, .rspec, .rubocop.yml, .gitignore, .swagger-codegen*). Each vendor module now holds only lib/sp_.rb and lib/sp_/api/*.rb — what `rake generate` writes. --- vendor/fba_inventory/.gitignore | 39 - vendor/fba_inventory/.rspec | 2 - vendor/fba_inventory/.rubocop.yml | 154 ---- vendor/fba_inventory/.swagger-codegen-ignore | 23 - vendor/fba_inventory/.swagger-codegen/VERSION | 1 - vendor/fba_inventory/Gemfile | 9 - vendor/fba_inventory/README.md | 150 ---- vendor/fba_inventory/Rakefile | 8 - vendor/fba_inventory/git_push.sh | 55 -- .../lib/sp_fba_inventory/api_client.rb | 389 --------- .../lib/sp_fba_inventory/api_error.rb | 59 -- .../lib/sp_fba_inventory/configuration.rb | 200 ----- .../models/add_inventory_request.rb | 211 ----- .../models/add_inventory_response.rb | 211 ----- .../models/create_inventory_item_request.rb | 247 ------ .../models/create_inventory_item_response.rb | 211 ----- .../models/delete_inventory_item_response.rb | 211 ----- .../lib/sp_fba_inventory/models/error.rb | 237 ------ .../lib/sp_fba_inventory/models/error_list.rb | 206 ----- .../get_inventory_summaries_response.rb | 229 ------ .../models/get_inventory_summaries_result.rb | 230 ------ .../sp_fba_inventory/models/granularity.rb | 222 ----- .../models/inventory_details.rb | 269 ------- .../sp_fba_inventory/models/inventory_item.rb | 247 ------ .../models/inventory_items.rb | 206 ----- .../models/inventory_summaries.rb | 206 ----- .../models/inventory_summary.rb | 293 ------- .../lib/sp_fba_inventory/models/pagination.rb | 212 ----- .../models/researching_quantity.rb | 224 ----- .../models/researching_quantity_entry.rb | 266 ------ .../models/reserved_quantity.rb | 242 ------ .../models/unfulfillable_quantity.rb | 272 ------- .../lib/sp_fba_inventory/version.rb | 14 - vendor/fba_inventory/sp_fba_inventory.gemspec | 38 - vendor/feeds_2021/.gitignore | 39 - vendor/feeds_2021/.rspec | 2 - vendor/feeds_2021/.rubocop.yml | 154 ---- vendor/feeds_2021/.swagger-codegen-ignore | 23 - vendor/feeds_2021/.swagger-codegen/VERSION | 1 - vendor/feeds_2021/Gemfile | 9 - vendor/feeds_2021/README.md | 161 ---- vendor/feeds_2021/Rakefile | 8 - vendor/feeds_2021/git_push.sh | 55 -- .../lib/sp_feeds_2021/api_client.rb | 389 --------- .../feeds_2021/lib/sp_feeds_2021/api_error.rb | 59 -- .../lib/sp_feeds_2021/configuration.rb | 200 ----- .../models/create_feed_document_response.rb | 232 ------ .../create_feed_document_specification.rb | 217 ----- .../models/create_feed_response.rb | 217 ----- .../models/create_feed_specification.rb | 258 ------ .../lib/sp_feeds_2021/models/error.rb | 242 ------ .../lib/sp_feeds_2021/models/error_list.rb | 219 ----- .../lib/sp_feeds_2021/models/feed.rb | 338 -------- .../lib/sp_feeds_2021/models/feed_document.rb | 276 ------- .../lib/sp_feeds_2021/models/feed_list.rb | 206 ----- .../lib/sp_feeds_2021/models/feed_options.rb | 206 ----- .../models/get_feeds_response.rb | 226 ------ .../feeds_2021/lib/sp_feeds_2021/version.rb | 14 - vendor/feeds_2021/sp_feeds_2021.gemspec | 38 - vendor/fulfillment_outbound_2020/.gitignore | 39 - vendor/fulfillment_outbound_2020/.rspec | 2 - vendor/fulfillment_outbound_2020/.rubocop.yml | 154 ---- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/fulfillment_outbound_2020/Gemfile | 9 - vendor/fulfillment_outbound_2020/README.md | 374 --------- vendor/fulfillment_outbound_2020/Rakefile | 8 - vendor/fulfillment_outbound_2020/git_push.sh | 55 -- .../api_client.rb | 389 --------- .../sp_fulfillment_outbound_2020/api_error.rb | 59 -- .../configuration.rb | 200 ----- .../models/additional_location_info.rb | 54 -- .../models/address.rb | 327 -------- .../models/amount.rb | 265 ------ .../cancel_fulfillment_order_response.rb | 211 ----- .../models/cod_settings.rb | 253 ------ .../models/create_fulfillment_order_item.rb | 303 ------- .../create_fulfillment_order_item_list.rb | 206 ----- .../create_fulfillment_order_request.rb | 398 --------- .../create_fulfillment_order_response.rb | 211 ----- .../create_fulfillment_return_request.rb | 216 ----- .../create_fulfillment_return_response.rb | 220 ----- .../create_fulfillment_return_result.rb | 229 ------ .../models/create_return_item.rb | 272 ------- .../models/create_return_item_list.rb | 206 ----- .../models/current_status.rb | 46 -- .../models/date_range.rb | 230 ------ .../models/decimal.rb | 202 ----- .../models/delivery_document.rb | 227 ------ .../models/delivery_document_list.rb | 206 ----- .../models/delivery_information.rb | 220 ----- .../models/delivery_message.rb | 222 ----- .../models/delivery_offer.rb | 229 ------ .../models/delivery_offers_list.rb | 206 ----- .../models/delivery_policy.rb | 211 ----- .../models/delivery_preferences.rb | 221 ----- .../models/delivery_window.rb | 230 ------ .../models/delivery_window_list.rb | 206 ----- .../models/destination.rb | 220 ----- .../models/drop_off_location.rb | 263 ------ .../models/error.rb | 242 ------ .../models/error_list.rb | 206 ----- .../models/event_code.rb | 61 -- .../models/feature.rb | 242 ------ .../models/feature_settings.rb | 256 ------ .../models/feature_sku.rb | 254 ------ .../models/features.rb | 206 ----- .../models/fee.rb | 265 ------ .../models/fee_list.rb | 206 ----- .../models/fulfillment_action.rb | 30 - .../models/fulfillment_order.rb | 403 --------- .../models/fulfillment_order_item.rb | 359 --------- .../models/fulfillment_order_item_list.rb | 206 ----- .../models/fulfillment_order_status.rb | 37 - .../models/fulfillment_policy.rb | 31 - .../models/fulfillment_preview.rb | 327 -------- .../models/fulfillment_preview_item.rb | 299 ------- .../models/fulfillment_preview_item_list.rb | 206 ----- .../models/fulfillment_preview_list.rb | 206 ----- .../models/fulfillment_preview_shipment.rb | 264 ------ .../fulfillment_preview_shipment_list.rb | 206 ----- .../models/fulfillment_return_item_status.rb | 30 - .../models/fulfillment_shipment.rb | 334 -------- .../models/fulfillment_shipment_item.rb | 275 ------- .../models/fulfillment_shipment_item_list.rb | 206 ----- .../models/fulfillment_shipment_list.rb | 206 ----- .../models/fulfillment_shipment_package.rb | 269 ------- .../fulfillment_shipment_package_list.rb | 206 ----- .../models/get_delivery_offers_product.rb | 225 ------ .../models/get_delivery_offers_request.rb | 230 ------ .../models/get_delivery_offers_response.rb | 220 ----- .../models/get_delivery_offers_result.rb | 211 ----- .../models/get_delivery_offers_terms.rb | 230 ------ .../models/get_feature_inventory_response.rb | 220 ----- .../models/get_feature_inventory_result.rb | 254 ------ .../models/get_feature_sku_response.rb | 220 ----- .../models/get_feature_sku_result.rb | 268 ------ .../models/get_features_response.rb | 220 ----- .../models/get_features_result.rb | 216 ----- .../models/get_fulfillment_order_response.rb | 220 ----- .../models/get_fulfillment_order_result.rb | 276 ------- .../models/get_fulfillment_preview_item.rb | 255 ------ .../get_fulfillment_preview_item_list.rb | 206 ----- .../models/get_fulfillment_preview_request.rb | 281 ------- .../get_fulfillment_preview_response.rb | 220 ----- .../models/get_fulfillment_preview_result.rb | 211 ----- .../get_package_tracking_details_response.rb | 220 ----- .../models/invalid_item_reason.rb | 231 ------ .../models/invalid_item_reason_code.rb | 32 - .../models/invalid_return_item.rb | 246 ------ .../models/invalid_return_item_list.rb | 206 ----- .../models/ip_address.rb | 202 ----- .../list_all_fulfillment_orders_response.rb | 220 ----- .../list_all_fulfillment_orders_result.rb | 224 ----- .../list_return_reason_codes_response.rb | 220 ----- .../models/list_return_reason_codes_result.rb | 211 ----- .../models/locker_details.rb | 222 ----- .../models/money.rb | 231 ------ .../models/notification_email_list.rb | 206 ----- .../models/origin.rb | 217 ----- .../models/package_tracking_details.rb | 350 -------- .../models/payment_information.rb | 246 ------ .../models/payment_information_list.rb | 206 ----- .../models/product_identifier.rb | 217 ----- .../models/quantity.rb | 202 ----- .../models/reason_code_details.rb | 242 ------ .../models/reason_code_details_list.rb | 206 ----- .../models/return_authorization.rb | 276 ------- .../models/return_authorization_list.rb | 206 ----- .../models/return_item.rb | 339 -------- .../models/return_item_disposition.rb | 33 - .../models/return_item_list.rb | 206 ----- .../models/scheduled_delivery_info.rb | 231 ------ .../models/shipping_speed_category.rb | 32 - .../models/shipping_speed_category_list.rb | 206 ----- .../models/string_list.rb | 206 ----- ...fulfillment_order_status_update_request.rb | 211 ----- ...ulfillment_order_status_update_response.rb | 211 ----- .../models/timestamp.rb | 202 ----- .../models/tracking_address.rb | 247 ------ .../models/tracking_event.rb | 259 ------ .../models/tracking_event_list.rb | 206 ----- .../models/unfulfillable_preview_item.rb | 255 ------ .../models/unfulfillable_preview_item_list.rb | 206 ----- .../models/update_fulfillment_order_item.rb | 308 ------- .../update_fulfillment_order_item_list.rb | 206 ----- .../update_fulfillment_order_request.rb | 317 -------- .../update_fulfillment_order_response.rb | 211 ----- .../models/variable_precision_address.rb | 292 ------- .../models/weight.rb | 266 ------ .../sp_fulfillment_outbound_2020/version.rb | 14 - .../sp_fulfillment_outbound_2020.gemspec | 38 - vendor/listings_items_2021/.gitignore | 39 - vendor/listings_items_2021/.rspec | 2 - vendor/listings_items_2021/.rubocop.yml | 154 ---- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/listings_items_2021/Gemfile | 9 - vendor/listings_items_2021/README.md | 208 ----- vendor/listings_items_2021/Rakefile | 8 - vendor/listings_items_2021/git_push.sh | 55 -- .../lib/sp_listings_items_2021/api_client.rb | 389 --------- .../lib/sp_listings_items_2021/api_error.rb | 59 -- .../sp_listings_items_2021/configuration.rb | 200 ----- .../sp_listings_items_2021/models/audience.rb | 222 ----- .../sp_listings_items_2021/models/decimal.rb | 202 ----- .../sp_listings_items_2021/models/error.rb | 242 ------ .../models/error_list.rb | 218 ----- .../models/fulfillment_availability.rb | 227 ------ .../sp_listings_items_2021/models/issue.rb | 319 -------- .../models/issue_enforcement_action.rb | 217 ----- .../models/issue_enforcements.rb | 233 ------ .../models/issue_exemption.rb | 261 ------ .../lib/sp_listings_items_2021/models/item.rb | 295 ------- .../models/item_attributes.rb | 206 ----- .../models/item_identifiers.rb | 206 ----- .../models/item_identifiers_by_marketplace.rb | 222 ----- .../models/item_image.rb | 247 ------ .../models/item_issues.rb | 206 ----- .../models/item_offer_by_marketplace.rb | 298 ------- .../models/item_offers.rb | 206 ----- .../models/item_procurement.rb | 216 ----- .../item_product_type_by_marketplace.rb | 232 ------ .../models/item_product_types.rb | 206 ----- .../models/item_relationship.rb | 284 ------- .../models/item_relationships.rb | 206 ----- .../item_relationships_by_marketplace.rb | 234 ------ .../models/item_search_results.rb | 243 ------ .../models/item_summaries.rb | 206 ----- .../models/item_summary_by_marketplace.rb | 362 --------- .../models/item_variation_theme.rb | 234 ------ .../models/listings_item_patch_request.rb | 234 ------ .../models/listings_item_put_request.rb | 278 ------- .../listings_item_submission_response.rb | 302 ------- .../sp_listings_items_2021/models/money.rb | 231 ------ .../models/pagination.rb | 222 ----- .../models/patch_operation.rb | 278 ------- .../sp_listings_items_2021/models/points.rb | 216 ----- .../lib/sp_listings_items_2021/version.rb | 14 - .../sp_listings_items_2021.gemspec | 38 - vendor/orders_v0/.gitignore | 39 - vendor/orders_v0/.rspec | 2 - vendor/orders_v0/.rubocop.yml | 154 ---- vendor/orders_v0/.swagger-codegen-ignore | 23 - vendor/orders_v0/.swagger-codegen/VERSION | 1 - vendor/orders_v0/Gemfile | 9 - vendor/orders_v0/README.md | 303 ------- vendor/orders_v0/Rakefile | 8 - vendor/orders_v0/git_push.sh | 55 -- .../orders_v0/lib/sp_orders_v0/api_client.rb | 389 --------- .../orders_v0/lib/sp_orders_v0/api_error.rb | 59 -- .../lib/sp_orders_v0/configuration.rb | 200 ----- .../lib/sp_orders_v0/models/address.rb | 390 --------- .../models/address_extended_fields.rb | 242 ------ .../sp_orders_v0/models/amazon_programs.rb | 219 ----- .../sp_orders_v0/models/associated_item.rb | 231 ------ .../sp_orders_v0/models/association_type.rb | 29 - .../models/automated_shipping_settings.rb | 232 ------ .../lib/sp_orders_v0/models/business_hours.rb | 258 ------ .../models/buyer_customized_info_detail.rb | 212 ----- .../lib/sp_orders_v0/models/buyer_info.rb | 251 ------ .../models/buyer_requested_cancel.rb | 222 ----- .../lib/sp_orders_v0/models/buyer_tax_info.rb | 234 ------ .../models/buyer_tax_information.rb | 242 ------ .../models/confirm_shipment_error_response.rb | 211 ----- .../models/confirm_shipment_order_item.rb | 241 ------ .../confirm_shipment_order_items_list.rb | 206 ----- .../models/confirm_shipment_request.rb | 274 ------- .../sp_orders_v0/models/constraint_type.rb | 29 - .../models/delivery_preferences.rb | 243 ------ .../models/easy_ship_shipment_status.rb | 44 - .../models/electronic_invoice_status.rb | 33 - .../lib/sp_orders_v0/models/error.rb | 242 ------ .../lib/sp_orders_v0/models/error_list.rb | 206 ----- .../sp_orders_v0/models/exception_dates.rb | 234 ------ .../lib/sp_orders_v0/models/export_info.rb | 221 ----- .../models/fulfillment_instruction.rb | 212 ----- .../models/get_order_address_response.rb | 220 ----- .../models/get_order_buyer_info_response.rb | 220 ----- .../get_order_items_buyer_info_response.rb | 220 ----- .../models/get_order_items_response.rb | 220 ----- .../get_order_regulated_info_response.rb | 220 ----- .../sp_orders_v0/models/get_order_response.rb | 220 ----- .../models/get_orders_response.rb | 220 ----- .../sp_orders_v0/models/item_buyer_info.rb | 249 ------ .../lib/sp_orders_v0/models/marketplace_id.rb | 202 ----- .../models/marketplace_tax_info.rb | 214 ----- .../lib/sp_orders_v0/models/measurement.rb | 266 ------ .../lib/sp_orders_v0/models/money.rb | 222 ----- .../lib/sp_orders_v0/models/open_interval.rb | 220 ----- .../sp_orders_v0/models/open_time_interval.rb | 222 ----- .../lib/sp_orders_v0/models/order.rb | 762 ------------------ .../lib/sp_orders_v0/models/order_address.rb | 245 ------ .../sp_orders_v0/models/order_buyer_info.rb | 266 ------ .../lib/sp_orders_v0/models/order_item.rb | 644 --------------- .../models/order_item_buyer_info.rb | 264 ------ .../models/order_item_buyer_info_list.rb | 206 ----- .../sp_orders_v0/models/order_item_list.rb | 206 ----- .../lib/sp_orders_v0/models/order_items.rb | 206 ----- .../models/order_items_buyer_info_list.rb | 241 ------ .../sp_orders_v0/models/order_items_inner.rb | 221 ----- .../sp_orders_v0/models/order_items_list.rb | 241 ------ .../lib/sp_orders_v0/models/order_list.rb | 206 ----- .../models/order_regulated_info.rb | 260 ------ .../lib/sp_orders_v0/models/orders_list.rb | 246 ------ .../models/other_delivery_attributes.rb | 31 - .../lib/sp_orders_v0/models/package_detail.rb | 305 ------- .../models/package_reference_id.rb | 202 ----- .../models/payment_execution_detail_item.rb | 231 ------ .../payment_execution_detail_item_list.rb | 206 ----- .../models/payment_method_detail_item_list.rb | 206 ----- .../models/points_granted_detail.rb | 221 ----- .../models/preferred_delivery_time.rb | 226 ------ .../models/prescription_detail.rb | 307 ------- .../models/product_info_detail.rb | 212 ----- .../sp_orders_v0/models/promotion_id_list.rb | 206 ----- .../models/regulated_information.rb | 219 ----- .../models/regulated_information_field.rb | 296 ------- .../regulated_order_verification_status.rb | 289 ------- .../sp_orders_v0/models/rejection_reason.rb | 232 ------ .../sp_orders_v0/models/shipment_status.rb | 31 - .../models/shipping_constraints.rb | 238 ------ .../models/substitution_option.rb | 251 ------ .../models/substitution_option_list.rb | 206 ----- .../models/substitution_preferences.rb | 260 ------ .../sp_orders_v0/models/tax_classification.rb | 222 ----- .../lib/sp_orders_v0/models/tax_collection.rb | 268 ------ .../sp_orders_v0/models/transparency_code.rb | 202 ----- .../models/transparency_code_list.rb | 206 ----- .../update_shipment_status_error_response.rb | 211 ----- .../models/update_shipment_status_request.rb | 239 ------ ...date_verification_status_error_response.rb | 211 ----- .../update_verification_status_request.rb | 216 ----- ...update_verification_status_request_body.rb | 245 ------ .../models/valid_verification_detail.rb | 234 ------ .../models/verification_details.rb | 211 ----- .../models/verification_status.rb | 33 - vendor/orders_v0/lib/sp_orders_v0/version.rb | 14 - vendor/orders_v0/sp_orders_v0.gemspec | 38 - vendor/reports_2021/.gitignore | 39 - vendor/reports_2021/.rspec | 2 - vendor/reports_2021/.rubocop.yml | 154 ---- vendor/reports_2021/.swagger-codegen-ignore | 23 - vendor/reports_2021/.swagger-codegen/VERSION | 1 - vendor/reports_2021/Gemfile | 9 - vendor/reports_2021/README.md | 198 ----- vendor/reports_2021/Rakefile | 8 - vendor/reports_2021/git_push.sh | 55 -- .../lib/sp_reports_2021/api_client.rb | 389 --------- .../lib/sp_reports_2021/api_error.rb | 59 -- .../lib/sp_reports_2021/configuration.rb | 200 ----- .../models/create_report_response.rb | 217 ----- .../models/create_report_schedule_response.rb | 217 ----- .../create_report_schedule_specification.rb | 302 ------- .../models/create_report_specification.rb | 263 ------ .../lib/sp_reports_2021/models/error.rb | 242 ------ .../lib/sp_reports_2021/models/error_list.rb | 219 ----- .../models/get_reports_response.rb | 226 ------ .../lib/sp_reports_2021/models/report.rb | 368 --------- .../sp_reports_2021/models/report_document.rb | 276 ------- .../lib/sp_reports_2021/models/report_list.rb | 206 ----- .../sp_reports_2021/models/report_options.rb | 206 ----- .../sp_reports_2021/models/report_schedule.rb | 278 ------- .../models/report_schedule_list.rb | 219 ----- .../lib/sp_reports_2021/version.rb | 14 - vendor/reports_2021/sp_reports_2021.gemspec | 38 - vendor/tokens_2021/.gitignore | 39 - vendor/tokens_2021/.rspec | 2 - vendor/tokens_2021/.rubocop.yml | 154 ---- vendor/tokens_2021/.swagger-codegen-ignore | 23 - vendor/tokens_2021/.swagger-codegen/VERSION | 1 - vendor/tokens_2021/Gemfile | 9 - vendor/tokens_2021/README.md | 89 -- vendor/tokens_2021/Rakefile | 8 - vendor/tokens_2021/git_push.sh | 55 -- .../lib/sp_tokens_2021/api_client.rb | 389 --------- .../lib/sp_tokens_2021/api_error.rb | 59 -- .../lib/sp_tokens_2021/configuration.rb | 200 ----- .../create_restricted_data_token_request.rb | 229 ------ .../create_restricted_data_token_response.rb | 222 ----- .../lib/sp_tokens_2021/models/error.rb | 242 ------ .../lib/sp_tokens_2021/models/error_list.rb | 213 ----- .../models/restricted_resource.rb | 278 ------- .../tokens_2021/lib/sp_tokens_2021/version.rb | 14 - vendor/tokens_2021/sp_tokens_2021.gemspec | 38 - vendor/vdf_inventory_v1/.gitignore | 39 - vendor/vdf_inventory_v1/.rspec | 2 - vendor/vdf_inventory_v1/.rubocop.yml | 154 ---- .../vdf_inventory_v1/.swagger-codegen-ignore | 23 - .../vdf_inventory_v1/.swagger-codegen/VERSION | 1 - vendor/vdf_inventory_v1/Gemfile | 9 - vendor/vdf_inventory_v1/README.md | 94 --- vendor/vdf_inventory_v1/Rakefile | 8 - vendor/vdf_inventory_v1/git_push.sh | 55 -- .../lib/sp_vdf_inventory_v1/api_client.rb | 389 --------- .../lib/sp_vdf_inventory_v1/api_error.rb | 59 -- .../lib/sp_vdf_inventory_v1/configuration.rb | 200 ----- .../lib/sp_vdf_inventory_v1/models/error.rb | 242 ------ .../sp_vdf_inventory_v1/models/error_list.rb | 206 ----- .../models/inventory_update.rb | 248 ------ .../models/item_details.rb | 246 ------ .../models/item_quantity.rb | 227 ------ .../models/party_identification.rb | 217 ----- .../models/submit_inventory_update_request.rb | 211 ----- .../submit_inventory_update_response.rb | 220 ----- .../models/transaction_reference.rb | 212 ----- .../lib/sp_vdf_inventory_v1/version.rb | 14 - .../sp_vdf_inventory_v1.gemspec | 38 - vendor/vdf_orders_v1/.gitignore | 39 - vendor/vdf_orders_v1/.rspec | 2 - vendor/vdf_orders_v1/.rubocop.yml | 154 ---- vendor/vdf_orders_v1/.swagger-codegen-ignore | 23 - vendor/vdf_orders_v1/.swagger-codegen/VERSION | 1 - vendor/vdf_orders_v1/Gemfile | 9 - vendor/vdf_orders_v1/README.md | 145 ---- vendor/vdf_orders_v1/Rakefile | 8 - vendor/vdf_orders_v1/git_push.sh | 55 -- .../lib/sp_vdf_orders_v1/api_client.rb | 389 --------- .../lib/sp_vdf_orders_v1/api_error.rb | 59 -- .../lib/sp_vdf_orders_v1/configuration.rb | 200 ----- .../models/acknowledgement_status.rb | 222 ----- .../lib/sp_vdf_orders_v1/models/address.rb | 342 -------- .../lib/sp_vdf_orders_v1/models/decimal.rb | 202 ----- .../lib/sp_vdf_orders_v1/models/error.rb | 242 ------ .../lib/sp_vdf_orders_v1/models/error_list.rb | 206 ----- .../models/get_order_response.rb | 220 ----- .../models/get_orders_response.rb | 220 ----- .../sp_vdf_orders_v1/models/gift_details.rb | 222 ----- .../sp_vdf_orders_v1/models/item_quantity.rb | 256 ------ .../lib/sp_vdf_orders_v1/models/money.rb | 221 ----- .../lib/sp_vdf_orders_v1/models/order.rb | 226 ------ .../models/order_acknowledgement_item.rb | 306 ------- .../sp_vdf_orders_v1/models/order_details.rb | 372 --------- .../models/order_details_tax_total.rb | 211 ----- .../lib/sp_vdf_orders_v1/models/order_item.rb | 311 ------- .../models/order_item_acknowledgement.rb | 251 ------ .../models/order_item_tax_details.rb | 211 ----- .../lib/sp_vdf_orders_v1/models/order_list.rb | 223 ----- .../lib/sp_vdf_orders_v1/models/pagination.rb | 212 ----- .../models/party_identification.rb | 235 ------ .../models/scheduled_delivery_shipment.rb | 232 ------ .../sp_vdf_orders_v1/models/shipment_dates.rb | 227 ------ .../models/shipment_details.rb | 296 ------- .../models/submit_acknowledgement_request.rb | 214 ----- .../models/submit_acknowledgement_response.rb | 220 ----- .../sp_vdf_orders_v1/models/tax_details.rb | 278 ------- .../sp_vdf_orders_v1/models/tax_line_item.rb | 206 ----- .../models/tax_registration_details.rb | 280 ------- .../sp_vdf_orders_v1/models/transaction_id.rb | 212 ----- .../lib/sp_vdf_orders_v1/version.rb | 14 - vendor/vdf_orders_v1/sp_vdf_orders_v1.gemspec | 38 - vendor/vdf_shipping_v1/.gitignore | 39 - vendor/vdf_shipping_v1/.rspec | 2 - vendor/vdf_shipping_v1/.rubocop.yml | 154 ---- .../vdf_shipping_v1/.swagger-codegen-ignore | 23 - .../vdf_shipping_v1/.swagger-codegen/VERSION | 1 - vendor/vdf_shipping_v1/Gemfile | 9 - vendor/vdf_shipping_v1/README.md | 237 ------ vendor/vdf_shipping_v1/Rakefile | 8 - vendor/vdf_shipping_v1/git_push.sh | 55 -- .../lib/sp_vdf_shipping_v1/api_client.rb | 389 --------- .../lib/sp_vdf_shipping_v1/api_error.rb | 59 -- .../lib/sp_vdf_shipping_v1/configuration.rb | 200 ----- .../lib/sp_vdf_shipping_v1/models/address.rb | 327 -------- .../sp_vdf_shipping_v1/models/container.rb | 376 --------- .../models/customer_invoice.rb | 232 ------ .../models/customer_invoice_list.rb | 223 ----- .../lib/sp_vdf_shipping_v1/models/decimal.rb | 202 ----- .../sp_vdf_shipping_v1/models/dimensions.rb | 293 ------- .../lib/sp_vdf_shipping_v1/models/error.rb | 242 ------ .../sp_vdf_shipping_v1/models/error_list.rb | 206 ----- .../models/get_customer_invoice_response.rb | 220 ----- .../models/get_customer_invoices_response.rb | 220 ----- .../models/get_packing_slip_list_response.rb | 220 ----- .../models/get_packing_slip_response.rb | 220 ----- .../get_shipping_label_list_response.rb | 220 ----- .../models/get_shipping_label_response.rb | 220 ----- .../lib/sp_vdf_shipping_v1/models/item.rb | 251 ------ .../models/item_quantity.rb | 232 ------ .../sp_vdf_shipping_v1/models/label_data.rb | 257 ------ .../sp_vdf_shipping_v1/models/packed_item.rb | 251 ------ .../sp_vdf_shipping_v1/models/packing_slip.rb | 276 ------- .../models/packing_slip_list.rb | 223 ----- .../sp_vdf_shipping_v1/models/pagination.rb | 212 ----- .../models/party_identification.rb | 238 ------ .../models/shipment_confirmation.rb | 288 ------- .../models/shipment_details.rb | 296 ------- .../models/shipment_status_update.rb | 259 ------ .../models/shipping_label.rb | 311 ------- .../models/shipping_label_list.rb | 223 ----- .../models/shipping_label_request.rb | 257 ------ .../models/status_update_details.rb | 285 ------- ...status_update_details_shipment_schedule.rb | 232 ------ .../submit_shipment_confirmations_request.rb | 214 ----- .../submit_shipment_confirmations_response.rb | 220 ----- .../submit_shipment_status_updates_request.rb | 214 ----- ...submit_shipment_status_updates_response.rb | 220 ----- .../models/submit_shipping_labels_request.rb | 214 ----- .../models/submit_shipping_labels_response.rb | 220 ----- .../models/tax_registration_details.rb | 280 ------- .../models/transaction_reference.rb | 212 ----- .../lib/sp_vdf_shipping_v1/models/weight.rb | 265 ------ .../lib/sp_vdf_shipping_v1/version.rb | 14 - .../sp_vdf_shipping_v1.gemspec | 38 - vendor/vendor_invoices/.gitignore | 39 - vendor/vendor_invoices/.rspec | 2 - vendor/vendor_invoices/.rubocop.yml | 154 ---- .../vendor_invoices/.swagger-codegen-ignore | 23 - .../vendor_invoices/.swagger-codegen/VERSION | 1 - vendor/vendor_invoices/Gemfile | 9 - vendor/vendor_invoices/README.md | 106 --- vendor/vendor_invoices/Rakefile | 8 - vendor/vendor_invoices/git_push.sh | 55 -- .../lib/sp_vendor_invoices/api_client.rb | 389 --------- .../lib/sp_vendor_invoices/api_error.rb | 59 -- .../lib/sp_vendor_invoices/configuration.rb | 200 ----- .../models/additional_details.rb | 276 ------- .../lib/sp_vendor_invoices/models/address.rb | 327 -------- .../models/allowance_details.rb | 287 ------- .../models/charge_details.rb | 287 ------- .../models/credit_note_details.rb | 271 ------- .../sp_vendor_invoices/models/date_time.rb | 202 ----- .../lib/sp_vendor_invoices/models/decimal.rb | 202 ----- .../lib/sp_vendor_invoices/models/error.rb | 242 ------ .../sp_vendor_invoices/models/error_list.rb | 206 ----- .../lib/sp_vendor_invoices/models/invoice.rb | 414 ---------- .../sp_vendor_invoices/models/invoice_item.rb | 339 -------- .../models/item_quantity.rb | 285 ------- .../lib/sp_vendor_invoices/models/money.rb | 221 ----- .../models/net_cost_unit_of_measure.rb | 32 - .../models/party_identification.rb | 238 ------ .../models/payment_terms.rb | 275 ------- .../models/submit_invoices_request.rb | 214 ----- .../models/submit_invoices_response.rb | 220 ----- .../sp_vendor_invoices/models/tax_details.rb | 283 ------- .../models/tax_registration_details.rb | 266 ------ .../sp_vendor_invoices/models/total_weight.rb | 265 ------ .../models/transaction_id.rb | 212 ----- .../lib/sp_vendor_invoices/version.rb | 14 - .../sp_vendor_invoices.gemspec | 38 - vendor/vendor_orders/.gitignore | 39 - vendor/vendor_orders/.rspec | 2 - vendor/vendor_orders/.rubocop.yml | 154 ---- vendor/vendor_orders/.swagger-codegen-ignore | 23 - vendor/vendor_orders/.swagger-codegen/VERSION | 1 - vendor/vendor_orders/Gemfile | 9 - vendor/vendor_orders/README.md | 178 ---- vendor/vendor_orders/Rakefile | 8 - vendor/vendor_orders/git_push.sh | 55 -- .../lib/sp_vendor_orders/api_client.rb | 389 --------- .../lib/sp_vendor_orders/api_error.rb | 59 -- .../lib/sp_vendor_orders/configuration.rb | 200 ----- .../models/acknowledgement_status_details.rb | 230 ------ .../lib/sp_vendor_orders/models/address.rb | 327 -------- .../models/date_time_interval.rb | 202 ----- .../lib/sp_vendor_orders/models/decimal.rb | 202 ----- .../lib/sp_vendor_orders/models/error.rb | 242 ------ .../lib/sp_vendor_orders/models/error_list.rb | 206 ----- .../models/get_purchase_order_response.rb | 220 ----- .../models/get_purchase_orders_response.rb | 220 ----- .../get_purchase_orders_status_response.rb | 220 ----- .../sp_vendor_orders/models/import_details.rb | 298 ------- .../sp_vendor_orders/models/item_quantity.rb | 266 ------ .../sp_vendor_orders/models/item_status.rb | 206 ----- .../lib/sp_vendor_orders/models/money.rb | 265 ------ .../lib/sp_vendor_orders/models/order.rb | 275 ------- .../models/order_acknowledgement.rb | 263 ------ .../models/order_acknowledgement_item.rb | 291 ------- .../sp_vendor_orders/models/order_details.rb | 398 --------- .../lib/sp_vendor_orders/models/order_item.rb | 284 ------- .../models/order_item_acknowledgement.rb | 307 ------- .../models/order_item_status.rb | 282 ------- ...rder_item_status_acknowledgement_status.rb | 276 ------- .../order_item_status_ordered_quantity.rb | 223 ----- .../order_item_status_receiving_status.rb | 265 ------ .../lib/sp_vendor_orders/models/order_list.rb | 223 ----- .../models/order_list_status.rb | 223 ----- .../sp_vendor_orders/models/order_status.rb | 333 -------- .../models/ordered_quantity_details.rb | 230 ------ .../lib/sp_vendor_orders/models/pagination.rb | 212 ----- .../models/party_identification.rb | 235 ------ .../models/submit_acknowledgement_request.rb | 214 ----- .../models/submit_acknowledgement_response.rb | 220 ----- .../models/tax_registration_details.rb | 266 ------ .../sp_vendor_orders/models/transaction_id.rb | 212 ----- .../lib/sp_vendor_orders/version.rb | 14 - vendor/vendor_orders/sp_vendor_orders.gemspec | 38 - vendor/vendor_transaction_status/.gitignore | 39 - vendor/vendor_transaction_status/.rspec | 2 - vendor/vendor_transaction_status/.rubocop.yml | 154 ---- .../.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/vendor_transaction_status/Gemfile | 9 - vendor/vendor_transaction_status/README.md | 89 -- vendor/vendor_transaction_status/Rakefile | 8 - vendor/vendor_transaction_status/git_push.sh | 55 -- .../api_client.rb | 389 --------- .../sp_vendor_transaction_status/api_error.rb | 59 -- .../configuration.rb | 200 ----- .../models/error.rb | 242 ------ .../models/error_list.rb | 206 ----- .../models/get_transaction_response.rb | 220 ----- .../models/transaction.rb | 275 ------- .../models/transaction_status.rb | 211 ----- .../sp_vendor_transaction_status/version.rb | 14 - .../sp_vendor_transaction_status.gemspec | 38 - vendor/vendors_shipments/.gitignore | 39 - vendor/vendors_shipments/.rspec | 2 - vendor/vendors_shipments/.rubocop.yml | 154 ---- .../vendors_shipments/.swagger-codegen-ignore | 23 - .../.swagger-codegen/VERSION | 1 - vendor/vendors_shipments/Gemfile | 9 - vendor/vendors_shipments/README.md | 211 ----- vendor/vendors_shipments/Rakefile | 8 - vendor/vendors_shipments/git_push.sh | 55 -- .../lib/sp_vendors_shipments/api_client.rb | 389 --------- .../lib/sp_vendors_shipments/api_error.rb | 59 -- .../lib/sp_vendors_shipments/configuration.rb | 200 ----- .../sp_vendors_shipments/models/address.rb | 327 -------- .../models/carrier_details.rb | 252 ------ .../lib/sp_vendors_shipments/models/carton.rb | 274 ------- .../models/carton_reference_details.rb | 229 ------ .../models/collect_freight_pickup_details.rb | 232 ------ .../models/container_identification.rb | 266 ------ .../models/container_item.rb | 240 ------ .../models/container_sequence_numbers.rb | 212 ----- .../sp_vendors_shipments/models/containers.rb | 347 -------- .../sp_vendors_shipments/models/decimal.rb | 202 ----- .../sp_vendors_shipments/models/dimensions.rb | 293 ------- .../sp_vendors_shipments/models/duration.rb | 266 ------ .../lib/sp_vendors_shipments/models/error.rb | 242 ------ .../sp_vendors_shipments/models/error_list.rb | 206 ----- .../lib/sp_vendors_shipments/models/expiry.rb | 231 ------ .../models/get_shipment_details_response.rb | 220 ----- .../models/get_shipment_labels.rb | 220 ----- .../models/import_details.rb | 316 -------- .../models/inner_containers_details.rb | 224 ----- .../lib/sp_vendors_shipments/models/item.rb | 260 ------ .../models/item_details.rb | 284 ------- .../models/item_quantity.rb | 285 ------- .../sp_vendors_shipments/models/label_data.rb | 286 ------- .../sp_vendors_shipments/models/location.rb | 232 ------ .../lib/sp_vendors_shipments/models/money.rb | 231 ------ .../models/package_item_details.rb | 231 ------ .../models/packed_items.rb | 250 ------ .../models/packed_quantity.rb | 276 ------- .../sp_vendors_shipments/models/pagination.rb | 212 ----- .../lib/sp_vendors_shipments/models/pallet.rb | 278 ------- .../models/party_identification.rb | 238 ------ .../models/purchase_order_item_details.rb | 211 ----- .../models/purchase_order_items.rb | 260 ------ .../models/purchase_orders.rb | 244 ------ .../lib/sp_vendors_shipments/models/route.rb | 219 ----- .../sp_vendors_shipments/models/shipment.rb | 489 ----------- .../models/shipment_confirmation.rb | 465 ----------- .../models/shipment_details.rb | 223 ----- .../models/shipment_information.rb | 313 ------- .../models/shipment_measurements.rb | 240 ------ .../models/shipment_status_details.rb | 256 ------ .../lib/sp_vendors_shipments/models/stop.rb | 280 ------- .../submit_shipment_confirmations_request.rb | 214 ----- .../submit_shipment_confirmations_response.rb | 220 ----- .../models/submit_shipments.rb | 214 ----- .../models/tax_registration_details.rb | 266 ------ .../models/total_weight.rb | 265 ------ .../models/transaction_reference.rb | 212 ----- .../models/transport_label.rb | 233 ------ .../models/transport_shipment_measurements.rb | 250 ------ .../models/transportation_details.rb | 317 -------- ...ation_details_for_shipment_confirmation.rb | 276 ------- .../models/transportation_labels.rb | 223 ----- .../models/vendor_details.rb | 221 ----- .../lib/sp_vendors_shipments/models/volume.rb | 265 ------ .../lib/sp_vendors_shipments/models/weight.rb | 265 ------ .../lib/sp_vendors_shipments/version.rb | 14 - .../sp_vendors_shipments.gemspec | 38 - 676 files changed, 130373 deletions(-) delete mode 100644 vendor/fba_inventory/.gitignore delete mode 100644 vendor/fba_inventory/.rspec delete mode 100644 vendor/fba_inventory/.rubocop.yml delete mode 100644 vendor/fba_inventory/.swagger-codegen-ignore delete mode 100644 vendor/fba_inventory/.swagger-codegen/VERSION delete mode 100644 vendor/fba_inventory/Gemfile delete mode 100644 vendor/fba_inventory/README.md delete mode 100644 vendor/fba_inventory/Rakefile delete mode 100644 vendor/fba_inventory/git_push.sh delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/api_client.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/api_error.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/configuration.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_request.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_response.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_request.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_response.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/delete_inventory_item_response.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/error.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/error_list.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_response.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_result.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/granularity.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_details.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_item.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_items.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summaries.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summary.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/pagination.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity_entry.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/reserved_quantity.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/models/unfulfillable_quantity.rb delete mode 100644 vendor/fba_inventory/lib/sp_fba_inventory/version.rb delete mode 100644 vendor/fba_inventory/sp_fba_inventory.gemspec delete mode 100644 vendor/feeds_2021/.gitignore delete mode 100644 vendor/feeds_2021/.rspec delete mode 100644 vendor/feeds_2021/.rubocop.yml delete mode 100644 vendor/feeds_2021/.swagger-codegen-ignore delete mode 100644 vendor/feeds_2021/.swagger-codegen/VERSION delete mode 100644 vendor/feeds_2021/Gemfile delete mode 100644 vendor/feeds_2021/README.md delete mode 100644 vendor/feeds_2021/Rakefile delete mode 100644 vendor/feeds_2021/git_push.sh delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/api_client.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/api_error.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/configuration.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_response.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_specification.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_response.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_specification.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/error.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/error_list.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/feed.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/feed_document.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/feed_list.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/feed_options.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/models/get_feeds_response.rb delete mode 100644 vendor/feeds_2021/lib/sp_feeds_2021/version.rb delete mode 100644 vendor/feeds_2021/sp_feeds_2021.gemspec delete mode 100644 vendor/fulfillment_outbound_2020/.gitignore delete mode 100644 vendor/fulfillment_outbound_2020/.rspec delete mode 100644 vendor/fulfillment_outbound_2020/.rubocop.yml delete mode 100644 vendor/fulfillment_outbound_2020/.swagger-codegen-ignore delete mode 100644 vendor/fulfillment_outbound_2020/.swagger-codegen/VERSION delete mode 100644 vendor/fulfillment_outbound_2020/Gemfile delete mode 100644 vendor/fulfillment_outbound_2020/README.md delete mode 100644 vendor/fulfillment_outbound_2020/Rakefile delete mode 100644 vendor/fulfillment_outbound_2020/git_push.sh delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_client.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_error.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/configuration.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/additional_location_info.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/address.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/amount.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cancel_fulfillment_order_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cod_settings.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/current_status.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/date_range.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/decimal.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_information.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_message.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offer.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offers_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_policy.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_preferences.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/destination.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/drop_off_location.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/event_code.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_settings.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_sku.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/features.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_action.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_status.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_policy.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_return_item_status.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_product.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_terms.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_package_tracking_details_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason_code.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/ip_address.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_result.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/locker_details.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/money.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/notification_email_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/origin.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/package_tracking_details.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/product_identifier.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/quantity.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_disposition.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/scheduled_delivery_info.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/string_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/timestamp.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_address.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item_list.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_request.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_response.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/variable_precision_address.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/weight.rb delete mode 100644 vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/version.rb delete mode 100644 vendor/fulfillment_outbound_2020/sp_fulfillment_outbound_2020.gemspec delete mode 100644 vendor/listings_items_2021/.gitignore delete mode 100644 vendor/listings_items_2021/.rspec delete mode 100644 vendor/listings_items_2021/.rubocop.yml delete mode 100644 vendor/listings_items_2021/.swagger-codegen-ignore delete mode 100644 vendor/listings_items_2021/.swagger-codegen/VERSION delete mode 100644 vendor/listings_items_2021/Gemfile delete mode 100644 vendor/listings_items_2021/README.md delete mode 100644 vendor/listings_items_2021/Rakefile delete mode 100644 vendor/listings_items_2021/git_push.sh delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/api_client.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/api_error.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/configuration.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/audience.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/decimal.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/error.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/error_list.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/fulfillment_availability.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcement_action.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcements.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_exemption.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_attributes.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers_by_marketplace.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_image.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_issues.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offer_by_marketplace.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offers.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_procurement.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_type_by_marketplace.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_types.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationship.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships_by_marketplace.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_search_results.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summaries.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summary_by_marketplace.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_variation_theme.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_patch_request.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_put_request.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_submission_response.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/money.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/pagination.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/patch_operation.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/models/points.rb delete mode 100644 vendor/listings_items_2021/lib/sp_listings_items_2021/version.rb delete mode 100644 vendor/listings_items_2021/sp_listings_items_2021.gemspec delete mode 100644 vendor/orders_v0/.gitignore delete mode 100644 vendor/orders_v0/.rspec delete mode 100644 vendor/orders_v0/.rubocop.yml delete mode 100644 vendor/orders_v0/.swagger-codegen-ignore delete mode 100644 vendor/orders_v0/.swagger-codegen/VERSION delete mode 100644 vendor/orders_v0/Gemfile delete mode 100644 vendor/orders_v0/README.md delete mode 100644 vendor/orders_v0/Rakefile delete mode 100644 vendor/orders_v0/git_push.sh delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/api_client.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/api_error.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/configuration.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/address.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/address_extended_fields.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/amazon_programs.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/associated_item.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/association_type.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/automated_shipping_settings.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/business_hours.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/buyer_customized_info_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/buyer_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/buyer_requested_cancel.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_information.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_error_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_item.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_items_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_request.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/constraint_type.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/delivery_preferences.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/easy_ship_shipment_status.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/electronic_invoice_status.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/error.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/error_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/exception_dates.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/export_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/fulfillment_instruction.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_address_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_buyer_info_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_buyer_info_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_regulated_info_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_order_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/get_orders_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/item_buyer_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/marketplace_id.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/marketplace_tax_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/measurement.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/money.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/open_interval.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/open_time_interval.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_address.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_buyer_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_item.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_item_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_items.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_items_buyer_info_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_items_inner.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_items_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/order_regulated_info.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/orders_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/other_delivery_attributes.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/package_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/package_reference_id.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/payment_method_detail_item_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/points_granted_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/preferred_delivery_time.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/prescription_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/product_info_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/promotion_id_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/regulated_information.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/regulated_information_field.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/regulated_order_verification_status.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/rejection_reason.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/shipment_status.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/shipping_constraints.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/substitution_option.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/substitution_option_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/substitution_preferences.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/tax_classification.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/tax_collection.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/transparency_code.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/transparency_code_list.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_error_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_request.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_error_response.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request_body.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/valid_verification_detail.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/verification_details.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/models/verification_status.rb delete mode 100644 vendor/orders_v0/lib/sp_orders_v0/version.rb delete mode 100644 vendor/orders_v0/sp_orders_v0.gemspec delete mode 100644 vendor/reports_2021/.gitignore delete mode 100644 vendor/reports_2021/.rspec delete mode 100644 vendor/reports_2021/.rubocop.yml delete mode 100644 vendor/reports_2021/.swagger-codegen-ignore delete mode 100644 vendor/reports_2021/.swagger-codegen/VERSION delete mode 100644 vendor/reports_2021/Gemfile delete mode 100644 vendor/reports_2021/README.md delete mode 100644 vendor/reports_2021/Rakefile delete mode 100644 vendor/reports_2021/git_push.sh delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/api_client.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/api_error.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/configuration.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/create_report_response.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_response.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_specification.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/create_report_specification.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/error.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/error_list.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/get_reports_response.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report_document.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report_list.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report_options.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report_schedule.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/models/report_schedule_list.rb delete mode 100644 vendor/reports_2021/lib/sp_reports_2021/version.rb delete mode 100644 vendor/reports_2021/sp_reports_2021.gemspec delete mode 100644 vendor/tokens_2021/.gitignore delete mode 100644 vendor/tokens_2021/.rspec delete mode 100644 vendor/tokens_2021/.rubocop.yml delete mode 100644 vendor/tokens_2021/.swagger-codegen-ignore delete mode 100644 vendor/tokens_2021/.swagger-codegen/VERSION delete mode 100644 vendor/tokens_2021/Gemfile delete mode 100644 vendor/tokens_2021/README.md delete mode 100644 vendor/tokens_2021/Rakefile delete mode 100644 vendor/tokens_2021/git_push.sh delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/api_client.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/api_error.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/configuration.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_request.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_response.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/models/error.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/models/error_list.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/models/restricted_resource.rb delete mode 100644 vendor/tokens_2021/lib/sp_tokens_2021/version.rb delete mode 100644 vendor/tokens_2021/sp_tokens_2021.gemspec delete mode 100644 vendor/vdf_inventory_v1/.gitignore delete mode 100644 vendor/vdf_inventory_v1/.rspec delete mode 100644 vendor/vdf_inventory_v1/.rubocop.yml delete mode 100644 vendor/vdf_inventory_v1/.swagger-codegen-ignore delete mode 100644 vendor/vdf_inventory_v1/.swagger-codegen/VERSION delete mode 100644 vendor/vdf_inventory_v1/Gemfile delete mode 100644 vendor/vdf_inventory_v1/README.md delete mode 100644 vendor/vdf_inventory_v1/Rakefile delete mode 100644 vendor/vdf_inventory_v1/git_push.sh delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_client.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_error.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/configuration.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error_list.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/inventory_update.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_details.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_quantity.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/party_identification.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_request.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_response.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/transaction_reference.rb delete mode 100644 vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/version.rb delete mode 100644 vendor/vdf_inventory_v1/sp_vdf_inventory_v1.gemspec delete mode 100644 vendor/vdf_orders_v1/.gitignore delete mode 100644 vendor/vdf_orders_v1/.rspec delete mode 100644 vendor/vdf_orders_v1/.rubocop.yml delete mode 100644 vendor/vdf_orders_v1/.swagger-codegen-ignore delete mode 100644 vendor/vdf_orders_v1/.swagger-codegen/VERSION delete mode 100644 vendor/vdf_orders_v1/Gemfile delete mode 100644 vendor/vdf_orders_v1/README.md delete mode 100644 vendor/vdf_orders_v1/Rakefile delete mode 100644 vendor/vdf_orders_v1/git_push.sh delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_client.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_error.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/configuration.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/acknowledgement_status.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/address.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/decimal.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error_list.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_order_response.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_orders_response.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/gift_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/item_quantity.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/money.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_acknowledgement_item.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details_tax_total.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_acknowledgement.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_tax_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_list.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/pagination.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/party_identification.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/scheduled_delivery_shipment.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_dates.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_request.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_response.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_line_item.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_registration_details.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/transaction_id.rb delete mode 100644 vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/version.rb delete mode 100644 vendor/vdf_orders_v1/sp_vdf_orders_v1.gemspec delete mode 100644 vendor/vdf_shipping_v1/.gitignore delete mode 100644 vendor/vdf_shipping_v1/.rspec delete mode 100644 vendor/vdf_shipping_v1/.rubocop.yml delete mode 100644 vendor/vdf_shipping_v1/.swagger-codegen-ignore delete mode 100644 vendor/vdf_shipping_v1/.swagger-codegen/VERSION delete mode 100644 vendor/vdf_shipping_v1/Gemfile delete mode 100644 vendor/vdf_shipping_v1/README.md delete mode 100644 vendor/vdf_shipping_v1/Rakefile delete mode 100644 vendor/vdf_shipping_v1/git_push.sh delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_client.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_error.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/configuration.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/address.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/container.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice_list.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/decimal.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/dimensions.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error_list.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoice_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoices_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_list_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_list_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item_quantity.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/label_data.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packed_item.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip_list.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/pagination.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/party_identification.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_confirmation.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_details.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_status_update.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_list.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_request.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details_shipment_schedule.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_request.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_request.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_request.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_response.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/tax_registration_details.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/transaction_reference.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/weight.rb delete mode 100644 vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/version.rb delete mode 100644 vendor/vdf_shipping_v1/sp_vdf_shipping_v1.gemspec delete mode 100644 vendor/vendor_invoices/.gitignore delete mode 100644 vendor/vendor_invoices/.rspec delete mode 100644 vendor/vendor_invoices/.rubocop.yml delete mode 100644 vendor/vendor_invoices/.swagger-codegen-ignore delete mode 100644 vendor/vendor_invoices/.swagger-codegen/VERSION delete mode 100644 vendor/vendor_invoices/Gemfile delete mode 100644 vendor/vendor_invoices/README.md delete mode 100644 vendor/vendor_invoices/Rakefile delete mode 100644 vendor/vendor_invoices/git_push.sh delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/api_client.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/api_error.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/configuration.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/additional_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/address.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/allowance_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/charge_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/credit_note_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/date_time.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/decimal.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/error.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/error_list.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice_item.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/item_quantity.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/money.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/net_cost_unit_of_measure.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/party_identification.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/payment_terms.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_request.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_response.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_registration_details.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/total_weight.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/models/transaction_id.rb delete mode 100644 vendor/vendor_invoices/lib/sp_vendor_invoices/version.rb delete mode 100644 vendor/vendor_invoices/sp_vendor_invoices.gemspec delete mode 100644 vendor/vendor_orders/.gitignore delete mode 100644 vendor/vendor_orders/.rspec delete mode 100644 vendor/vendor_orders/.rubocop.yml delete mode 100644 vendor/vendor_orders/.swagger-codegen-ignore delete mode 100644 vendor/vendor_orders/.swagger-codegen/VERSION delete mode 100644 vendor/vendor_orders/Gemfile delete mode 100644 vendor/vendor_orders/README.md delete mode 100644 vendor/vendor_orders/Rakefile delete mode 100644 vendor/vendor_orders/git_push.sh delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/api_client.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/api_error.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/configuration.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/acknowledgement_status_details.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/address.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/date_time_interval.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/decimal.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/error.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/error_list.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_order_response.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_response.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_status_response.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/import_details.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/item_quantity.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/item_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/money.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement_item.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_details.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_acknowledgement.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_acknowledgement_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_ordered_quantity.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_receiving_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_list.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_list_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/order_status.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/ordered_quantity_details.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/pagination.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/party_identification.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_request.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_response.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/tax_registration_details.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/models/transaction_id.rb delete mode 100644 vendor/vendor_orders/lib/sp_vendor_orders/version.rb delete mode 100644 vendor/vendor_orders/sp_vendor_orders.gemspec delete mode 100644 vendor/vendor_transaction_status/.gitignore delete mode 100644 vendor/vendor_transaction_status/.rspec delete mode 100644 vendor/vendor_transaction_status/.rubocop.yml delete mode 100644 vendor/vendor_transaction_status/.swagger-codegen-ignore delete mode 100644 vendor/vendor_transaction_status/.swagger-codegen/VERSION delete mode 100644 vendor/vendor_transaction_status/Gemfile delete mode 100644 vendor/vendor_transaction_status/README.md delete mode 100644 vendor/vendor_transaction_status/Rakefile delete mode 100644 vendor/vendor_transaction_status/git_push.sh delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_client.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_error.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/configuration.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error_list.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/get_transaction_response.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction_status.rb delete mode 100644 vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/version.rb delete mode 100644 vendor/vendor_transaction_status/sp_vendor_transaction_status.gemspec delete mode 100644 vendor/vendors_shipments/.gitignore delete mode 100644 vendor/vendors_shipments/.rspec delete mode 100644 vendor/vendors_shipments/.rubocop.yml delete mode 100644 vendor/vendors_shipments/.swagger-codegen-ignore delete mode 100644 vendor/vendors_shipments/.swagger-codegen/VERSION delete mode 100644 vendor/vendors_shipments/Gemfile delete mode 100644 vendor/vendors_shipments/README.md delete mode 100644 vendor/vendors_shipments/Rakefile delete mode 100644 vendor/vendors_shipments/git_push.sh delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/api_client.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/api_error.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/configuration.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/address.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/carrier_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton_reference_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/collect_freight_pickup_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_identification.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_item.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_sequence_numbers.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/containers.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/decimal.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/dimensions.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/duration.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/error.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/error_list.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/expiry.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_details_response.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_labels.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/import_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/inner_containers_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/item.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_quantity.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/label_data.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/location.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/money.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/package_item_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_items.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_quantity.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/pagination.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/pallet.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/party_identification.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_item_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_items.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_orders.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/route.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_confirmation.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_information.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_measurements.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_status_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/stop.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_request.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_response.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipments.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/tax_registration_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/total_weight.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transaction_reference.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_label.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_shipment_measurements.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details_for_shipment_confirmation.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_labels.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/vendor_details.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/volume.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/models/weight.rb delete mode 100644 vendor/vendors_shipments/lib/sp_vendors_shipments/version.rb delete mode 100644 vendor/vendors_shipments/sp_vendors_shipments.gemspec diff --git a/vendor/fba_inventory/.gitignore b/vendor/fba_inventory/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/fba_inventory/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/fba_inventory/.rspec b/vendor/fba_inventory/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/fba_inventory/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/fba_inventory/.rubocop.yml b/vendor/fba_inventory/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/fba_inventory/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/fba_inventory/.swagger-codegen-ignore b/vendor/fba_inventory/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/fba_inventory/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/fba_inventory/.swagger-codegen/VERSION b/vendor/fba_inventory/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/fba_inventory/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/fba_inventory/Gemfile b/vendor/fba_inventory/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/fba_inventory/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/fba_inventory/README.md b/vendor/fba_inventory/README.md deleted file mode 100644 index a17a3ce..0000000 --- a/vendor/fba_inventory/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# sp_fba_inventory - -SpFbaInventory - the Ruby gem for the Selling Partner API for FBA Inventory - -The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_fba_inventory.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_fba_inventory-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_fba_inventory-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_fba_inventory', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_fba_inventory', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_fba_inventory' - -api_instance = SpFbaInventory::FbaInventoryApi.new -body = SpFbaInventory::AddInventoryRequest.new # AddInventoryRequest | List of items to add to Sandbox inventory. -x_amzn_idempotency_token = 'x_amzn_idempotency_token_example' # String | A unique token/requestId provided with each call to ensure idempotency. - - -begin - result = api_instance.add_inventory(body, x_amzn_idempotency_token) - p result -rescue SpFbaInventory::ApiError => e - puts "Exception when calling FbaInventoryApi->add_inventory: #{e}" -end - -api_instance = SpFbaInventory::FbaInventoryApi.new -body = SpFbaInventory::CreateInventoryItemRequest.new # CreateInventoryItemRequest | CreateInventoryItem Request Body Parameter. - - -begin - result = api_instance.create_inventory_item(body) - p result -rescue SpFbaInventory::ApiError => e - puts "Exception when calling FbaInventoryApi->create_inventory_item: #{e}" -end - -api_instance = SpFbaInventory::FbaInventoryApi.new -seller_sku = 'seller_sku_example' # String | A single seller SKU used for querying the specified seller SKU inventory summaries. -marketplace_id = 'marketplace_id_example' # String | The marketplace ID for the marketplace for which the sellerSku is to be deleted. - - -begin - result = api_instance.delete_inventory_item(seller_sku, marketplace_id) - p result -rescue SpFbaInventory::ApiError => e - puts "Exception when calling FbaInventoryApi->delete_inventory_item: #{e}" -end - -api_instance = SpFbaInventory::FbaInventoryApi.new -granularity_type = 'granularity_type_example' # String | The granularity type for the inventory aggregation level. -granularity_id = 'granularity_id_example' # String | The granularity ID for the inventory aggregation level. -marketplace_ids = ['marketplace_ids_example'] # Array | The marketplace ID for the marketplace for which to return inventory summaries. -opts = { - details: false, # BOOLEAN | true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). - start_date_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected. - seller_skus: ['seller_skus_example'], # Array | A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs. - seller_sku: 'seller_sku_example', # String | A single seller SKU used for querying the specified seller SKU inventory summaries. - next_token: 'next_token_example' # String | String token returned in the response of your previous request. The string token will expire 30 seconds after being created. -} - -begin - result = api_instance.get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, opts) - p result -rescue SpFbaInventory::ApiError => e - puts "Exception when calling FbaInventoryApi->get_inventory_summaries: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpFbaInventory::FbaInventoryApi* | [**add_inventory**](docs/FbaInventoryApi.md#add_inventory) | **POST** /fba/inventory/v1/items/inventory | -*SpFbaInventory::FbaInventoryApi* | [**create_inventory_item**](docs/FbaInventoryApi.md#create_inventory_item) | **POST** /fba/inventory/v1/items | -*SpFbaInventory::FbaInventoryApi* | [**delete_inventory_item**](docs/FbaInventoryApi.md#delete_inventory_item) | **DELETE** /fba/inventory/v1/items/{sellerSku} | -*SpFbaInventory::FbaInventoryApi* | [**get_inventory_summaries**](docs/FbaInventoryApi.md#get_inventory_summaries) | **GET** /fba/inventory/v1/summaries | - -## Documentation for Models - - - [SpFbaInventory::AddInventoryRequest](docs/AddInventoryRequest.md) - - [SpFbaInventory::AddInventoryResponse](docs/AddInventoryResponse.md) - - [SpFbaInventory::CreateInventoryItemRequest](docs/CreateInventoryItemRequest.md) - - [SpFbaInventory::CreateInventoryItemResponse](docs/CreateInventoryItemResponse.md) - - [SpFbaInventory::DeleteInventoryItemResponse](docs/DeleteInventoryItemResponse.md) - - [SpFbaInventory::Error](docs/Error.md) - - [SpFbaInventory::ErrorList](docs/ErrorList.md) - - [SpFbaInventory::GetInventorySummariesResponse](docs/GetInventorySummariesResponse.md) - - [SpFbaInventory::GetInventorySummariesResult](docs/GetInventorySummariesResult.md) - - [SpFbaInventory::Granularity](docs/Granularity.md) - - [SpFbaInventory::InventoryDetails](docs/InventoryDetails.md) - - [SpFbaInventory::InventoryItem](docs/InventoryItem.md) - - [SpFbaInventory::InventoryItems](docs/InventoryItems.md) - - [SpFbaInventory::InventorySummaries](docs/InventorySummaries.md) - - [SpFbaInventory::InventorySummary](docs/InventorySummary.md) - - [SpFbaInventory::Pagination](docs/Pagination.md) - - [SpFbaInventory::ResearchingQuantity](docs/ResearchingQuantity.md) - - [SpFbaInventory::ResearchingQuantityEntry](docs/ResearchingQuantityEntry.md) - - [SpFbaInventory::ReservedQuantity](docs/ReservedQuantity.md) - - [SpFbaInventory::UnfulfillableQuantity](docs/UnfulfillableQuantity.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/fba_inventory/Rakefile b/vendor/fba_inventory/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/fba_inventory/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/fba_inventory/git_push.sh b/vendor/fba_inventory/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/fba_inventory/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/api_client.rb b/vendor/fba_inventory/lib/sp_fba_inventory/api_client.rb deleted file mode 100644 index 9dfcf33..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpFbaInventory - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpFbaInventory.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/api_error.rb b/vendor/fba_inventory/lib/sp_fba_inventory/api_error.rb deleted file mode 100644 index 2139464..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFbaInventory - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/configuration.rb b/vendor/fba_inventory/lib/sp_fba_inventory/configuration.rb deleted file mode 100644 index f76bc61..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFbaInventory - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_request.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_request.rb deleted file mode 100644 index 556e11e..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The object with the list of Inventory to be added - class AddInventoryRequest - attr_accessor :inventory_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inventory_items' => :'inventoryItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'inventory_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::AddInventoryRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::AddInventoryRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inventory_items') - self.inventory_items = attributes[:'inventory_items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inventory_items == o.inventory_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inventory_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_response.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_response.rb deleted file mode 100644 index 44843ba..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/add_inventory_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The response schema for the AddInventory operation. - class AddInventoryResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::AddInventoryResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::AddInventoryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_request.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_request.rb deleted file mode 100644 index 2d60fd7..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_request.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # An item to be created in the inventory. - class CreateInventoryItemRequest - # The seller SKU of the item. - attr_accessor :seller_sku - - # The marketplaceId. - attr_accessor :marketplace_id - - # The name of the item. - attr_accessor :product_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'marketplace_id' => :'marketplaceId', - :'product_name' => :'productName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'marketplace_id' => :'Object', - :'product_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::CreateInventoryItemRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::CreateInventoryItemRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'product_name') - self.product_name = attributes[:'product_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @product_name.nil? - invalid_properties.push('invalid value for "product_name", product_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @marketplace_id.nil? - return false if @product_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - marketplace_id == o.marketplace_id && - product_name == o.product_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, marketplace_id, product_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_response.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_response.rb deleted file mode 100644 index fdaddae..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/create_inventory_item_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The response schema for the CreateInventoryItem operation. - class CreateInventoryItemResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::CreateInventoryItemResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::CreateInventoryItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/delete_inventory_item_response.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/delete_inventory_item_response.rb deleted file mode 100644 index 713ab88..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/delete_inventory_item_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The response schema for the DeleteInventoryItem operation. - class DeleteInventoryItemResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::DeleteInventoryItemResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::DeleteInventoryItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/error.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/error.rb deleted file mode 100644 index a173807..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/error.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # An error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition in a human-readable form. - attr_accessor :message - - # Additional information that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/error_list.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/error_list.rb deleted file mode 100644 index a874499..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_response.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_response.rb deleted file mode 100644 index 5f2f334..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_response.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The Response schema. - class GetInventorySummariesResponse - attr_accessor :payload - - attr_accessor :pagination - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'pagination' => :'pagination', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'pagination' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::GetInventorySummariesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::GetInventorySummariesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - pagination == o.pagination && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, pagination, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_result.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_result.rb deleted file mode 100644 index 0cace9f..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/get_inventory_summaries_result.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The payload schema for the getInventorySummaries operation. - class GetInventorySummariesResult - attr_accessor :granularity - - attr_accessor :inventory_summaries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'granularity' => :'granularity', - :'inventory_summaries' => :'inventorySummaries' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'granularity' => :'Object', - :'inventory_summaries' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::GetInventorySummariesResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::GetInventorySummariesResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'granularity') - self.granularity = attributes[:'granularity'] - end - - if attributes.key?(:'inventory_summaries') - self.inventory_summaries = attributes[:'inventory_summaries'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @granularity.nil? - invalid_properties.push('invalid value for "granularity", granularity cannot be nil.') - end - - if @inventory_summaries.nil? - invalid_properties.push('invalid value for "inventory_summaries", inventory_summaries cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @granularity.nil? - return false if @inventory_summaries.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - granularity == o.granularity && - inventory_summaries == o.inventory_summaries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [granularity, inventory_summaries].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/granularity.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/granularity.rb deleted file mode 100644 index 0c218df..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/granularity.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # Describes a granularity at which inventory data can be aggregated. For example, if you use Marketplace granularity, the fulfillable quantity will reflect inventory that could be fulfilled in the given marketplace. - class Granularity - # The granularity type for the inventory aggregation level. - attr_accessor :granularity_type - - # The granularity ID for the specified granularity type. When granularityType is Marketplace, specify the marketplaceId. - attr_accessor :granularity_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'granularity_type' => :'granularityType', - :'granularity_id' => :'granularityId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'granularity_type' => :'Object', - :'granularity_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::Granularity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::Granularity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'granularity_type') - self.granularity_type = attributes[:'granularity_type'] - end - - if attributes.key?(:'granularity_id') - self.granularity_id = attributes[:'granularity_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - granularity_type == o.granularity_type && - granularity_id == o.granularity_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [granularity_type, granularity_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_details.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_details.rb deleted file mode 100644 index 9674d63..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_details.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # Summarized inventory details. This object will not appear if the details parameter in the request is false. - class InventoryDetails - # The item quantity that can be picked, packed, and shipped. - attr_accessor :fulfillable_quantity - - # The number of units in an inbound shipment for which you have notified Amazon. - attr_accessor :inbound_working_quantity - - # The number of units in an inbound shipment that you have notified Amazon about and have provided a tracking number. - attr_accessor :inbound_shipped_quantity - - # The number of units that have not yet been received at an Amazon fulfillment center for processing, but are part of an inbound shipment with some units that have already been received and processed. - attr_accessor :inbound_receiving_quantity - - attr_accessor :reserved_quantity - - attr_accessor :researching_quantity - - attr_accessor :unfulfillable_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillable_quantity' => :'fulfillableQuantity', - :'inbound_working_quantity' => :'inboundWorkingQuantity', - :'inbound_shipped_quantity' => :'inboundShippedQuantity', - :'inbound_receiving_quantity' => :'inboundReceivingQuantity', - :'reserved_quantity' => :'reservedQuantity', - :'researching_quantity' => :'researchingQuantity', - :'unfulfillable_quantity' => :'unfulfillableQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillable_quantity' => :'Object', - :'inbound_working_quantity' => :'Object', - :'inbound_shipped_quantity' => :'Object', - :'inbound_receiving_quantity' => :'Object', - :'reserved_quantity' => :'Object', - :'researching_quantity' => :'Object', - :'unfulfillable_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::InventoryDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::InventoryDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillable_quantity') - self.fulfillable_quantity = attributes[:'fulfillable_quantity'] - end - - if attributes.key?(:'inbound_working_quantity') - self.inbound_working_quantity = attributes[:'inbound_working_quantity'] - end - - if attributes.key?(:'inbound_shipped_quantity') - self.inbound_shipped_quantity = attributes[:'inbound_shipped_quantity'] - end - - if attributes.key?(:'inbound_receiving_quantity') - self.inbound_receiving_quantity = attributes[:'inbound_receiving_quantity'] - end - - if attributes.key?(:'reserved_quantity') - self.reserved_quantity = attributes[:'reserved_quantity'] - end - - if attributes.key?(:'researching_quantity') - self.researching_quantity = attributes[:'researching_quantity'] - end - - if attributes.key?(:'unfulfillable_quantity') - self.unfulfillable_quantity = attributes[:'unfulfillable_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillable_quantity == o.fulfillable_quantity && - inbound_working_quantity == o.inbound_working_quantity && - inbound_shipped_quantity == o.inbound_shipped_quantity && - inbound_receiving_quantity == o.inbound_receiving_quantity && - reserved_quantity == o.reserved_quantity && - researching_quantity == o.researching_quantity && - unfulfillable_quantity == o.unfulfillable_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillable_quantity, inbound_working_quantity, inbound_shipped_quantity, inbound_receiving_quantity, reserved_quantity, researching_quantity, unfulfillable_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_item.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_item.rb deleted file mode 100644 index 9183197..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_item.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # An item in the list of inventory to be added. - class InventoryItem - # The seller SKU of the item. - attr_accessor :seller_sku - - # The marketplaceId. - attr_accessor :marketplace_id - - # The quantity of item to add. - attr_accessor :quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'marketplace_id' => :'marketplaceId', - :'quantity' => :'quantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'marketplace_id' => :'Object', - :'quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::InventoryItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::InventoryItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @marketplace_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - marketplace_id == o.marketplace_id && - quantity == o.quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, marketplace_id, quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_items.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_items.rb deleted file mode 100644 index a758f4a..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_items.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # List of Inventory to be added - class InventoryItems - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::InventoryItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::InventoryItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summaries.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summaries.rb deleted file mode 100644 index abe0b05..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summaries.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # A list of inventory summaries. - class InventorySummaries - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::InventorySummaries` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::InventorySummaries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summary.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summary.rb deleted file mode 100644 index d672f54..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/inventory_summary.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # Inventory summary for a specific item. - class InventorySummary - # The Amazon Standard Identification Number (ASIN) of an item. - attr_accessor :asin - - # Amazon's fulfillment network SKU identifier. - attr_accessor :fn_sku - - # The seller SKU of the item. - attr_accessor :seller_sku - - # The condition of the item as described by the seller (for example, New Item). - attr_accessor :condition - - attr_accessor :inventory_details - - # The date and time that any quantity was last updated. - attr_accessor :last_updated_time - - # The localized language product title of the item within the specific marketplace. - attr_accessor :product_name - - # The total number of units in an inbound shipment or in Amazon fulfillment centers. - attr_accessor :total_quantity - - # A list of seller-enrolled stores that apply to this seller SKU. - attr_accessor :stores - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'asin', - :'fn_sku' => :'fnSku', - :'seller_sku' => :'sellerSku', - :'condition' => :'condition', - :'inventory_details' => :'inventoryDetails', - :'last_updated_time' => :'lastUpdatedTime', - :'product_name' => :'productName', - :'total_quantity' => :'totalQuantity', - :'stores' => :'stores' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'fn_sku' => :'Object', - :'seller_sku' => :'Object', - :'condition' => :'Object', - :'inventory_details' => :'Object', - :'last_updated_time' => :'Object', - :'product_name' => :'Object', - :'total_quantity' => :'Object', - :'stores' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::InventorySummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::InventorySummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'fn_sku') - self.fn_sku = attributes[:'fn_sku'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'inventory_details') - self.inventory_details = attributes[:'inventory_details'] - end - - if attributes.key?(:'last_updated_time') - self.last_updated_time = attributes[:'last_updated_time'] - end - - if attributes.key?(:'product_name') - self.product_name = attributes[:'product_name'] - end - - if attributes.key?(:'total_quantity') - self.total_quantity = attributes[:'total_quantity'] - end - - if attributes.key?(:'stores') - if (value = attributes[:'stores']).is_a?(Array) - self.stores = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - fn_sku == o.fn_sku && - seller_sku == o.seller_sku && - condition == o.condition && - inventory_details == o.inventory_details && - last_updated_time == o.last_updated_time && - product_name == o.product_name && - total_quantity == o.total_quantity && - stores == o.stores - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, fn_sku, seller_sku, condition, inventory_details, last_updated_time, product_name, total_quantity, stores].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/pagination.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/pagination.rb deleted file mode 100644 index 3ce0564..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/pagination.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The process of returning the results to a request in batches of a defined size called pages. This is done to exercise some control over result size and overall throughput. It's a form of traffic management. - class Pagination - # A generated string used to retrieve the next page of the result. If nextToken is returned, pass the value of nextToken to the next request. If nextToken is not returned, there are no more items to return. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity.rb deleted file mode 100644 index 2de9ef7..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The number of misplaced or warehouse damaged units that are actively being confirmed at our fulfillment centers. - class ResearchingQuantity - # The total number of units currently being researched in Amazon's fulfillment network. - attr_accessor :total_researching_quantity - - # A list of quantity details for items currently being researched. - attr_accessor :researching_quantity_breakdown - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_researching_quantity' => :'totalResearchingQuantity', - :'researching_quantity_breakdown' => :'researchingQuantityBreakdown' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_researching_quantity' => :'Object', - :'researching_quantity_breakdown' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::ResearchingQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::ResearchingQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_researching_quantity') - self.total_researching_quantity = attributes[:'total_researching_quantity'] - end - - if attributes.key?(:'researching_quantity_breakdown') - if (value = attributes[:'researching_quantity_breakdown']).is_a?(Array) - self.researching_quantity_breakdown = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_researching_quantity == o.total_researching_quantity && - researching_quantity_breakdown == o.researching_quantity_breakdown - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_researching_quantity, researching_quantity_breakdown].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity_entry.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity_entry.rb deleted file mode 100644 index 1fa7cbe..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/researching_quantity_entry.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The misplaced or warehouse damaged inventory that is actively being confirmed at our fulfillment centers. - class ResearchingQuantityEntry - # The duration of the research. - attr_accessor :name - - # The number of units. - attr_accessor :quantity - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'quantity' => :'quantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::ResearchingQuantityEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::ResearchingQuantityEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - name_validator = EnumAttributeValidator.new('Object', ['researchingQuantityInShortTerm', 'researchingQuantityInMidTerm', 'researchingQuantityInLongTerm']) - return false unless name_validator.valid?(@name) - return false if @quantity.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] name Object to be assigned - def name=(name) - validator = EnumAttributeValidator.new('Object', ['researchingQuantityInShortTerm', 'researchingQuantityInMidTerm', 'researchingQuantityInLongTerm']) - unless validator.valid?(name) - fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}." - end - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - quantity == o.quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/reserved_quantity.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/reserved_quantity.rb deleted file mode 100644 index ad6f673..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/reserved_quantity.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The quantity of reserved inventory. - class ReservedQuantity - # The total number of units in Amazon's fulfillment network that are currently being picked, packed, and shipped; or are sidelined for measurement, sampling, or other internal processes. - attr_accessor :total_reserved_quantity - - # The number of units reserved for customer orders. - attr_accessor :pending_customer_order_quantity - - # The number of units being transferred from one fulfillment center to another. - attr_accessor :pending_transshipment_quantity - - # The number of units that have been sidelined at the fulfillment center for additional processing. - attr_accessor :fc_processing_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_reserved_quantity' => :'totalReservedQuantity', - :'pending_customer_order_quantity' => :'pendingCustomerOrderQuantity', - :'pending_transshipment_quantity' => :'pendingTransshipmentQuantity', - :'fc_processing_quantity' => :'fcProcessingQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_reserved_quantity' => :'Object', - :'pending_customer_order_quantity' => :'Object', - :'pending_transshipment_quantity' => :'Object', - :'fc_processing_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::ReservedQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::ReservedQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_reserved_quantity') - self.total_reserved_quantity = attributes[:'total_reserved_quantity'] - end - - if attributes.key?(:'pending_customer_order_quantity') - self.pending_customer_order_quantity = attributes[:'pending_customer_order_quantity'] - end - - if attributes.key?(:'pending_transshipment_quantity') - self.pending_transshipment_quantity = attributes[:'pending_transshipment_quantity'] - end - - if attributes.key?(:'fc_processing_quantity') - self.fc_processing_quantity = attributes[:'fc_processing_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_reserved_quantity == o.total_reserved_quantity && - pending_customer_order_quantity == o.pending_customer_order_quantity && - pending_transshipment_quantity == o.pending_transshipment_quantity && - fc_processing_quantity == o.fc_processing_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_reserved_quantity, pending_customer_order_quantity, pending_transshipment_quantity, fc_processing_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/models/unfulfillable_quantity.rb b/vendor/fba_inventory/lib/sp_fba_inventory/models/unfulfillable_quantity.rb deleted file mode 100644 index b3ced81..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/models/unfulfillable_quantity.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFbaInventory - # The quantity of unfulfillable inventory. - class UnfulfillableQuantity - # The total number of units in Amazon's fulfillment network in unsellable condition. - attr_accessor :total_unfulfillable_quantity - - # The number of units in customer damaged disposition. - attr_accessor :customer_damaged_quantity - - # The number of units in warehouse damaged disposition. - attr_accessor :warehouse_damaged_quantity - - # The number of units in distributor damaged disposition. - attr_accessor :distributor_damaged_quantity - - # The number of units in carrier damaged disposition. - attr_accessor :carrier_damaged_quantity - - # The number of units in defective disposition. - attr_accessor :defective_quantity - - # The number of units in expired disposition. - attr_accessor :expired_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_unfulfillable_quantity' => :'totalUnfulfillableQuantity', - :'customer_damaged_quantity' => :'customerDamagedQuantity', - :'warehouse_damaged_quantity' => :'warehouseDamagedQuantity', - :'distributor_damaged_quantity' => :'distributorDamagedQuantity', - :'carrier_damaged_quantity' => :'carrierDamagedQuantity', - :'defective_quantity' => :'defectiveQuantity', - :'expired_quantity' => :'expiredQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_unfulfillable_quantity' => :'Object', - :'customer_damaged_quantity' => :'Object', - :'warehouse_damaged_quantity' => :'Object', - :'distributor_damaged_quantity' => :'Object', - :'carrier_damaged_quantity' => :'Object', - :'defective_quantity' => :'Object', - :'expired_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFbaInventory::UnfulfillableQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFbaInventory::UnfulfillableQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_unfulfillable_quantity') - self.total_unfulfillable_quantity = attributes[:'total_unfulfillable_quantity'] - end - - if attributes.key?(:'customer_damaged_quantity') - self.customer_damaged_quantity = attributes[:'customer_damaged_quantity'] - end - - if attributes.key?(:'warehouse_damaged_quantity') - self.warehouse_damaged_quantity = attributes[:'warehouse_damaged_quantity'] - end - - if attributes.key?(:'distributor_damaged_quantity') - self.distributor_damaged_quantity = attributes[:'distributor_damaged_quantity'] - end - - if attributes.key?(:'carrier_damaged_quantity') - self.carrier_damaged_quantity = attributes[:'carrier_damaged_quantity'] - end - - if attributes.key?(:'defective_quantity') - self.defective_quantity = attributes[:'defective_quantity'] - end - - if attributes.key?(:'expired_quantity') - self.expired_quantity = attributes[:'expired_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_unfulfillable_quantity == o.total_unfulfillable_quantity && - customer_damaged_quantity == o.customer_damaged_quantity && - warehouse_damaged_quantity == o.warehouse_damaged_quantity && - distributor_damaged_quantity == o.distributor_damaged_quantity && - carrier_damaged_quantity == o.carrier_damaged_quantity && - defective_quantity == o.defective_quantity && - expired_quantity == o.expired_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_unfulfillable_quantity, customer_damaged_quantity, warehouse_damaged_quantity, distributor_damaged_quantity, carrier_damaged_quantity, defective_quantity, expired_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFbaInventory.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fba_inventory/lib/sp_fba_inventory/version.rb b/vendor/fba_inventory/lib/sp_fba_inventory/version.rb deleted file mode 100644 index 2948b18..0000000 --- a/vendor/fba_inventory/lib/sp_fba_inventory/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpFbaInventory - VERSION = '1.0.0' -end diff --git a/vendor/fba_inventory/sp_fba_inventory.gemspec b/vendor/fba_inventory/sp_fba_inventory.gemspec deleted file mode 100644 index 25a614e..0000000 --- a/vendor/fba_inventory/sp_fba_inventory.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for FBA Inventory - -#The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_fba_inventory/version" - -Gem::Specification.new do |s| - s.name = "sp_fba_inventory" - s.version = SpFbaInventory::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for FBA Inventory Ruby Gem" - s.description = "The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/feeds_2021/.gitignore b/vendor/feeds_2021/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/feeds_2021/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/feeds_2021/.rspec b/vendor/feeds_2021/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/feeds_2021/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/feeds_2021/.rubocop.yml b/vendor/feeds_2021/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/feeds_2021/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/feeds_2021/.swagger-codegen-ignore b/vendor/feeds_2021/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/feeds_2021/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/feeds_2021/.swagger-codegen/VERSION b/vendor/feeds_2021/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/feeds_2021/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/feeds_2021/Gemfile b/vendor/feeds_2021/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/feeds_2021/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/feeds_2021/README.md b/vendor/feeds_2021/README.md deleted file mode 100644 index 925b68c..0000000 --- a/vendor/feeds_2021/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# sp_feeds_2021 - -SpFeeds2021 - the Ruby gem for the Selling Partner API for Feeds - -The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2021-06-30 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_feeds_2021.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_feeds_2021-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_feeds_2021-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_feeds_2021', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_feeds_2021', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_feeds_2021' - -api_instance = SpFeeds2021::FeedsApi.new -feed_id = 'feed_id_example' # String | The identifier for the feed. This identifier is unique only in combination with a seller ID. - - -begin - api_instance.cancel_feed(feed_id) -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->cancel_feed: #{e}" -end - -api_instance = SpFeeds2021::FeedsApi.new -body = SpFeeds2021::CreateFeedSpecification.new # CreateFeedSpecification | Information required to create the feed. - - -begin - result = api_instance.create_feed(body) - p result -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->create_feed: #{e}" -end - -api_instance = SpFeeds2021::FeedsApi.new -body = SpFeeds2021::CreateFeedDocumentSpecification.new # CreateFeedDocumentSpecification | Specifies the content type for the createFeedDocument operation. - - -begin - result = api_instance.create_feed_document(body) - p result -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->create_feed_document: #{e}" -end - -api_instance = SpFeeds2021::FeedsApi.new -feed_id = 'feed_id_example' # String | The identifier for the feed. This identifier is unique only in combination with a seller ID. - - -begin - result = api_instance.get_feed(feed_id) - p result -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->get_feed: #{e}" -end - -api_instance = SpFeeds2021::FeedsApi.new -feed_document_id = 'feed_document_id_example' # String | The identifier of the feed document. - - -begin - result = api_instance.get_feed_document(feed_document_id) - p result -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->get_feed_document: #{e}" -end - -api_instance = SpFeeds2021::FeedsApi.new -opts = { - feed_types: ['feed_types_example'], # Array | A list of feed types used to filter feeds. When feedTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either feedTypes or nextToken is required. - marketplace_ids: ['marketplace_ids_example'], # Array | A list of marketplace identifiers used to filter feeds. The feeds returned will match at least one of the marketplaces that you specify. - page_size: 10, # Integer | The maximum number of feeds to return in a single call. - processing_statuses: ['processing_statuses_example'], # Array | A list of processing statuses used to filter feeds. - created_since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The earliest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days. - created_until: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The latest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is now. - next_token: 'next_token_example' # String | A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail. -} - -begin - result = api_instance.get_feeds(opts) - p result -rescue SpFeeds2021::ApiError => e - puts "Exception when calling FeedsApi->get_feeds: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpFeeds2021::FeedsApi* | [**cancel_feed**](docs/FeedsApi.md#cancel_feed) | **DELETE** /feeds/2021-06-30/feeds/{feedId} | -*SpFeeds2021::FeedsApi* | [**create_feed**](docs/FeedsApi.md#create_feed) | **POST** /feeds/2021-06-30/feeds | -*SpFeeds2021::FeedsApi* | [**create_feed_document**](docs/FeedsApi.md#create_feed_document) | **POST** /feeds/2021-06-30/documents | -*SpFeeds2021::FeedsApi* | [**get_feed**](docs/FeedsApi.md#get_feed) | **GET** /feeds/2021-06-30/feeds/{feedId} | -*SpFeeds2021::FeedsApi* | [**get_feed_document**](docs/FeedsApi.md#get_feed_document) | **GET** /feeds/2021-06-30/documents/{feedDocumentId} | -*SpFeeds2021::FeedsApi* | [**get_feeds**](docs/FeedsApi.md#get_feeds) | **GET** /feeds/2021-06-30/feeds | - -## Documentation for Models - - - [SpFeeds2021::CreateFeedDocumentResponse](docs/CreateFeedDocumentResponse.md) - - [SpFeeds2021::CreateFeedDocumentSpecification](docs/CreateFeedDocumentSpecification.md) - - [SpFeeds2021::CreateFeedResponse](docs/CreateFeedResponse.md) - - [SpFeeds2021::CreateFeedSpecification](docs/CreateFeedSpecification.md) - - [SpFeeds2021::Error](docs/Error.md) - - [SpFeeds2021::ErrorList](docs/ErrorList.md) - - [SpFeeds2021::Feed](docs/Feed.md) - - [SpFeeds2021::FeedDocument](docs/FeedDocument.md) - - [SpFeeds2021::FeedList](docs/FeedList.md) - - [SpFeeds2021::FeedOptions](docs/FeedOptions.md) - - [SpFeeds2021::GetFeedsResponse](docs/GetFeedsResponse.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/feeds_2021/Rakefile b/vendor/feeds_2021/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/feeds_2021/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/feeds_2021/git_push.sh b/vendor/feeds_2021/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/feeds_2021/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/api_client.rb b/vendor/feeds_2021/lib/sp_feeds_2021/api_client.rb deleted file mode 100644 index 32b2acc..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpFeeds2021 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpFeeds2021.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/api_error.rb b/vendor/feeds_2021/lib/sp_feeds_2021/api_error.rb deleted file mode 100644 index b0e7926..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFeeds2021 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/configuration.rb b/vendor/feeds_2021/lib/sp_feeds_2021/configuration.rb deleted file mode 100644 index 45e94fe..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFeeds2021 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_response.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_response.rb deleted file mode 100644 index eefb1f5..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_response.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Information required to upload a feed document's contents. - class CreateFeedDocumentResponse - # The identifier of the feed document. - attr_accessor :feed_document_id - - # The presigned URL for uploading the feed contents. This URL expires after 5 minutes. - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feed_document_id' => :'feedDocumentId', - :'url' => :'url' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feed_document_id' => :'Object', - :'url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::CreateFeedDocumentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::CreateFeedDocumentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feed_document_id') - self.feed_document_id = attributes[:'feed_document_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feed_document_id.nil? - invalid_properties.push('invalid value for "feed_document_id", feed_document_id cannot be nil.') - end - - if @url.nil? - invalid_properties.push('invalid value for "url", url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feed_document_id.nil? - return false if @url.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feed_document_id == o.feed_document_id && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feed_document_id, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_specification.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_specification.rb deleted file mode 100644 index 218e1c2..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_document_specification.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Specifies the content type for the createFeedDocument operation. - class CreateFeedDocumentSpecification - # The content type of the feed. - attr_accessor :content_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'content_type' => :'contentType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'content_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::CreateFeedDocumentSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::CreateFeedDocumentSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'content_type') - self.content_type = attributes[:'content_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @content_type.nil? - invalid_properties.push('invalid value for "content_type", content_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @content_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - content_type == o.content_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [content_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_response.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_response.rb deleted file mode 100644 index 1d0b4ee..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_response.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Response schema. - class CreateFeedResponse - # The identifier for the feed. This identifier is unique only in combination with a seller ID. - attr_accessor :feed_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feed_id' => :'feedId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feed_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::CreateFeedResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::CreateFeedResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feed_id') - self.feed_id = attributes[:'feed_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feed_id.nil? - invalid_properties.push('invalid value for "feed_id", feed_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feed_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feed_id == o.feed_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feed_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_specification.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_specification.rb deleted file mode 100644 index 16430f4..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/create_feed_specification.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Information required to create the feed. - class CreateFeedSpecification - # The feed type. - attr_accessor :feed_type - - # A list of identifiers for marketplaces that you want the feed to be applied to. - attr_accessor :marketplace_ids - - # The document identifier returned by the createFeedDocument operation. Upload the feed document contents before calling the createFeed operation. - attr_accessor :input_feed_document_id - - attr_accessor :feed_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feed_type' => :'feedType', - :'marketplace_ids' => :'marketplaceIds', - :'input_feed_document_id' => :'inputFeedDocumentId', - :'feed_options' => :'feedOptions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feed_type' => :'Object', - :'marketplace_ids' => :'Object', - :'input_feed_document_id' => :'Object', - :'feed_options' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::CreateFeedSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::CreateFeedSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feed_type') - self.feed_type = attributes[:'feed_type'] - end - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - - if attributes.key?(:'input_feed_document_id') - self.input_feed_document_id = attributes[:'input_feed_document_id'] - end - - if attributes.key?(:'feed_options') - self.feed_options = attributes[:'feed_options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feed_type.nil? - invalid_properties.push('invalid value for "feed_type", feed_type cannot be nil.') - end - - if @marketplace_ids.nil? - invalid_properties.push('invalid value for "marketplace_ids", marketplace_ids cannot be nil.') - end - - if @input_feed_document_id.nil? - invalid_properties.push('invalid value for "input_feed_document_id", input_feed_document_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feed_type.nil? - return false if @marketplace_ids.nil? - return false if @input_feed_document_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feed_type == o.feed_type && - marketplace_ids == o.marketplace_ids && - input_feed_document_id == o.input_feed_document_id && - feed_options == o.feed_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feed_type, marketplace_ids, input_feed_document_id, feed_options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/error.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/error.rb deleted file mode 100644 index f301ae5..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # An error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/error_list.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/error_list.rb deleted file mode 100644 index 96b0117..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/error_list.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # An error response returned when the request is unsuccessful. - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/feed.rb deleted file mode 100644 index ccb8471..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed.rb +++ /dev/null @@ -1,338 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Detailed information about the feed. - class Feed - # The identifier for the feed. This identifier is unique only in combination with a seller ID. - attr_accessor :feed_id - - # The feed type. - attr_accessor :feed_type - - # A list of identifiers for the marketplaces that the feed is applied to. - attr_accessor :marketplace_ids - - # The date and time when the feed was created, in ISO 8601 date time format. - attr_accessor :created_time - - # The processing status of the feed. - attr_accessor :processing_status - - # The date and time when feed processing started, in ISO 8601 date time format. - attr_accessor :processing_start_time - - # The date and time when feed processing completed, in ISO 8601 date time format. - attr_accessor :processing_end_time - - # The identifier for the feed document. This identifier is unique only in combination with a seller ID. - attr_accessor :result_feed_document_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feed_id' => :'feedId', - :'feed_type' => :'feedType', - :'marketplace_ids' => :'marketplaceIds', - :'created_time' => :'createdTime', - :'processing_status' => :'processingStatus', - :'processing_start_time' => :'processingStartTime', - :'processing_end_time' => :'processingEndTime', - :'result_feed_document_id' => :'resultFeedDocumentId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feed_id' => :'Object', - :'feed_type' => :'Object', - :'marketplace_ids' => :'Object', - :'created_time' => :'Object', - :'processing_status' => :'Object', - :'processing_start_time' => :'Object', - :'processing_end_time' => :'Object', - :'result_feed_document_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::Feed` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::Feed`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feed_id') - self.feed_id = attributes[:'feed_id'] - end - - if attributes.key?(:'feed_type') - self.feed_type = attributes[:'feed_type'] - end - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - - if attributes.key?(:'created_time') - self.created_time = attributes[:'created_time'] - end - - if attributes.key?(:'processing_status') - self.processing_status = attributes[:'processing_status'] - end - - if attributes.key?(:'processing_start_time') - self.processing_start_time = attributes[:'processing_start_time'] - end - - if attributes.key?(:'processing_end_time') - self.processing_end_time = attributes[:'processing_end_time'] - end - - if attributes.key?(:'result_feed_document_id') - self.result_feed_document_id = attributes[:'result_feed_document_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feed_id.nil? - invalid_properties.push('invalid value for "feed_id", feed_id cannot be nil.') - end - - if @feed_type.nil? - invalid_properties.push('invalid value for "feed_type", feed_type cannot be nil.') - end - - if @created_time.nil? - invalid_properties.push('invalid value for "created_time", created_time cannot be nil.') - end - - if @processing_status.nil? - invalid_properties.push('invalid value for "processing_status", processing_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feed_id.nil? - return false if @feed_type.nil? - return false if @created_time.nil? - return false if @processing_status.nil? - processing_status_validator = EnumAttributeValidator.new('Object', ['CANCELLED', 'DONE', 'FATAL', 'IN_PROGRESS', 'IN_QUEUE']) - return false unless processing_status_validator.valid?(@processing_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] processing_status Object to be assigned - def processing_status=(processing_status) - validator = EnumAttributeValidator.new('Object', ['CANCELLED', 'DONE', 'FATAL', 'IN_PROGRESS', 'IN_QUEUE']) - unless validator.valid?(processing_status) - fail ArgumentError, "invalid value for \"processing_status\", must be one of #{validator.allowable_values}." - end - @processing_status = processing_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feed_id == o.feed_id && - feed_type == o.feed_type && - marketplace_ids == o.marketplace_ids && - created_time == o.created_time && - processing_status == o.processing_status && - processing_start_time == o.processing_start_time && - processing_end_time == o.processing_end_time && - result_feed_document_id == o.result_feed_document_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feed_id, feed_type, marketplace_ids, created_time, processing_status, processing_start_time, processing_end_time, result_feed_document_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_document.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_document.rb deleted file mode 100644 index 1c4eeec..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_document.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Information required for the feed document. - class FeedDocument - # The identifier for the feed document. This identifier is unique only in combination with a seller ID. - attr_accessor :feed_document_id - - # A presigned URL for the feed document. If `compressionAlgorithm` is not returned, you can download the feed directly from this URL. This URL expires after 5 minutes. - attr_accessor :url - - # If the feed document contents have been compressed, the compression algorithm used is returned in this property and you must decompress the feed when you download. Otherwise, you can download the feed directly. Refer to [Step 7. Download the feed processing report](doc:feeds-api-v2021-06-30-use-case-guide#step-7-download-the-feed-processing-report) in the use case guide, where sample code is provided. - attr_accessor :compression_algorithm - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feed_document_id' => :'feedDocumentId', - :'url' => :'url', - :'compression_algorithm' => :'compressionAlgorithm' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feed_document_id' => :'Object', - :'url' => :'Object', - :'compression_algorithm' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::FeedDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::FeedDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feed_document_id') - self.feed_document_id = attributes[:'feed_document_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'compression_algorithm') - self.compression_algorithm = attributes[:'compression_algorithm'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feed_document_id.nil? - invalid_properties.push('invalid value for "feed_document_id", feed_document_id cannot be nil.') - end - - if @url.nil? - invalid_properties.push('invalid value for "url", url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feed_document_id.nil? - return false if @url.nil? - compression_algorithm_validator = EnumAttributeValidator.new('Object', ['GZIP']) - return false unless compression_algorithm_validator.valid?(@compression_algorithm) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] compression_algorithm Object to be assigned - def compression_algorithm=(compression_algorithm) - validator = EnumAttributeValidator.new('Object', ['GZIP']) - unless validator.valid?(compression_algorithm) - fail ArgumentError, "invalid value for \"compression_algorithm\", must be one of #{validator.allowable_values}." - end - @compression_algorithm = compression_algorithm - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feed_document_id == o.feed_document_id && - url == o.url && - compression_algorithm == o.compression_algorithm - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feed_document_id, url, compression_algorithm].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_list.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_list.rb deleted file mode 100644 index 69152b8..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # A list of feeds. - class FeedList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::FeedList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::FeedList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_options.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_options.rb deleted file mode 100644 index 5864461..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/feed_options.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Additional options to control the feed. These vary by feed type. - class FeedOptions - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::FeedOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::FeedOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/models/get_feeds_response.rb b/vendor/feeds_2021/lib/sp_feeds_2021/models/get_feeds_response.rb deleted file mode 100644 index 80001c0..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/models/get_feeds_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFeeds2021 - # Response schema. - class GetFeedsResponse - attr_accessor :feeds - - # Returned when the number of results exceeds pageSize. To get the next page of results, call the getFeeds operation with this token as the only parameter. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feeds' => :'feeds', - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feeds' => :'Object', - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFeeds2021::GetFeedsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFeeds2021::GetFeedsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feeds') - self.feeds = attributes[:'feeds'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feeds.nil? - invalid_properties.push('invalid value for "feeds", feeds cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feeds.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feeds == o.feeds && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feeds, next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFeeds2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/version.rb b/vendor/feeds_2021/lib/sp_feeds_2021/version.rb deleted file mode 100644 index 8998013..0000000 --- a/vendor/feeds_2021/lib/sp_feeds_2021/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpFeeds2021 - VERSION = '1.0.0' -end diff --git a/vendor/feeds_2021/sp_feeds_2021.gemspec b/vendor/feeds_2021/sp_feeds_2021.gemspec deleted file mode 100644 index 48eda55..0000000 --- a/vendor/feeds_2021/sp_feeds_2021.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Feeds - -#The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_feeds_2021/version" - -Gem::Specification.new do |s| - s.name = "sp_feeds_2021" - s.version = SpFeeds2021::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Feeds Ruby Gem" - s.description = "The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/fulfillment_outbound_2020/.gitignore b/vendor/fulfillment_outbound_2020/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/fulfillment_outbound_2020/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/fulfillment_outbound_2020/.rspec b/vendor/fulfillment_outbound_2020/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/fulfillment_outbound_2020/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/fulfillment_outbound_2020/.rubocop.yml b/vendor/fulfillment_outbound_2020/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/fulfillment_outbound_2020/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/fulfillment_outbound_2020/.swagger-codegen-ignore b/vendor/fulfillment_outbound_2020/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/fulfillment_outbound_2020/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/fulfillment_outbound_2020/.swagger-codegen/VERSION b/vendor/fulfillment_outbound_2020/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/fulfillment_outbound_2020/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/fulfillment_outbound_2020/Gemfile b/vendor/fulfillment_outbound_2020/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/fulfillment_outbound_2020/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/fulfillment_outbound_2020/README.md b/vendor/fulfillment_outbound_2020/README.md deleted file mode 100644 index 7a6d0bb..0000000 --- a/vendor/fulfillment_outbound_2020/README.md +++ /dev/null @@ -1,374 +0,0 @@ -# sp_fulfillment_outbound_2020 - -SpFulfillmentOutbound2020 - the Ruby gem for the Selling Partner APIs for Fulfillment Outbound - -The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2020-07-01 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_fulfillment_outbound_2020.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_fulfillment_outbound_2020-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_fulfillment_outbound_2020-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_fulfillment_outbound_2020', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_fulfillment_outbound_2020', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_fulfillment_outbound_2020' - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -seller_fulfillment_order_id = 'seller_fulfillment_order_id_example' # String | The identifier assigned to the item by the seller when the fulfillment order was created. - - -begin - result = api_instance.cancel_fulfillment_order(seller_fulfillment_order_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->cancel_fulfillment_order: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::CreateFulfillmentOrderRequest.new # CreateFulfillmentOrderRequest | CreateFulfillmentOrderRequest parameter - - -begin - result = api_instance.create_fulfillment_order(body) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->create_fulfillment_order: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::CreateFulfillmentReturnRequest.new # CreateFulfillmentReturnRequest | CreateFulfillmentReturnRequest parameter -seller_fulfillment_order_id = 'seller_fulfillment_order_id_example' # String | An identifier assigned by the seller to the fulfillment order at the time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value based on the buyer's request to return items. - - -begin - result = api_instance.create_fulfillment_return(body, seller_fulfillment_order_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->create_fulfillment_return: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::GetDeliveryOffersRequest.new # GetDeliveryOffersRequest | GetDeliveryOffersRequest parameter - - -begin - result = api_instance.delivery_offers(body) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->delivery_offers: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -marketplace_id = 'marketplace_id_example' # String | The marketplace for which to return a list of the inventory that is eligible for the specified feature. -feature_name = 'feature_name_example' # String | The name of the feature for which to return a list of eligible inventory. -opts = { - next_token: 'next_token_example', # String | A string token returned in the response to your previous request that is used to return the next response page. A value of null will return the first page. - query_start_date: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format yyyy-MM-ddTHH:mm:ss.sssZ -} - -begin - result = api_instance.get_feature_inventory(marketplace_id, feature_name, opts) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_feature_inventory: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -marketplace_id = 'marketplace_id_example' # String | The marketplace for which to return the count. -feature_name = 'feature_name_example' # String | The name of the feature. -seller_sku = 'seller_sku_example' # String | Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's `SellerId`, which is included with every operation that you submit. - - -begin - result = api_instance.get_feature_sku(marketplace_id, feature_name, seller_sku) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_feature_sku: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -marketplace_id = 'marketplace_id_example' # String | The marketplace for which to return the list of features. - - -begin - result = api_instance.get_features(marketplace_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_features: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -seller_fulfillment_order_id = 'seller_fulfillment_order_id_example' # String | The identifier assigned to the item by the seller when the fulfillment order was created. - - -begin - result = api_instance.get_fulfillment_order(seller_fulfillment_order_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_fulfillment_order: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::GetFulfillmentPreviewRequest.new # GetFulfillmentPreviewRequest | GetFulfillmentPreviewRequest parameter - - -begin - result = api_instance.get_fulfillment_preview(body) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_fulfillment_preview: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -package_number = 56 # Integer | The unencrypted package identifier returned by the `getFulfillmentOrder` operation. - - -begin - result = api_instance.get_package_tracking_details(package_number) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->get_package_tracking_details: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -opts = { - query_start_date: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date used to select fulfillment orders that were last updated after (or at) a specified time. An update is defined as any change in fulfillment order status, including the creation of a new fulfillment order. - next_token: 'next_token_example' # String | A string token returned in the response to your previous request. -} - -begin - result = api_instance.list_all_fulfillment_orders(opts) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->list_all_fulfillment_orders: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -seller_sku = 'seller_sku_example' # String | The seller SKU for which return reason codes are required. -opts = { - marketplace_id: 'marketplace_id_example', # String | The marketplace for which the seller wants return reason codes. - seller_fulfillment_order_id: 'seller_fulfillment_order_id_example', # String | The identifier assigned to the item by the seller when the fulfillment order was created. The service uses this value to determine the marketplace for which the seller wants return reason codes. - language: 'language_example' # String | The language that the `TranslatedDescription` property of the `ReasonCodeDetails` response object should be translated into. -} - -begin - result = api_instance.list_return_reason_codes(seller_sku, opts) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->list_return_reason_codes: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateRequest.new # SubmitFulfillmentOrderStatusUpdateRequest | The identifier assigned to the item by the seller when the fulfillment order was created. -seller_fulfillment_order_id = 'seller_fulfillment_order_id_example' # String | The identifier assigned to the item by the seller when the fulfillment order was created. - - -begin - result = api_instance.submit_fulfillment_order_status_update(body, seller_fulfillment_order_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->submit_fulfillment_order_status_update: #{e}" -end - -api_instance = SpFulfillmentOutbound2020::FbaOutboundApi.new -body = SpFulfillmentOutbound2020::UpdateFulfillmentOrderRequest.new # UpdateFulfillmentOrderRequest | UpdateFulfillmentOrderRequest parameter -seller_fulfillment_order_id = 'seller_fulfillment_order_id_example' # String | The identifier assigned to the item by the seller when the fulfillment order was created. - - -begin - result = api_instance.update_fulfillment_order(body, seller_fulfillment_order_id) - p result -rescue SpFulfillmentOutbound2020::ApiError => e - puts "Exception when calling FbaOutboundApi->update_fulfillment_order: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**cancel_fulfillment_order**](docs/FbaOutboundApi.md#cancel_fulfillment_order) | **PUT** /fba/outbound/2020-07-01/fulfillmentOrders/{sellerFulfillmentOrderId}/cancel | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**create_fulfillment_order**](docs/FbaOutboundApi.md#create_fulfillment_order) | **POST** /fba/outbound/2020-07-01/fulfillmentOrders | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**create_fulfillment_return**](docs/FbaOutboundApi.md#create_fulfillment_return) | **PUT** /fba/outbound/2020-07-01/fulfillmentOrders/{sellerFulfillmentOrderId}/return | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**delivery_offers**](docs/FbaOutboundApi.md#delivery_offers) | **POST** /fba/outbound/2020-07-01/deliveryOffers | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_feature_inventory**](docs/FbaOutboundApi.md#get_feature_inventory) | **GET** /fba/outbound/2020-07-01/features/inventory/{featureName} | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_feature_sku**](docs/FbaOutboundApi.md#get_feature_sku) | **GET** /fba/outbound/2020-07-01/features/inventory/{featureName}/{sellerSku} | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_features**](docs/FbaOutboundApi.md#get_features) | **GET** /fba/outbound/2020-07-01/features | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_fulfillment_order**](docs/FbaOutboundApi.md#get_fulfillment_order) | **GET** /fba/outbound/2020-07-01/fulfillmentOrders/{sellerFulfillmentOrderId} | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_fulfillment_preview**](docs/FbaOutboundApi.md#get_fulfillment_preview) | **POST** /fba/outbound/2020-07-01/fulfillmentOrders/preview | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**get_package_tracking_details**](docs/FbaOutboundApi.md#get_package_tracking_details) | **GET** /fba/outbound/2020-07-01/tracking | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**list_all_fulfillment_orders**](docs/FbaOutboundApi.md#list_all_fulfillment_orders) | **GET** /fba/outbound/2020-07-01/fulfillmentOrders | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**list_return_reason_codes**](docs/FbaOutboundApi.md#list_return_reason_codes) | **GET** /fba/outbound/2020-07-01/returnReasonCodes | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**submit_fulfillment_order_status_update**](docs/FbaOutboundApi.md#submit_fulfillment_order_status_update) | **PUT** /fba/outbound/2020-07-01/fulfillmentOrders/{sellerFulfillmentOrderId}/status | -*SpFulfillmentOutbound2020::FbaOutboundApi* | [**update_fulfillment_order**](docs/FbaOutboundApi.md#update_fulfillment_order) | **PUT** /fba/outbound/2020-07-01/fulfillmentOrders/{sellerFulfillmentOrderId} | - -## Documentation for Models - - - [SpFulfillmentOutbound2020::AdditionalLocationInfo](docs/AdditionalLocationInfo.md) - - [SpFulfillmentOutbound2020::Address](docs/Address.md) - - [SpFulfillmentOutbound2020::Amount](docs/Amount.md) - - [SpFulfillmentOutbound2020::CODSettings](docs/CODSettings.md) - - [SpFulfillmentOutbound2020::CancelFulfillmentOrderResponse](docs/CancelFulfillmentOrderResponse.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentOrderItem](docs/CreateFulfillmentOrderItem.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentOrderItemList](docs/CreateFulfillmentOrderItemList.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentOrderRequest](docs/CreateFulfillmentOrderRequest.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentOrderResponse](docs/CreateFulfillmentOrderResponse.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentReturnRequest](docs/CreateFulfillmentReturnRequest.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentReturnResponse](docs/CreateFulfillmentReturnResponse.md) - - [SpFulfillmentOutbound2020::CreateFulfillmentReturnResult](docs/CreateFulfillmentReturnResult.md) - - [SpFulfillmentOutbound2020::CreateReturnItem](docs/CreateReturnItem.md) - - [SpFulfillmentOutbound2020::CreateReturnItemList](docs/CreateReturnItemList.md) - - [SpFulfillmentOutbound2020::CurrentStatus](docs/CurrentStatus.md) - - [SpFulfillmentOutbound2020::DateRange](docs/DateRange.md) - - [SpFulfillmentOutbound2020::Decimal](docs/Decimal.md) - - [SpFulfillmentOutbound2020::DeliveryDocument](docs/DeliveryDocument.md) - - [SpFulfillmentOutbound2020::DeliveryDocumentList](docs/DeliveryDocumentList.md) - - [SpFulfillmentOutbound2020::DeliveryInformation](docs/DeliveryInformation.md) - - [SpFulfillmentOutbound2020::DeliveryMessage](docs/DeliveryMessage.md) - - [SpFulfillmentOutbound2020::DeliveryOffer](docs/DeliveryOffer.md) - - [SpFulfillmentOutbound2020::DeliveryOffersList](docs/DeliveryOffersList.md) - - [SpFulfillmentOutbound2020::DeliveryPolicy](docs/DeliveryPolicy.md) - - [SpFulfillmentOutbound2020::DeliveryPreferences](docs/DeliveryPreferences.md) - - [SpFulfillmentOutbound2020::DeliveryWindow](docs/DeliveryWindow.md) - - [SpFulfillmentOutbound2020::DeliveryWindowList](docs/DeliveryWindowList.md) - - [SpFulfillmentOutbound2020::Destination](docs/Destination.md) - - [SpFulfillmentOutbound2020::DropOffLocation](docs/DropOffLocation.md) - - [SpFulfillmentOutbound2020::Error](docs/Error.md) - - [SpFulfillmentOutbound2020::ErrorList](docs/ErrorList.md) - - [SpFulfillmentOutbound2020::EventCode](docs/EventCode.md) - - [SpFulfillmentOutbound2020::Feature](docs/Feature.md) - - [SpFulfillmentOutbound2020::FeatureSettings](docs/FeatureSettings.md) - - [SpFulfillmentOutbound2020::FeatureSku](docs/FeatureSku.md) - - [SpFulfillmentOutbound2020::Features](docs/Features.md) - - [SpFulfillmentOutbound2020::Fee](docs/Fee.md) - - [SpFulfillmentOutbound2020::FeeList](docs/FeeList.md) - - [SpFulfillmentOutbound2020::FulfillmentAction](docs/FulfillmentAction.md) - - [SpFulfillmentOutbound2020::FulfillmentOrder](docs/FulfillmentOrder.md) - - [SpFulfillmentOutbound2020::FulfillmentOrderItem](docs/FulfillmentOrderItem.md) - - [SpFulfillmentOutbound2020::FulfillmentOrderItemList](docs/FulfillmentOrderItemList.md) - - [SpFulfillmentOutbound2020::FulfillmentOrderStatus](docs/FulfillmentOrderStatus.md) - - [SpFulfillmentOutbound2020::FulfillmentPolicy](docs/FulfillmentPolicy.md) - - [SpFulfillmentOutbound2020::FulfillmentPreview](docs/FulfillmentPreview.md) - - [SpFulfillmentOutbound2020::FulfillmentPreviewItem](docs/FulfillmentPreviewItem.md) - - [SpFulfillmentOutbound2020::FulfillmentPreviewItemList](docs/FulfillmentPreviewItemList.md) - - [SpFulfillmentOutbound2020::FulfillmentPreviewList](docs/FulfillmentPreviewList.md) - - [SpFulfillmentOutbound2020::FulfillmentPreviewShipment](docs/FulfillmentPreviewShipment.md) - - [SpFulfillmentOutbound2020::FulfillmentPreviewShipmentList](docs/FulfillmentPreviewShipmentList.md) - - [SpFulfillmentOutbound2020::FulfillmentReturnItemStatus](docs/FulfillmentReturnItemStatus.md) - - [SpFulfillmentOutbound2020::FulfillmentShipment](docs/FulfillmentShipment.md) - - [SpFulfillmentOutbound2020::FulfillmentShipmentItem](docs/FulfillmentShipmentItem.md) - - [SpFulfillmentOutbound2020::FulfillmentShipmentItemList](docs/FulfillmentShipmentItemList.md) - - [SpFulfillmentOutbound2020::FulfillmentShipmentList](docs/FulfillmentShipmentList.md) - - [SpFulfillmentOutbound2020::FulfillmentShipmentPackage](docs/FulfillmentShipmentPackage.md) - - [SpFulfillmentOutbound2020::FulfillmentShipmentPackageList](docs/FulfillmentShipmentPackageList.md) - - [SpFulfillmentOutbound2020::GetDeliveryOffersProduct](docs/GetDeliveryOffersProduct.md) - - [SpFulfillmentOutbound2020::GetDeliveryOffersRequest](docs/GetDeliveryOffersRequest.md) - - [SpFulfillmentOutbound2020::GetDeliveryOffersResponse](docs/GetDeliveryOffersResponse.md) - - [SpFulfillmentOutbound2020::GetDeliveryOffersResult](docs/GetDeliveryOffersResult.md) - - [SpFulfillmentOutbound2020::GetDeliveryOffersTerms](docs/GetDeliveryOffersTerms.md) - - [SpFulfillmentOutbound2020::GetFeatureInventoryResponse](docs/GetFeatureInventoryResponse.md) - - [SpFulfillmentOutbound2020::GetFeatureInventoryResult](docs/GetFeatureInventoryResult.md) - - [SpFulfillmentOutbound2020::GetFeatureSkuResponse](docs/GetFeatureSkuResponse.md) - - [SpFulfillmentOutbound2020::GetFeatureSkuResult](docs/GetFeatureSkuResult.md) - - [SpFulfillmentOutbound2020::GetFeaturesResponse](docs/GetFeaturesResponse.md) - - [SpFulfillmentOutbound2020::GetFeaturesResult](docs/GetFeaturesResult.md) - - [SpFulfillmentOutbound2020::GetFulfillmentOrderResponse](docs/GetFulfillmentOrderResponse.md) - - [SpFulfillmentOutbound2020::GetFulfillmentOrderResult](docs/GetFulfillmentOrderResult.md) - - [SpFulfillmentOutbound2020::GetFulfillmentPreviewItem](docs/GetFulfillmentPreviewItem.md) - - [SpFulfillmentOutbound2020::GetFulfillmentPreviewItemList](docs/GetFulfillmentPreviewItemList.md) - - [SpFulfillmentOutbound2020::GetFulfillmentPreviewRequest](docs/GetFulfillmentPreviewRequest.md) - - [SpFulfillmentOutbound2020::GetFulfillmentPreviewResponse](docs/GetFulfillmentPreviewResponse.md) - - [SpFulfillmentOutbound2020::GetFulfillmentPreviewResult](docs/GetFulfillmentPreviewResult.md) - - [SpFulfillmentOutbound2020::GetPackageTrackingDetailsResponse](docs/GetPackageTrackingDetailsResponse.md) - - [SpFulfillmentOutbound2020::InvalidItemReason](docs/InvalidItemReason.md) - - [SpFulfillmentOutbound2020::InvalidItemReasonCode](docs/InvalidItemReasonCode.md) - - [SpFulfillmentOutbound2020::InvalidReturnItem](docs/InvalidReturnItem.md) - - [SpFulfillmentOutbound2020::InvalidReturnItemList](docs/InvalidReturnItemList.md) - - [SpFulfillmentOutbound2020::IpAddress](docs/IpAddress.md) - - [SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResponse](docs/ListAllFulfillmentOrdersResponse.md) - - [SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResult](docs/ListAllFulfillmentOrdersResult.md) - - [SpFulfillmentOutbound2020::ListReturnReasonCodesResponse](docs/ListReturnReasonCodesResponse.md) - - [SpFulfillmentOutbound2020::ListReturnReasonCodesResult](docs/ListReturnReasonCodesResult.md) - - [SpFulfillmentOutbound2020::LockerDetails](docs/LockerDetails.md) - - [SpFulfillmentOutbound2020::Money](docs/Money.md) - - [SpFulfillmentOutbound2020::NotificationEmailList](docs/NotificationEmailList.md) - - [SpFulfillmentOutbound2020::Origin](docs/Origin.md) - - [SpFulfillmentOutbound2020::PackageTrackingDetails](docs/PackageTrackingDetails.md) - - [SpFulfillmentOutbound2020::PaymentInformation](docs/PaymentInformation.md) - - [SpFulfillmentOutbound2020::PaymentInformationList](docs/PaymentInformationList.md) - - [SpFulfillmentOutbound2020::ProductIdentifier](docs/ProductIdentifier.md) - - [SpFulfillmentOutbound2020::Quantity](docs/Quantity.md) - - [SpFulfillmentOutbound2020::ReasonCodeDetails](docs/ReasonCodeDetails.md) - - [SpFulfillmentOutbound2020::ReasonCodeDetailsList](docs/ReasonCodeDetailsList.md) - - [SpFulfillmentOutbound2020::ReturnAuthorization](docs/ReturnAuthorization.md) - - [SpFulfillmentOutbound2020::ReturnAuthorizationList](docs/ReturnAuthorizationList.md) - - [SpFulfillmentOutbound2020::ReturnItem](docs/ReturnItem.md) - - [SpFulfillmentOutbound2020::ReturnItemDisposition](docs/ReturnItemDisposition.md) - - [SpFulfillmentOutbound2020::ReturnItemList](docs/ReturnItemList.md) - - [SpFulfillmentOutbound2020::ScheduledDeliveryInfo](docs/ScheduledDeliveryInfo.md) - - [SpFulfillmentOutbound2020::ShippingSpeedCategory](docs/ShippingSpeedCategory.md) - - [SpFulfillmentOutbound2020::ShippingSpeedCategoryList](docs/ShippingSpeedCategoryList.md) - - [SpFulfillmentOutbound2020::StringList](docs/StringList.md) - - [SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateRequest](docs/SubmitFulfillmentOrderStatusUpdateRequest.md) - - [SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateResponse](docs/SubmitFulfillmentOrderStatusUpdateResponse.md) - - [SpFulfillmentOutbound2020::Timestamp](docs/Timestamp.md) - - [SpFulfillmentOutbound2020::TrackingAddress](docs/TrackingAddress.md) - - [SpFulfillmentOutbound2020::TrackingEvent](docs/TrackingEvent.md) - - [SpFulfillmentOutbound2020::TrackingEventList](docs/TrackingEventList.md) - - [SpFulfillmentOutbound2020::UnfulfillablePreviewItem](docs/UnfulfillablePreviewItem.md) - - [SpFulfillmentOutbound2020::UnfulfillablePreviewItemList](docs/UnfulfillablePreviewItemList.md) - - [SpFulfillmentOutbound2020::UpdateFulfillmentOrderItem](docs/UpdateFulfillmentOrderItem.md) - - [SpFulfillmentOutbound2020::UpdateFulfillmentOrderItemList](docs/UpdateFulfillmentOrderItemList.md) - - [SpFulfillmentOutbound2020::UpdateFulfillmentOrderRequest](docs/UpdateFulfillmentOrderRequest.md) - - [SpFulfillmentOutbound2020::UpdateFulfillmentOrderResponse](docs/UpdateFulfillmentOrderResponse.md) - - [SpFulfillmentOutbound2020::VariablePrecisionAddress](docs/VariablePrecisionAddress.md) - - [SpFulfillmentOutbound2020::Weight](docs/Weight.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/fulfillment_outbound_2020/Rakefile b/vendor/fulfillment_outbound_2020/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/fulfillment_outbound_2020/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/fulfillment_outbound_2020/git_push.sh b/vendor/fulfillment_outbound_2020/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/fulfillment_outbound_2020/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_client.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_client.rb deleted file mode 100644 index 0799ae7..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpFulfillmentOutbound2020.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_error.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_error.rb deleted file mode 100644 index 71bd7ca..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/configuration.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/configuration.rb deleted file mode 100644 index 5865eff..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/additional_location_info.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/additional_location_info.rb deleted file mode 100644 index d0335c5..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/additional_location_info.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class AdditionalLocationInfo - AS_INSTRUCTED = 'AS_INSTRUCTED'.freeze - CARPORT = 'CARPORT'.freeze - CUSTOMER_PICKUP = 'CUSTOMER_PICKUP'.freeze - DECK = 'DECK'.freeze - DOOR_PERSON = 'DOOR_PERSON'.freeze - FRONT_DESK = 'FRONT_DESK'.freeze - FRONT_DOOR = 'FRONT_DOOR'.freeze - GARAGE = 'GARAGE'.freeze - GUARD = 'GUARD'.freeze - MAIL_ROOM = 'MAIL_ROOM'.freeze - MAIL_SLOT = 'MAIL_SLOT'.freeze - MAILBOX = 'MAILBOX'.freeze - MC_BOY = 'MC_BOY'.freeze - MC_GIRL = 'MC_GIRL'.freeze - MC_MAN = 'MC_MAN'.freeze - MC_WOMAN = 'MC_WOMAN'.freeze - NEIGHBOR = 'NEIGHBOR'.freeze - OFFICE = 'OFFICE'.freeze - OUTBUILDING = 'OUTBUILDING'.freeze - PATIO = 'PATIO'.freeze - PORCH = 'PORCH'.freeze - REAR_DOOR = 'REAR_DOOR'.freeze - RECEPTIONIST = 'RECEPTIONIST'.freeze - RECEIVER = 'RECEIVER'.freeze - SECURE_LOCATION = 'SECURE_LOCATION'.freeze - SIDE_DOOR = 'SIDE_DOOR'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AdditionalLocationInfo.constants.select { |c| AdditionalLocationInfo::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AdditionalLocationInfo" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/address.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/address.rb deleted file mode 100644 index 36d9ae5..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/address.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A physical address. - class Address - # The name of the person, business or institution at the address. - attr_accessor :name - - # The first line of the address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - # The city where the person, business, or institution is located. This property is required in all countries except Japan. It should not be used in Japan. - attr_accessor :city - - # The district or county where the person, business, or institution is located. - attr_accessor :district_or_county - - # The state or region where the person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of the address. - attr_accessor :postal_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business, or institution located at the address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'district_or_county' => :'districtOrCounty', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'district_or_county' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'district_or_county') - self.district_or_county = attributes[:'district_or_county'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @state_or_region.nil? - invalid_properties.push('invalid value for "state_or_region", state_or_region cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @state_or_region.nil? - return false if @postal_code.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - district_or_county == o.district_or_county && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, district_or_county, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/amount.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/amount.rb deleted file mode 100644 index ea1fdd1..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/amount.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A quantity based on unit of measure. - class Amount - # The unit of measure for the amount. - attr_accessor :unit_of_measure - - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Amount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Amount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Eaches']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Eaches']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cancel_fulfillment_order_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cancel_fulfillment_order_response.rb deleted file mode 100644 index d1c38d2..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cancel_fulfillment_order_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `cancelFulfillmentOrder` operation. - class CancelFulfillmentOrderResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CancelFulfillmentOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CancelFulfillmentOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cod_settings.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cod_settings.rb deleted file mode 100644 index 10457aa..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/cod_settings.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The COD (Cash On Delivery) charges that you associate with a COD fulfillment order. - class CODSettings - # When true, this fulfillment order requires a COD (Cash On Delivery) payment. - attr_accessor :is_cod_required - - attr_accessor :cod_charge - - attr_accessor :cod_charge_tax - - attr_accessor :shipping_charge - - attr_accessor :shipping_charge_tax - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_cod_required' => :'isCodRequired', - :'cod_charge' => :'codCharge', - :'cod_charge_tax' => :'codChargeTax', - :'shipping_charge' => :'shippingCharge', - :'shipping_charge_tax' => :'shippingChargeTax' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_cod_required' => :'Object', - :'cod_charge' => :'Object', - :'cod_charge_tax' => :'Object', - :'shipping_charge' => :'Object', - :'shipping_charge_tax' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CODSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CODSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_cod_required') - self.is_cod_required = attributes[:'is_cod_required'] - end - - if attributes.key?(:'cod_charge') - self.cod_charge = attributes[:'cod_charge'] - end - - if attributes.key?(:'cod_charge_tax') - self.cod_charge_tax = attributes[:'cod_charge_tax'] - end - - if attributes.key?(:'shipping_charge') - self.shipping_charge = attributes[:'shipping_charge'] - end - - if attributes.key?(:'shipping_charge_tax') - self.shipping_charge_tax = attributes[:'shipping_charge_tax'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_cod_required.nil? - invalid_properties.push('invalid value for "is_cod_required", is_cod_required cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_cod_required.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_cod_required == o.is_cod_required && - cod_charge == o.cod_charge && - cod_charge_tax == o.cod_charge_tax && - shipping_charge == o.shipping_charge && - shipping_charge_tax == o.shipping_charge_tax - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_cod_required, cod_charge, cod_charge_tax, shipping_charge, shipping_charge_tax].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item.rb deleted file mode 100644 index 5fc1363..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for creating a fulfillment order. - class CreateFulfillmentOrderItem - # The seller SKU of the item. - attr_accessor :seller_sku - - # A fulfillment order item identifier that the seller creates to track fulfillment order items. Used to disambiguate multiple fulfillment items that have the same `SellerSKU`. For example, the seller might assign different `SellerFulfillmentOrderItemId` values to two items in a fulfillment order that share the same `SellerSKU` but have different `GiftMessage` values. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :quantity - - # A message to the gift recipient, if applicable. - attr_accessor :gift_message - - # Item-specific text that displays in recipient-facing materials such as the outbound shipment packing slip. - attr_accessor :displayable_comment - - # Amazon's fulfillment network SKU of the item. - attr_accessor :fulfillment_network_sku - - attr_accessor :per_unit_declared_value - - attr_accessor :per_unit_price - - attr_accessor :per_unit_tax - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'quantity' => :'quantity', - :'gift_message' => :'giftMessage', - :'displayable_comment' => :'displayableComment', - :'fulfillment_network_sku' => :'fulfillmentNetworkSku', - :'per_unit_declared_value' => :'perUnitDeclaredValue', - :'per_unit_price' => :'perUnitPrice', - :'per_unit_tax' => :'perUnitTax' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'quantity' => :'Object', - :'gift_message' => :'Object', - :'displayable_comment' => :'Object', - :'fulfillment_network_sku' => :'Object', - :'per_unit_declared_value' => :'Object', - :'per_unit_price' => :'Object', - :'per_unit_tax' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'gift_message') - self.gift_message = attributes[:'gift_message'] - end - - if attributes.key?(:'displayable_comment') - self.displayable_comment = attributes[:'displayable_comment'] - end - - if attributes.key?(:'fulfillment_network_sku') - self.fulfillment_network_sku = attributes[:'fulfillment_network_sku'] - end - - if attributes.key?(:'per_unit_declared_value') - self.per_unit_declared_value = attributes[:'per_unit_declared_value'] - end - - if attributes.key?(:'per_unit_price') - self.per_unit_price = attributes[:'per_unit_price'] - end - - if attributes.key?(:'per_unit_tax') - self.per_unit_tax = attributes[:'per_unit_tax'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - quantity == o.quantity && - gift_message == o.gift_message && - displayable_comment == o.displayable_comment && - fulfillment_network_sku == o.fulfillment_network_sku && - per_unit_declared_value == o.per_unit_declared_value && - per_unit_price == o.per_unit_price && - per_unit_tax == o.per_unit_tax - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, seller_fulfillment_order_item_id, quantity, gift_message, displayable_comment, fulfillment_network_sku, per_unit_declared_value, per_unit_price, per_unit_tax].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item_list.rb deleted file mode 100644 index e4e4337..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of item information for creating a fulfillment order. - class CreateFulfillmentOrderItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_request.rb deleted file mode 100644 index f3395e8..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_request.rb +++ /dev/null @@ -1,398 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request body schema for the `createFulfillmentOrder` operation. - class CreateFulfillmentOrderRequest - # The marketplace the fulfillment order is placed against. - attr_accessor :marketplace_id - - # A fulfillment order identifier that the seller creates to track their fulfillment order. The `SellerFulfillmentOrderId` must be unique for each fulfillment order that a seller creates. If the seller's system already creates unique order identifiers, then these might be good values for them to use. - attr_accessor :seller_fulfillment_order_id - - # A fulfillment order identifier that the seller creates. This value displays as the order identifier in recipient-facing materials such as the outbound shipment packing slip. The value of `DisplayableOrderId` should match the order identifier that the seller provides to the recipient. The seller can use the `SellerFulfillmentOrderId` for this value or they can specify an alternate value if they want the recipient to reference an alternate order identifier. The value must be an alpha-numeric or ISO 8859-1 compliant string from one to 40 characters in length. Cannot contain two spaces in a row. Leading and trailing white space is removed. - attr_accessor :displayable_order_id - - attr_accessor :displayable_order_date - - # Order-specific text that appears in recipient-facing materials such as the outbound shipment packing slip. - attr_accessor :displayable_order_comment - - attr_accessor :shipping_speed_category - - attr_accessor :delivery_window - - attr_accessor :destination_address - - attr_accessor :delivery_preferences - - attr_accessor :fulfillment_action - - attr_accessor :fulfillment_policy - - attr_accessor :cod_settings - - # The two-character country code for the country from which the fulfillment order ships. Must be in ISO 3166-1 alpha-2 format. - attr_accessor :ship_from_country_code - - attr_accessor :notification_emails - - # A list of features and their fulfillment policies to apply to the order. - attr_accessor :feature_constraints - - attr_accessor :items - - attr_accessor :payment_information - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'seller_fulfillment_order_id' => :'sellerFulfillmentOrderId', - :'displayable_order_id' => :'displayableOrderId', - :'displayable_order_date' => :'displayableOrderDate', - :'displayable_order_comment' => :'displayableOrderComment', - :'shipping_speed_category' => :'shippingSpeedCategory', - :'delivery_window' => :'deliveryWindow', - :'destination_address' => :'destinationAddress', - :'delivery_preferences' => :'deliveryPreferences', - :'fulfillment_action' => :'fulfillmentAction', - :'fulfillment_policy' => :'fulfillmentPolicy', - :'cod_settings' => :'codSettings', - :'ship_from_country_code' => :'shipFromCountryCode', - :'notification_emails' => :'notificationEmails', - :'feature_constraints' => :'featureConstraints', - :'items' => :'items', - :'payment_information' => :'paymentInformation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'seller_fulfillment_order_id' => :'Object', - :'displayable_order_id' => :'Object', - :'displayable_order_date' => :'Object', - :'displayable_order_comment' => :'Object', - :'shipping_speed_category' => :'Object', - :'delivery_window' => :'Object', - :'destination_address' => :'Object', - :'delivery_preferences' => :'Object', - :'fulfillment_action' => :'Object', - :'fulfillment_policy' => :'Object', - :'cod_settings' => :'Object', - :'ship_from_country_code' => :'Object', - :'notification_emails' => :'Object', - :'feature_constraints' => :'Object', - :'items' => :'Object', - :'payment_information' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'seller_fulfillment_order_id') - self.seller_fulfillment_order_id = attributes[:'seller_fulfillment_order_id'] - end - - if attributes.key?(:'displayable_order_id') - self.displayable_order_id = attributes[:'displayable_order_id'] - end - - if attributes.key?(:'displayable_order_date') - self.displayable_order_date = attributes[:'displayable_order_date'] - end - - if attributes.key?(:'displayable_order_comment') - self.displayable_order_comment = attributes[:'displayable_order_comment'] - end - - if attributes.key?(:'shipping_speed_category') - self.shipping_speed_category = attributes[:'shipping_speed_category'] - end - - if attributes.key?(:'delivery_window') - self.delivery_window = attributes[:'delivery_window'] - end - - if attributes.key?(:'destination_address') - self.destination_address = attributes[:'destination_address'] - end - - if attributes.key?(:'delivery_preferences') - self.delivery_preferences = attributes[:'delivery_preferences'] - end - - if attributes.key?(:'fulfillment_action') - self.fulfillment_action = attributes[:'fulfillment_action'] - end - - if attributes.key?(:'fulfillment_policy') - self.fulfillment_policy = attributes[:'fulfillment_policy'] - end - - if attributes.key?(:'cod_settings') - self.cod_settings = attributes[:'cod_settings'] - end - - if attributes.key?(:'ship_from_country_code') - self.ship_from_country_code = attributes[:'ship_from_country_code'] - end - - if attributes.key?(:'notification_emails') - self.notification_emails = attributes[:'notification_emails'] - end - - if attributes.key?(:'feature_constraints') - if (value = attributes[:'feature_constraints']).is_a?(Array) - self.feature_constraints = value - end - end - - if attributes.key?(:'items') - self.items = attributes[:'items'] - end - - if attributes.key?(:'payment_information') - self.payment_information = attributes[:'payment_information'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_fulfillment_order_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_id", seller_fulfillment_order_id cannot be nil.') - end - - if @displayable_order_id.nil? - invalid_properties.push('invalid value for "displayable_order_id", displayable_order_id cannot be nil.') - end - - if @displayable_order_date.nil? - invalid_properties.push('invalid value for "displayable_order_date", displayable_order_date cannot be nil.') - end - - if @displayable_order_comment.nil? - invalid_properties.push('invalid value for "displayable_order_comment", displayable_order_comment cannot be nil.') - end - - if @shipping_speed_category.nil? - invalid_properties.push('invalid value for "shipping_speed_category", shipping_speed_category cannot be nil.') - end - - if @destination_address.nil? - invalid_properties.push('invalid value for "destination_address", destination_address cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_fulfillment_order_id.nil? - return false if @displayable_order_id.nil? - return false if @displayable_order_date.nil? - return false if @displayable_order_comment.nil? - return false if @shipping_speed_category.nil? - return false if @destination_address.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - seller_fulfillment_order_id == o.seller_fulfillment_order_id && - displayable_order_id == o.displayable_order_id && - displayable_order_date == o.displayable_order_date && - displayable_order_comment == o.displayable_order_comment && - shipping_speed_category == o.shipping_speed_category && - delivery_window == o.delivery_window && - destination_address == o.destination_address && - delivery_preferences == o.delivery_preferences && - fulfillment_action == o.fulfillment_action && - fulfillment_policy == o.fulfillment_policy && - cod_settings == o.cod_settings && - ship_from_country_code == o.ship_from_country_code && - notification_emails == o.notification_emails && - feature_constraints == o.feature_constraints && - items == o.items && - payment_information == o.payment_information - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, seller_fulfillment_order_id, displayable_order_id, displayable_order_date, displayable_order_comment, shipping_speed_category, delivery_window, destination_address, delivery_preferences, fulfillment_action, fulfillment_policy, cod_settings, ship_from_country_code, notification_emails, feature_constraints, items, payment_information].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_response.rb deleted file mode 100644 index 4ad32b2..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_order_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `createFulfillmentOrder` operation. - class CreateFulfillmentOrderResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_request.rb deleted file mode 100644 index a5a91c5..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The `createFulfillmentReturn` operation creates a fulfillment return for items that were fulfilled using the `createFulfillmentOrder` operation. For calls to `createFulfillmentReturn`, you must include `ReturnReasonCode` values returned by a previous call to the `listReturnReasonCodes` operation. - class CreateFulfillmentReturnRequest - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - self.items = attributes[:'items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_response.rb deleted file mode 100644 index 47740ae..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `createFulfillmentReturn` operation. - class CreateFulfillmentReturnResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_result.rb deleted file mode 100644 index 85a1090..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_fulfillment_return_result.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The result for the createFulfillmentReturn operation. - class CreateFulfillmentReturnResult - attr_accessor :return_items - - attr_accessor :invalid_return_items - - attr_accessor :return_authorizations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_items' => :'returnItems', - :'invalid_return_items' => :'invalidReturnItems', - :'return_authorizations' => :'returnAuthorizations' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_items' => :'Object', - :'invalid_return_items' => :'Object', - :'return_authorizations' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateFulfillmentReturnResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_items') - self.return_items = attributes[:'return_items'] - end - - if attributes.key?(:'invalid_return_items') - self.invalid_return_items = attributes[:'invalid_return_items'] - end - - if attributes.key?(:'return_authorizations') - self.return_authorizations = attributes[:'return_authorizations'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_items == o.return_items && - invalid_return_items == o.invalid_return_items && - return_authorizations == o.return_authorizations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_items, invalid_return_items, return_authorizations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item.rb deleted file mode 100644 index 8686b50..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An item that Amazon accepted for return. - class CreateReturnItem - # An identifier assigned by the seller to the return item. - attr_accessor :seller_return_item_id - - # The identifier assigned to the item by the seller when the fulfillment order was created. - attr_accessor :seller_fulfillment_order_item_id - - # The identifier for the shipment that is associated with the return item. - attr_accessor :amazon_shipment_id - - # The return reason code assigned to the return item by the seller. - attr_accessor :return_reason_code - - # An optional comment about the return item. - attr_accessor :return_comment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_return_item_id' => :'sellerReturnItemId', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'amazon_shipment_id' => :'amazonShipmentId', - :'return_reason_code' => :'returnReasonCode', - :'return_comment' => :'returnComment' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_return_item_id' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'amazon_shipment_id' => :'Object', - :'return_reason_code' => :'Object', - :'return_comment' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateReturnItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateReturnItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_return_item_id') - self.seller_return_item_id = attributes[:'seller_return_item_id'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'amazon_shipment_id') - self.amazon_shipment_id = attributes[:'amazon_shipment_id'] - end - - if attributes.key?(:'return_reason_code') - self.return_reason_code = attributes[:'return_reason_code'] - end - - if attributes.key?(:'return_comment') - self.return_comment = attributes[:'return_comment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_return_item_id.nil? - invalid_properties.push('invalid value for "seller_return_item_id", seller_return_item_id cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @amazon_shipment_id.nil? - invalid_properties.push('invalid value for "amazon_shipment_id", amazon_shipment_id cannot be nil.') - end - - if @return_reason_code.nil? - invalid_properties.push('invalid value for "return_reason_code", return_reason_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_return_item_id.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @amazon_shipment_id.nil? - return false if @return_reason_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_return_item_id == o.seller_return_item_id && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - amazon_shipment_id == o.amazon_shipment_id && - return_reason_code == o.return_reason_code && - return_comment == o.return_comment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_return_item_id, seller_fulfillment_order_item_id, amazon_shipment_id, return_reason_code, return_comment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item_list.rb deleted file mode 100644 index 9bb2933..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/create_return_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of items to be returned. - class CreateReturnItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::CreateReturnItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::CreateReturnItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/current_status.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/current_status.rb deleted file mode 100644 index 7f32b34..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/current_status.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class CurrentStatus - IN_TRANSIT = 'IN_TRANSIT'.freeze - DELIVERED = 'DELIVERED'.freeze - RETURNING = 'RETURNING'.freeze - RETURNED = 'RETURNED'.freeze - UNDELIVERABLE = 'UNDELIVERABLE'.freeze - DELAYED = 'DELAYED'.freeze - AVAILABLE_FOR_PICKUP = 'AVAILABLE_FOR_PICKUP'.freeze - CUSTOMER_ACTION = 'CUSTOMER_ACTION'.freeze - UNKNOWN = 'UNKNOWN'.freeze - OUT_FOR_DELIVERY = 'OUT_FOR_DELIVERY'.freeze - DELIVERY_ATTEMPTED = 'DELIVERY_ATTEMPTED'.freeze - PICKUP_SUCCESSFUL = 'PICKUP_SUCCESSFUL'.freeze - PICKUP_CANCELLED = 'PICKUP_CANCELLED'.freeze - PICKUP_ATTEMPTED = 'PICKUP_ATTEMPTED'.freeze - PICKUP_SCHEDULED = 'PICKUP_SCHEDULED'.freeze - RETURN_REQUEST_ACCEPTED = 'RETURN_REQUEST_ACCEPTED'.freeze - REFUND_ISSUED = 'REFUND_ISSUED'.freeze - RETURN_RECEIVED_IN_FC = 'RETURN_RECEIVED_IN_FC'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CurrentStatus.constants.select { |c| CurrentStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CurrentStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/date_range.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/date_range.rb deleted file mode 100644 index 57422ea..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/date_range.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The time range within which something (for example, a delivery) will occur. - class DateRange - attr_accessor :earliest - - attr_accessor :latest - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'earliest' => :'earliest', - :'latest' => :'latest' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'earliest' => :'Object', - :'latest' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DateRange` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DateRange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'earliest') - self.earliest = attributes[:'earliest'] - end - - if attributes.key?(:'latest') - self.latest = attributes[:'latest'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @earliest.nil? - invalid_properties.push('invalid value for "earliest", earliest cannot be nil.') - end - - if @latest.nil? - invalid_properties.push('invalid value for "latest", latest cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @earliest.nil? - return false if @latest.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - earliest == o.earliest && - latest == o.latest - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [earliest, latest].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/decimal.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/decimal.rb deleted file mode 100644 index 6c2202f..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document.rb deleted file mode 100644 index 19aa016..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A delivery document for a package. - class DeliveryDocument - # The delivery document type. Values are `SIGNATURE` and `DELIVERY_IMAGE`. - attr_accessor :document_type - - # A URL that you can use to download the document. This URL has a `Content-Type` header. Note that the URL expires after one hour. To get a new URL, you must call the API again. - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_type' => :'documentType', - :'url' => :'url' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_type' => :'Object', - :'url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_type') - self.document_type = attributes[:'document_type'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_type.nil? - invalid_properties.push('invalid value for "document_type", document_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_type == o.document_type && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_type, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document_list.rb deleted file mode 100644 index db2db45..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_document_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A list of delivery documents for a package. - class DeliveryDocumentList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryDocumentList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryDocumentList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_information.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_information.rb deleted file mode 100644 index 0fcb588..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_information.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The delivery information for the package. This information is available after the package is delivered. - class DeliveryInformation - attr_accessor :delivery_document_list - - attr_accessor :drop_off_location - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_document_list' => :'deliveryDocumentList', - :'drop_off_location' => :'dropOffLocation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_document_list' => :'Object', - :'drop_off_location' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_document_list') - self.delivery_document_list = attributes[:'delivery_document_list'] - end - - if attributes.key?(:'drop_off_location') - self.drop_off_location = attributes[:'drop_off_location'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_document_list == o.delivery_document_list && - drop_off_location == o.drop_off_location - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_document_list, drop_off_location].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_message.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_message.rb deleted file mode 100644 index 112540b..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_message.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Localized messaging for a delivery offering. - class DeliveryMessage - # The message content for a delivery offering. - attr_accessor :text - - # The locale for the message (for example, en_US). - attr_accessor :locale - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text', - :'locale' => :'locale' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'Object', - :'locale' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryMessage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'locale') - self.locale = attributes[:'locale'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text && - locale == o.locale - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text, locale].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offer.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offer.rb deleted file mode 100644 index 39c3735..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offer.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An available offer for delivery of a product. - class DeliveryOffer - attr_accessor :expires_at - - attr_accessor :date_range - - attr_accessor :policy - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expires_at' => :'expiresAt', - :'date_range' => :'dateRange', - :'policy' => :'policy' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'expires_at' => :'Object', - :'date_range' => :'Object', - :'policy' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryOffer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryOffer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expires_at') - self.expires_at = attributes[:'expires_at'] - end - - if attributes.key?(:'date_range') - self.date_range = attributes[:'date_range'] - end - - if attributes.key?(:'policy') - self.policy = attributes[:'policy'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expires_at == o.expires_at && - date_range == o.date_range && - policy == o.policy - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expires_at, date_range, policy].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offers_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offers_list.rb deleted file mode 100644 index 6c219fd..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_offers_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of delivery offer information. - class DeliveryOffersList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryOffersList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryOffersList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_policy.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_policy.rb deleted file mode 100644 index 1577cc3..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_policy.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The policy for a delivery offering. - class DeliveryPolicy - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'message' => :'message' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'message' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryPolicy` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryPolicy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_preferences.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_preferences.rb deleted file mode 100644 index a8f6a2c..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_preferences.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The delivery preferences applied to the destination address. These preferences are applied when possible and are best effort. This feature is currently supported only in the JP marketplace and not applicable for other marketplaces. For eligible orders, the default delivery preference will be to deliver the package unattended at the front door, unless you specify otherwise. - class DeliveryPreferences - # Additional delivery instructions. For example, this could be instructions on how to enter a building, nearby landmark or navigation instructions, 'Beware of dogs', etc. - attr_accessor :delivery_instructions - - attr_accessor :drop_off_location - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_instructions' => :'deliveryInstructions', - :'drop_off_location' => :'dropOffLocation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_instructions' => :'Object', - :'drop_off_location' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryPreferences` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryPreferences`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_instructions') - self.delivery_instructions = attributes[:'delivery_instructions'] - end - - if attributes.key?(:'drop_off_location') - self.drop_off_location = attributes[:'drop_off_location'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_instructions == o.delivery_instructions && - drop_off_location == o.drop_off_location - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_instructions, drop_off_location].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window.rb deleted file mode 100644 index 057d7b8..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The time range within which a Scheduled Delivery fulfillment order should be delivered. This is only available in the JP marketplace. - class DeliveryWindow - attr_accessor :start_date - - attr_accessor :end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'startDate', - :'end_date' => :'endDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Object', - :'end_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryWindow` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryWindow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @end_date.nil? - invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_date.nil? - return false if @end_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window_list.rb deleted file mode 100644 index aac6740..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/delivery_window_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of delivery windows. - class DeliveryWindowList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryWindowList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DeliveryWindowList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/destination.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/destination.rb deleted file mode 100644 index 3c9f808..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/destination.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The destination for the delivery offer. - class Destination - attr_accessor :delivery_address - - attr_accessor :ip_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_address' => :'deliveryAddress', - :'ip_address' => :'ipAddress' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_address' => :'Object', - :'ip_address' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Destination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Destination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_address') - self.delivery_address = attributes[:'delivery_address'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_address == o.delivery_address && - ip_address == o.ip_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_address, ip_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/drop_off_location.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/drop_off_location.rb deleted file mode 100644 index 7677cae..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/drop_off_location.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The preferred location to leave packages at the destination address. - class DropOffLocation - # Specifies the preferred location to leave the package at the destination address. - attr_accessor :type - - # Additional information about the drop-off location that can vary depending on the type of drop-off location specified in the `type` field. If the `type` is set to `FALLBACK_NEIGHBOR_DELIVERY`, the `attributes` object should include the exact keys `neighborName` and `houseNumber` to provide the name and house number of the designated neighbor. - attr_accessor :attributes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'attributes' => :'attributes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'attributes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::DropOffLocation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::DropOffLocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Hash) - self.attributes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['FRONT_DOOR', 'DELIVERY_BOX', 'GAS_METER_BOX', 'BICYCLE_BASKET', 'GARAGE', 'RECEPTIONIST', 'FALLBACK_NEIGHBOR_DELIVERY', 'DO_NOT_LEAVE_UNATTENDED']) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['FRONT_DOOR', 'DELIVERY_BOX', 'GAS_METER_BOX', 'BICYCLE_BASKET', 'GARAGE', 'RECEPTIONIST', 'FALLBACK_NEIGHBOR_DELIVERY', 'DO_NOT_LEAVE_UNATTENDED']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - attributes == o.attributes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, attributes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error.rb deleted file mode 100644 index c4a9a98..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error_list.rb deleted file mode 100644 index 42d1500..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/event_code.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/event_code.rb deleted file mode 100644 index 6ab90d4..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/event_code.rb +++ /dev/null @@ -1,61 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class EventCode - N101 = 'EVENT_101'.freeze - N102 = 'EVENT_102'.freeze - N201 = 'EVENT_201'.freeze - N202 = 'EVENT_202'.freeze - N203 = 'EVENT_203'.freeze - N204 = 'EVENT_204'.freeze - N205 = 'EVENT_205'.freeze - N206 = 'EVENT_206'.freeze - N301 = 'EVENT_301'.freeze - N302 = 'EVENT_302'.freeze - N304 = 'EVENT_304'.freeze - N306 = 'EVENT_306'.freeze - N307 = 'EVENT_307'.freeze - N308 = 'EVENT_308'.freeze - N309 = 'EVENT_309'.freeze - N401 = 'EVENT_401'.freeze - N402 = 'EVENT_402'.freeze - N403 = 'EVENT_403'.freeze - N404 = 'EVENT_404'.freeze - N405 = 'EVENT_405'.freeze - N406 = 'EVENT_406'.freeze - N407 = 'EVENT_407'.freeze - N408 = 'EVENT_408'.freeze - N409 = 'EVENT_409'.freeze - N411 = 'EVENT_411'.freeze - N412 = 'EVENT_412'.freeze - N413 = 'EVENT_413'.freeze - N414 = 'EVENT_414'.freeze - N415 = 'EVENT_415'.freeze - N416 = 'EVENT_416'.freeze - N417 = 'EVENT_417'.freeze - N418 = 'EVENT_418'.freeze - N419 = 'EVENT_419'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = EventCode.constants.select { |c| EventCode::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #EventCode" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature.rb deleted file mode 100644 index 85adaf7..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A Multi-Channel Fulfillment feature. - class Feature - # The feature name. - attr_accessor :feature_name - - # The feature description. - attr_accessor :feature_description - - # When true, indicates that the seller is eligible to use the feature. - attr_accessor :seller_eligible - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feature_name' => :'featureName', - :'feature_description' => :'featureDescription', - :'seller_eligible' => :'sellerEligible' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feature_name' => :'Object', - :'feature_description' => :'Object', - :'seller_eligible' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Feature` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Feature`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feature_name') - self.feature_name = attributes[:'feature_name'] - end - - if attributes.key?(:'feature_description') - self.feature_description = attributes[:'feature_description'] - end - - if attributes.key?(:'seller_eligible') - self.seller_eligible = attributes[:'seller_eligible'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @feature_name.nil? - invalid_properties.push('invalid value for "feature_name", feature_name cannot be nil.') - end - - if @feature_description.nil? - invalid_properties.push('invalid value for "feature_description", feature_description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @feature_name.nil? - return false if @feature_description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feature_name == o.feature_name && - feature_description == o.feature_description && - seller_eligible == o.seller_eligible - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feature_name, feature_description, seller_eligible].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_settings.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_settings.rb deleted file mode 100644 index 1714312..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_settings.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # `FeatureSettings` allows users to apply fulfillment features to an order. To block an order from being shipped using Amazon Logistics (AMZL) and an AMZL tracking number, use `featureName` as `BLOCK_AMZL` and `featureFulfillmentPolicy` as `Required`. Blocking AMZL will incur an additional fee surcharge on your MCF orders and increase the risk of some of your orders being unfulfilled or delivered late if there are no alternative carriers available. Using `BLOCK_AMZL` in an order request will take precedence over your Seller Central account setting. To ship in non-Amazon branded packaging (blank boxes), use featureName `BLANK_BOX`. - class FeatureSettings - # The name of the feature. - attr_accessor :feature_name - - # Specifies the policy to use when fulfilling an order. - attr_accessor :feature_fulfillment_policy - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'feature_name' => :'featureName', - :'feature_fulfillment_policy' => :'featureFulfillmentPolicy' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'feature_name' => :'Object', - :'feature_fulfillment_policy' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FeatureSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FeatureSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'feature_name') - self.feature_name = attributes[:'feature_name'] - end - - if attributes.key?(:'feature_fulfillment_policy') - self.feature_fulfillment_policy = attributes[:'feature_fulfillment_policy'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - feature_fulfillment_policy_validator = EnumAttributeValidator.new('Object', ['Required', 'NotRequired']) - return false unless feature_fulfillment_policy_validator.valid?(@feature_fulfillment_policy) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] feature_fulfillment_policy Object to be assigned - def feature_fulfillment_policy=(feature_fulfillment_policy) - validator = EnumAttributeValidator.new('Object', ['Required', 'NotRequired']) - unless validator.valid?(feature_fulfillment_policy) - fail ArgumentError, "invalid value for \"feature_fulfillment_policy\", must be one of #{validator.allowable_values}." - end - @feature_fulfillment_policy = feature_fulfillment_policy - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - feature_name == o.feature_name && - feature_fulfillment_policy == o.feature_fulfillment_policy - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [feature_name, feature_fulfillment_policy].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_sku.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_sku.rb deleted file mode 100644 index cb450ab..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/feature_sku.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Information about an SKU, including the count available, identifiers, and a list of overlapping SKUs that share the same inventory pool. - class FeatureSku - # Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's SellerId, which is included with every operation that you submit. - attr_accessor :seller_sku - - # The unique SKU used by Amazon's fulfillment network. - attr_accessor :fn_sku - - # The Amazon Standard Identification Number (ASIN) of the item. - attr_accessor :asin - - # The number of SKUs available for this service. - attr_accessor :sku_count - - # Other seller SKUs that are shared across the same inventory. - attr_accessor :overlapping_skus - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'fn_sku' => :'fnSku', - :'asin' => :'asin', - :'sku_count' => :'skuCount', - :'overlapping_skus' => :'overlappingSkus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'fn_sku' => :'Object', - :'asin' => :'Object', - :'sku_count' => :'Object', - :'overlapping_skus' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FeatureSku` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FeatureSku`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'fn_sku') - self.fn_sku = attributes[:'fn_sku'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'sku_count') - self.sku_count = attributes[:'sku_count'] - end - - if attributes.key?(:'overlapping_skus') - if (value = attributes[:'overlapping_skus']).is_a?(Array) - self.overlapping_skus = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - fn_sku == o.fn_sku && - asin == o.asin && - sku_count == o.sku_count && - overlapping_skus == o.overlapping_skus - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, fn_sku, asin, sku_count, overlapping_skus].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/features.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/features.rb deleted file mode 100644 index 3500a9d..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/features.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of features. - class Features - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Features` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Features`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee.rb deleted file mode 100644 index 5e0fd83..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Fee type and cost. - class Fee - # The type of fee. - attr_accessor :name - - attr_accessor :amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Fee` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Fee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - name_validator = EnumAttributeValidator.new('Object', ['FBAPerUnitFulfillmentFee', 'FBAPerOrderFulfillmentFee', 'FBATransportationFee', 'FBAFulfillmentCODFee']) - return false unless name_validator.valid?(@name) - return false if @amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] name Object to be assigned - def name=(name) - validator = EnumAttributeValidator.new('Object', ['FBAPerUnitFulfillmentFee', 'FBAPerOrderFulfillmentFee', 'FBATransportationFee', 'FBAFulfillmentCODFee']) - unless validator.valid?(name) - fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}." - end - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee_list.rb deleted file mode 100644 index 986176d..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fee_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fee type and cost pairs. - class FeeList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FeeList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FeeList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_action.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_action.rb deleted file mode 100644 index f362629..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_action.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class FulfillmentAction - SHIP = 'Ship'.freeze - HOLD = 'Hold'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FulfillmentAction.constants.select { |c| FulfillmentAction::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FulfillmentAction" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order.rb deleted file mode 100644 index 1269175..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order.rb +++ /dev/null @@ -1,403 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # General information about a fulfillment order, including its status. - class FulfillmentOrder - # The fulfillment order identifier submitted with the `createFulfillmentOrder` operation. - attr_accessor :seller_fulfillment_order_id - - # The identifier for the marketplace the fulfillment order is placed against. - attr_accessor :marketplace_id - - # A fulfillment order identifier submitted with the `createFulfillmentOrder` operation. Displays as the order identifier in recipient-facing materials such as the packing slip. - attr_accessor :displayable_order_id - - attr_accessor :displayable_order_date - - # A text block submitted with the `createFulfillmentOrder` operation. Displays in recipient-facing materials such as the packing slip. - attr_accessor :displayable_order_comment - - attr_accessor :shipping_speed_category - - attr_accessor :delivery_window - - attr_accessor :destination_address - - attr_accessor :fulfillment_action - - attr_accessor :fulfillment_policy - - attr_accessor :cod_settings - - attr_accessor :received_date - - attr_accessor :fulfillment_order_status - - attr_accessor :status_updated_date - - attr_accessor :notification_emails - - # A list of features and their fulfillment policies to apply to the order. - attr_accessor :feature_constraints - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_fulfillment_order_id' => :'sellerFulfillmentOrderId', - :'marketplace_id' => :'marketplaceId', - :'displayable_order_id' => :'displayableOrderId', - :'displayable_order_date' => :'displayableOrderDate', - :'displayable_order_comment' => :'displayableOrderComment', - :'shipping_speed_category' => :'shippingSpeedCategory', - :'delivery_window' => :'deliveryWindow', - :'destination_address' => :'destinationAddress', - :'fulfillment_action' => :'fulfillmentAction', - :'fulfillment_policy' => :'fulfillmentPolicy', - :'cod_settings' => :'codSettings', - :'received_date' => :'receivedDate', - :'fulfillment_order_status' => :'fulfillmentOrderStatus', - :'status_updated_date' => :'statusUpdatedDate', - :'notification_emails' => :'notificationEmails', - :'feature_constraints' => :'featureConstraints' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_fulfillment_order_id' => :'Object', - :'marketplace_id' => :'Object', - :'displayable_order_id' => :'Object', - :'displayable_order_date' => :'Object', - :'displayable_order_comment' => :'Object', - :'shipping_speed_category' => :'Object', - :'delivery_window' => :'Object', - :'destination_address' => :'Object', - :'fulfillment_action' => :'Object', - :'fulfillment_policy' => :'Object', - :'cod_settings' => :'Object', - :'received_date' => :'Object', - :'fulfillment_order_status' => :'Object', - :'status_updated_date' => :'Object', - :'notification_emails' => :'Object', - :'feature_constraints' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrder` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_fulfillment_order_id') - self.seller_fulfillment_order_id = attributes[:'seller_fulfillment_order_id'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'displayable_order_id') - self.displayable_order_id = attributes[:'displayable_order_id'] - end - - if attributes.key?(:'displayable_order_date') - self.displayable_order_date = attributes[:'displayable_order_date'] - end - - if attributes.key?(:'displayable_order_comment') - self.displayable_order_comment = attributes[:'displayable_order_comment'] - end - - if attributes.key?(:'shipping_speed_category') - self.shipping_speed_category = attributes[:'shipping_speed_category'] - end - - if attributes.key?(:'delivery_window') - self.delivery_window = attributes[:'delivery_window'] - end - - if attributes.key?(:'destination_address') - self.destination_address = attributes[:'destination_address'] - end - - if attributes.key?(:'fulfillment_action') - self.fulfillment_action = attributes[:'fulfillment_action'] - end - - if attributes.key?(:'fulfillment_policy') - self.fulfillment_policy = attributes[:'fulfillment_policy'] - end - - if attributes.key?(:'cod_settings') - self.cod_settings = attributes[:'cod_settings'] - end - - if attributes.key?(:'received_date') - self.received_date = attributes[:'received_date'] - end - - if attributes.key?(:'fulfillment_order_status') - self.fulfillment_order_status = attributes[:'fulfillment_order_status'] - end - - if attributes.key?(:'status_updated_date') - self.status_updated_date = attributes[:'status_updated_date'] - end - - if attributes.key?(:'notification_emails') - self.notification_emails = attributes[:'notification_emails'] - end - - if attributes.key?(:'feature_constraints') - if (value = attributes[:'feature_constraints']).is_a?(Array) - self.feature_constraints = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_fulfillment_order_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_id", seller_fulfillment_order_id cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @displayable_order_id.nil? - invalid_properties.push('invalid value for "displayable_order_id", displayable_order_id cannot be nil.') - end - - if @displayable_order_date.nil? - invalid_properties.push('invalid value for "displayable_order_date", displayable_order_date cannot be nil.') - end - - if @displayable_order_comment.nil? - invalid_properties.push('invalid value for "displayable_order_comment", displayable_order_comment cannot be nil.') - end - - if @shipping_speed_category.nil? - invalid_properties.push('invalid value for "shipping_speed_category", shipping_speed_category cannot be nil.') - end - - if @destination_address.nil? - invalid_properties.push('invalid value for "destination_address", destination_address cannot be nil.') - end - - if @received_date.nil? - invalid_properties.push('invalid value for "received_date", received_date cannot be nil.') - end - - if @fulfillment_order_status.nil? - invalid_properties.push('invalid value for "fulfillment_order_status", fulfillment_order_status cannot be nil.') - end - - if @status_updated_date.nil? - invalid_properties.push('invalid value for "status_updated_date", status_updated_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_fulfillment_order_id.nil? - return false if @marketplace_id.nil? - return false if @displayable_order_id.nil? - return false if @displayable_order_date.nil? - return false if @displayable_order_comment.nil? - return false if @shipping_speed_category.nil? - return false if @destination_address.nil? - return false if @received_date.nil? - return false if @fulfillment_order_status.nil? - return false if @status_updated_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_fulfillment_order_id == o.seller_fulfillment_order_id && - marketplace_id == o.marketplace_id && - displayable_order_id == o.displayable_order_id && - displayable_order_date == o.displayable_order_date && - displayable_order_comment == o.displayable_order_comment && - shipping_speed_category == o.shipping_speed_category && - delivery_window == o.delivery_window && - destination_address == o.destination_address && - fulfillment_action == o.fulfillment_action && - fulfillment_policy == o.fulfillment_policy && - cod_settings == o.cod_settings && - received_date == o.received_date && - fulfillment_order_status == o.fulfillment_order_status && - status_updated_date == o.status_updated_date && - notification_emails == o.notification_emails && - feature_constraints == o.feature_constraints - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_fulfillment_order_id, marketplace_id, displayable_order_id, displayable_order_date, displayable_order_comment, shipping_speed_category, delivery_window, destination_address, fulfillment_action, fulfillment_policy, cod_settings, received_date, fulfillment_order_status, status_updated_date, notification_emails, feature_constraints].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item.rb deleted file mode 100644 index fc5f665..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item.rb +++ /dev/null @@ -1,359 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for a fulfillment order. - class FulfillmentOrderItem - # The seller SKU of the item. - attr_accessor :seller_sku - - # A fulfillment order item identifier submitted with a call to the `createFulfillmentOrder` operation. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :quantity - - # A message to the gift recipient, if applicable. - attr_accessor :gift_message - - # Item-specific text that displays in recipient-facing materials such as the outbound shipment packing slip. - attr_accessor :displayable_comment - - # Amazon's fulfillment network SKU of the item. - attr_accessor :fulfillment_network_sku - - # Indicates whether the item is sellable or unsellable. - attr_accessor :order_item_disposition - - attr_accessor :cancelled_quantity - - attr_accessor :unfulfillable_quantity - - attr_accessor :estimated_ship_date - - attr_accessor :estimated_arrival_date - - attr_accessor :per_unit_price - - attr_accessor :per_unit_tax - - attr_accessor :per_unit_declared_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'quantity' => :'quantity', - :'gift_message' => :'giftMessage', - :'displayable_comment' => :'displayableComment', - :'fulfillment_network_sku' => :'fulfillmentNetworkSku', - :'order_item_disposition' => :'orderItemDisposition', - :'cancelled_quantity' => :'cancelledQuantity', - :'unfulfillable_quantity' => :'unfulfillableQuantity', - :'estimated_ship_date' => :'estimatedShipDate', - :'estimated_arrival_date' => :'estimatedArrivalDate', - :'per_unit_price' => :'perUnitPrice', - :'per_unit_tax' => :'perUnitTax', - :'per_unit_declared_value' => :'perUnitDeclaredValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'quantity' => :'Object', - :'gift_message' => :'Object', - :'displayable_comment' => :'Object', - :'fulfillment_network_sku' => :'Object', - :'order_item_disposition' => :'Object', - :'cancelled_quantity' => :'Object', - :'unfulfillable_quantity' => :'Object', - :'estimated_ship_date' => :'Object', - :'estimated_arrival_date' => :'Object', - :'per_unit_price' => :'Object', - :'per_unit_tax' => :'Object', - :'per_unit_declared_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'gift_message') - self.gift_message = attributes[:'gift_message'] - end - - if attributes.key?(:'displayable_comment') - self.displayable_comment = attributes[:'displayable_comment'] - end - - if attributes.key?(:'fulfillment_network_sku') - self.fulfillment_network_sku = attributes[:'fulfillment_network_sku'] - end - - if attributes.key?(:'order_item_disposition') - self.order_item_disposition = attributes[:'order_item_disposition'] - end - - if attributes.key?(:'cancelled_quantity') - self.cancelled_quantity = attributes[:'cancelled_quantity'] - end - - if attributes.key?(:'unfulfillable_quantity') - self.unfulfillable_quantity = attributes[:'unfulfillable_quantity'] - end - - if attributes.key?(:'estimated_ship_date') - self.estimated_ship_date = attributes[:'estimated_ship_date'] - end - - if attributes.key?(:'estimated_arrival_date') - self.estimated_arrival_date = attributes[:'estimated_arrival_date'] - end - - if attributes.key?(:'per_unit_price') - self.per_unit_price = attributes[:'per_unit_price'] - end - - if attributes.key?(:'per_unit_tax') - self.per_unit_tax = attributes[:'per_unit_tax'] - end - - if attributes.key?(:'per_unit_declared_value') - self.per_unit_declared_value = attributes[:'per_unit_declared_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @cancelled_quantity.nil? - invalid_properties.push('invalid value for "cancelled_quantity", cancelled_quantity cannot be nil.') - end - - if @unfulfillable_quantity.nil? - invalid_properties.push('invalid value for "unfulfillable_quantity", unfulfillable_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @quantity.nil? - return false if @cancelled_quantity.nil? - return false if @unfulfillable_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - quantity == o.quantity && - gift_message == o.gift_message && - displayable_comment == o.displayable_comment && - fulfillment_network_sku == o.fulfillment_network_sku && - order_item_disposition == o.order_item_disposition && - cancelled_quantity == o.cancelled_quantity && - unfulfillable_quantity == o.unfulfillable_quantity && - estimated_ship_date == o.estimated_ship_date && - estimated_arrival_date == o.estimated_arrival_date && - per_unit_price == o.per_unit_price && - per_unit_tax == o.per_unit_tax && - per_unit_declared_value == o.per_unit_declared_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, seller_fulfillment_order_item_id, quantity, gift_message, displayable_comment, fulfillment_network_sku, order_item_disposition, cancelled_quantity, unfulfillable_quantity, estimated_ship_date, estimated_arrival_date, per_unit_price, per_unit_tax, per_unit_declared_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item_list.rb deleted file mode 100644 index 6af66e8..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment order item information. - class FulfillmentOrderItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrderItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentOrderItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_status.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_status.rb deleted file mode 100644 index 28ed735..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_order_status.rb +++ /dev/null @@ -1,37 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class FulfillmentOrderStatus - NEW = 'New'.freeze - RECEIVED = 'Received'.freeze - PLANNING = 'Planning'.freeze - PROCESSING = 'Processing'.freeze - CANCELLED = 'Cancelled'.freeze - COMPLETE = 'Complete'.freeze - COMPLETE_PARTIALLED = 'CompletePartialled'.freeze - UNFULFILLABLE = 'Unfulfillable'.freeze - INVALID = 'Invalid'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FulfillmentOrderStatus.constants.select { |c| FulfillmentOrderStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FulfillmentOrderStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_policy.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_policy.rb deleted file mode 100644 index f2954d2..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_policy.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class FulfillmentPolicy - FILL_OR_KILL = 'FillOrKill'.freeze - FILL_ALL = 'FillAll'.freeze - FILL_ALL_AVAILABLE = 'FillAllAvailable'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FulfillmentPolicy.constants.select { |c| FulfillmentPolicy::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FulfillmentPolicy" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview.rb deleted file mode 100644 index 886dd98..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Information about a fulfillment order preview, including delivery and fee information based on shipping method. - class FulfillmentPreview - attr_accessor :shipping_speed_category - - attr_accessor :scheduled_delivery_info - - # When true, this fulfillment order preview is fulfillable. - attr_accessor :is_fulfillable - - # When true, this fulfillment order preview is for COD (Cash On Delivery). - attr_accessor :is_cod_capable - - attr_accessor :estimated_shipping_weight - - attr_accessor :estimated_fees - - attr_accessor :fulfillment_preview_shipments - - attr_accessor :unfulfillable_preview_items - - attr_accessor :order_unfulfillable_reasons - - # The marketplace the fulfillment order is placed against. - attr_accessor :marketplace_id - - # A list of features and their fulfillment policies to apply to the order. - attr_accessor :feature_constraints - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipping_speed_category' => :'shippingSpeedCategory', - :'scheduled_delivery_info' => :'scheduledDeliveryInfo', - :'is_fulfillable' => :'isFulfillable', - :'is_cod_capable' => :'isCODCapable', - :'estimated_shipping_weight' => :'estimatedShippingWeight', - :'estimated_fees' => :'estimatedFees', - :'fulfillment_preview_shipments' => :'fulfillmentPreviewShipments', - :'unfulfillable_preview_items' => :'unfulfillablePreviewItems', - :'order_unfulfillable_reasons' => :'orderUnfulfillableReasons', - :'marketplace_id' => :'marketplaceId', - :'feature_constraints' => :'featureConstraints' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipping_speed_category' => :'Object', - :'scheduled_delivery_info' => :'Object', - :'is_fulfillable' => :'Object', - :'is_cod_capable' => :'Object', - :'estimated_shipping_weight' => :'Object', - :'estimated_fees' => :'Object', - :'fulfillment_preview_shipments' => :'Object', - :'unfulfillable_preview_items' => :'Object', - :'order_unfulfillable_reasons' => :'Object', - :'marketplace_id' => :'Object', - :'feature_constraints' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreview` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipping_speed_category') - self.shipping_speed_category = attributes[:'shipping_speed_category'] - end - - if attributes.key?(:'scheduled_delivery_info') - self.scheduled_delivery_info = attributes[:'scheduled_delivery_info'] - end - - if attributes.key?(:'is_fulfillable') - self.is_fulfillable = attributes[:'is_fulfillable'] - end - - if attributes.key?(:'is_cod_capable') - self.is_cod_capable = attributes[:'is_cod_capable'] - end - - if attributes.key?(:'estimated_shipping_weight') - self.estimated_shipping_weight = attributes[:'estimated_shipping_weight'] - end - - if attributes.key?(:'estimated_fees') - self.estimated_fees = attributes[:'estimated_fees'] - end - - if attributes.key?(:'fulfillment_preview_shipments') - self.fulfillment_preview_shipments = attributes[:'fulfillment_preview_shipments'] - end - - if attributes.key?(:'unfulfillable_preview_items') - self.unfulfillable_preview_items = attributes[:'unfulfillable_preview_items'] - end - - if attributes.key?(:'order_unfulfillable_reasons') - self.order_unfulfillable_reasons = attributes[:'order_unfulfillable_reasons'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'feature_constraints') - if (value = attributes[:'feature_constraints']).is_a?(Array) - self.feature_constraints = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipping_speed_category.nil? - invalid_properties.push('invalid value for "shipping_speed_category", shipping_speed_category cannot be nil.') - end - - if @is_fulfillable.nil? - invalid_properties.push('invalid value for "is_fulfillable", is_fulfillable cannot be nil.') - end - - if @is_cod_capable.nil? - invalid_properties.push('invalid value for "is_cod_capable", is_cod_capable cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipping_speed_category.nil? - return false if @is_fulfillable.nil? - return false if @is_cod_capable.nil? - return false if @marketplace_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipping_speed_category == o.shipping_speed_category && - scheduled_delivery_info == o.scheduled_delivery_info && - is_fulfillable == o.is_fulfillable && - is_cod_capable == o.is_cod_capable && - estimated_shipping_weight == o.estimated_shipping_weight && - estimated_fees == o.estimated_fees && - fulfillment_preview_shipments == o.fulfillment_preview_shipments && - unfulfillable_preview_items == o.unfulfillable_preview_items && - order_unfulfillable_reasons == o.order_unfulfillable_reasons && - marketplace_id == o.marketplace_id && - feature_constraints == o.feature_constraints - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipping_speed_category, scheduled_delivery_info, is_fulfillable, is_cod_capable, estimated_shipping_weight, estimated_fees, fulfillment_preview_shipments, unfulfillable_preview_items, order_unfulfillable_reasons, marketplace_id, feature_constraints].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item.rb deleted file mode 100644 index 1b85b78..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for a shipment in a fulfillment order preview. - class FulfillmentPreviewItem - # The seller SKU of the item. - attr_accessor :seller_sku - - attr_accessor :quantity - - # A fulfillment order item identifier that the seller created with a call to the `createFulfillmentOrder` operation. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :estimated_shipping_weight - - # The method used to calculate the estimated shipping weight. - attr_accessor :shipping_weight_calculation_method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'quantity' => :'quantity', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'estimated_shipping_weight' => :'estimatedShippingWeight', - :'shipping_weight_calculation_method' => :'shippingWeightCalculationMethod' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'quantity' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'estimated_shipping_weight' => :'Object', - :'shipping_weight_calculation_method' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'estimated_shipping_weight') - self.estimated_shipping_weight = attributes[:'estimated_shipping_weight'] - end - - if attributes.key?(:'shipping_weight_calculation_method') - self.shipping_weight_calculation_method = attributes[:'shipping_weight_calculation_method'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @quantity.nil? - return false if @seller_fulfillment_order_item_id.nil? - shipping_weight_calculation_method_validator = EnumAttributeValidator.new('Object', ['Package', 'Dimensional']) - return false unless shipping_weight_calculation_method_validator.valid?(@shipping_weight_calculation_method) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipping_weight_calculation_method Object to be assigned - def shipping_weight_calculation_method=(shipping_weight_calculation_method) - validator = EnumAttributeValidator.new('Object', ['Package', 'Dimensional']) - unless validator.valid?(shipping_weight_calculation_method) - fail ArgumentError, "invalid value for \"shipping_weight_calculation_method\", must be one of #{validator.allowable_values}." - end - @shipping_weight_calculation_method = shipping_weight_calculation_method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - quantity == o.quantity && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - estimated_shipping_weight == o.estimated_shipping_weight && - shipping_weight_calculation_method == o.shipping_weight_calculation_method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, quantity, seller_fulfillment_order_item_id, estimated_shipping_weight, shipping_weight_calculation_method].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item_list.rb deleted file mode 100644 index 0f10d21..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment preview item information. - class FulfillmentPreviewItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_list.rb deleted file mode 100644 index d5acf98..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment preview information. - class FulfillmentPreviewList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment.rb deleted file mode 100644 index 7606901..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Delivery and item information for a shipment in a fulfillment order preview. - class FulfillmentPreviewShipment - attr_accessor :earliest_ship_date - - attr_accessor :latest_ship_date - - attr_accessor :earliest_arrival_date - - attr_accessor :latest_arrival_date - - # Provides additional insight into the shipment timeline when exact delivery dates are not able to be precomputed. - attr_accessor :shipping_notes - - attr_accessor :fulfillment_preview_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'earliest_ship_date' => :'earliestShipDate', - :'latest_ship_date' => :'latestShipDate', - :'earliest_arrival_date' => :'earliestArrivalDate', - :'latest_arrival_date' => :'latestArrivalDate', - :'shipping_notes' => :'shippingNotes', - :'fulfillment_preview_items' => :'fulfillmentPreviewItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'earliest_ship_date' => :'Object', - :'latest_ship_date' => :'Object', - :'earliest_arrival_date' => :'Object', - :'latest_arrival_date' => :'Object', - :'shipping_notes' => :'Object', - :'fulfillment_preview_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewShipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewShipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'earliest_ship_date') - self.earliest_ship_date = attributes[:'earliest_ship_date'] - end - - if attributes.key?(:'latest_ship_date') - self.latest_ship_date = attributes[:'latest_ship_date'] - end - - if attributes.key?(:'earliest_arrival_date') - self.earliest_arrival_date = attributes[:'earliest_arrival_date'] - end - - if attributes.key?(:'latest_arrival_date') - self.latest_arrival_date = attributes[:'latest_arrival_date'] - end - - if attributes.key?(:'shipping_notes') - if (value = attributes[:'shipping_notes']).is_a?(Array) - self.shipping_notes = value - end - end - - if attributes.key?(:'fulfillment_preview_items') - self.fulfillment_preview_items = attributes[:'fulfillment_preview_items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fulfillment_preview_items.nil? - invalid_properties.push('invalid value for "fulfillment_preview_items", fulfillment_preview_items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fulfillment_preview_items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - earliest_ship_date == o.earliest_ship_date && - latest_ship_date == o.latest_ship_date && - earliest_arrival_date == o.earliest_arrival_date && - latest_arrival_date == o.latest_arrival_date && - shipping_notes == o.shipping_notes && - fulfillment_preview_items == o.fulfillment_preview_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [earliest_ship_date, latest_ship_date, earliest_arrival_date, latest_arrival_date, shipping_notes, fulfillment_preview_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment_list.rb deleted file mode 100644 index 5073e95..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_preview_shipment_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment preview shipment information. - class FulfillmentPreviewShipmentList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewShipmentList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentPreviewShipmentList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_return_item_status.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_return_item_status.rb deleted file mode 100644 index 328cd25..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_return_item_status.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class FulfillmentReturnItemStatus - NEW = 'New'.freeze - PROCESSED = 'Processed'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = FulfillmentReturnItemStatus.constants.select { |c| FulfillmentReturnItemStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #FulfillmentReturnItemStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment.rb deleted file mode 100644 index 433eae2..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment.rb +++ /dev/null @@ -1,334 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Delivery and item information for a shipment in a fulfillment order. - class FulfillmentShipment - # A shipment identifier assigned by Amazon. - attr_accessor :amazon_shipment_id - - # An identifier for the fulfillment center that the shipment will be sent from. - attr_accessor :fulfillment_center_id - - # The current status of the shipment. - attr_accessor :fulfillment_shipment_status - - attr_accessor :shipping_date - - attr_accessor :estimated_arrival_date - - # Provides additional insight into shipment timeline. Primairly used to communicate that actual delivery dates aren't available. - attr_accessor :shipping_notes - - attr_accessor :fulfillment_shipment_item - - attr_accessor :fulfillment_shipment_package - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_shipment_id' => :'amazonShipmentId', - :'fulfillment_center_id' => :'fulfillmentCenterId', - :'fulfillment_shipment_status' => :'fulfillmentShipmentStatus', - :'shipping_date' => :'shippingDate', - :'estimated_arrival_date' => :'estimatedArrivalDate', - :'shipping_notes' => :'shippingNotes', - :'fulfillment_shipment_item' => :'fulfillmentShipmentItem', - :'fulfillment_shipment_package' => :'fulfillmentShipmentPackage' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_shipment_id' => :'Object', - :'fulfillment_center_id' => :'Object', - :'fulfillment_shipment_status' => :'Object', - :'shipping_date' => :'Object', - :'estimated_arrival_date' => :'Object', - :'shipping_notes' => :'Object', - :'fulfillment_shipment_item' => :'Object', - :'fulfillment_shipment_package' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_shipment_id') - self.amazon_shipment_id = attributes[:'amazon_shipment_id'] - end - - if attributes.key?(:'fulfillment_center_id') - self.fulfillment_center_id = attributes[:'fulfillment_center_id'] - end - - if attributes.key?(:'fulfillment_shipment_status') - self.fulfillment_shipment_status = attributes[:'fulfillment_shipment_status'] - end - - if attributes.key?(:'shipping_date') - self.shipping_date = attributes[:'shipping_date'] - end - - if attributes.key?(:'estimated_arrival_date') - self.estimated_arrival_date = attributes[:'estimated_arrival_date'] - end - - if attributes.key?(:'shipping_notes') - if (value = attributes[:'shipping_notes']).is_a?(Array) - self.shipping_notes = value - end - end - - if attributes.key?(:'fulfillment_shipment_item') - self.fulfillment_shipment_item = attributes[:'fulfillment_shipment_item'] - end - - if attributes.key?(:'fulfillment_shipment_package') - self.fulfillment_shipment_package = attributes[:'fulfillment_shipment_package'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_shipment_id.nil? - invalid_properties.push('invalid value for "amazon_shipment_id", amazon_shipment_id cannot be nil.') - end - - if @fulfillment_center_id.nil? - invalid_properties.push('invalid value for "fulfillment_center_id", fulfillment_center_id cannot be nil.') - end - - if @fulfillment_shipment_status.nil? - invalid_properties.push('invalid value for "fulfillment_shipment_status", fulfillment_shipment_status cannot be nil.') - end - - if @fulfillment_shipment_item.nil? - invalid_properties.push('invalid value for "fulfillment_shipment_item", fulfillment_shipment_item cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_shipment_id.nil? - return false if @fulfillment_center_id.nil? - return false if @fulfillment_shipment_status.nil? - fulfillment_shipment_status_validator = EnumAttributeValidator.new('Object', ['PENDING', 'SHIPPED', 'CANCELLED_BY_FULFILLER', 'CANCELLED_BY_SELLER']) - return false unless fulfillment_shipment_status_validator.valid?(@fulfillment_shipment_status) - return false if @fulfillment_shipment_item.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] fulfillment_shipment_status Object to be assigned - def fulfillment_shipment_status=(fulfillment_shipment_status) - validator = EnumAttributeValidator.new('Object', ['PENDING', 'SHIPPED', 'CANCELLED_BY_FULFILLER', 'CANCELLED_BY_SELLER']) - unless validator.valid?(fulfillment_shipment_status) - fail ArgumentError, "invalid value for \"fulfillment_shipment_status\", must be one of #{validator.allowable_values}." - end - @fulfillment_shipment_status = fulfillment_shipment_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_shipment_id == o.amazon_shipment_id && - fulfillment_center_id == o.fulfillment_center_id && - fulfillment_shipment_status == o.fulfillment_shipment_status && - shipping_date == o.shipping_date && - estimated_arrival_date == o.estimated_arrival_date && - shipping_notes == o.shipping_notes && - fulfillment_shipment_item == o.fulfillment_shipment_item && - fulfillment_shipment_package == o.fulfillment_shipment_package - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_shipment_id, fulfillment_center_id, fulfillment_shipment_status, shipping_date, estimated_arrival_date, shipping_notes, fulfillment_shipment_item, fulfillment_shipment_package].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item.rb deleted file mode 100644 index 4701656..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for a shipment in a fulfillment order. - class FulfillmentShipmentItem - # The seller SKU of the item. - attr_accessor :seller_sku - - # The fulfillment order item identifier that the seller created and submitted with a call to the `createFulfillmentOrder` operation. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :quantity - - # An identifier for the package that contains the item quantity. - attr_accessor :package_number - - # The serial number of the shipped item. - attr_accessor :serial_number - - attr_accessor :manufacturer_lot_codes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'quantity' => :'quantity', - :'package_number' => :'packageNumber', - :'serial_number' => :'serialNumber', - :'manufacturer_lot_codes' => :'manufacturerLotCodes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'quantity' => :'Object', - :'package_number' => :'Object', - :'serial_number' => :'Object', - :'manufacturer_lot_codes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'package_number') - self.package_number = attributes[:'package_number'] - end - - if attributes.key?(:'serial_number') - self.serial_number = attributes[:'serial_number'] - end - - if attributes.key?(:'manufacturer_lot_codes') - self.manufacturer_lot_codes = attributes[:'manufacturer_lot_codes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - quantity == o.quantity && - package_number == o.package_number && - serial_number == o.serial_number && - manufacturer_lot_codes == o.manufacturer_lot_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, seller_fulfillment_order_item_id, quantity, package_number, serial_number, manufacturer_lot_codes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item_list.rb deleted file mode 100644 index 79b0845..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment shipment item information. - class FulfillmentShipmentItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_list.rb deleted file mode 100644 index 043d80c..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment shipment information. - class FulfillmentShipmentList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package.rb deleted file mode 100644 index 89cb4d5..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Package information for a shipment in a fulfillment order. - class FulfillmentShipmentPackage - # Identifies a package in a shipment. - attr_accessor :package_number - - # Identifies the carrier who will deliver the shipment to the recipient. - attr_accessor :carrier_code - - # The tracking number, if provided, can be used to obtain tracking and delivery information. - attr_accessor :tracking_number - - attr_accessor :estimated_arrival_date - - attr_accessor :locker_details - - attr_accessor :delivery_information - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'package_number' => :'packageNumber', - :'carrier_code' => :'carrierCode', - :'tracking_number' => :'trackingNumber', - :'estimated_arrival_date' => :'estimatedArrivalDate', - :'locker_details' => :'lockerDetails', - :'delivery_information' => :'deliveryInformation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'package_number' => :'Object', - :'carrier_code' => :'Object', - :'tracking_number' => :'Object', - :'estimated_arrival_date' => :'Object', - :'locker_details' => :'Object', - :'delivery_information' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentPackage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentPackage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'package_number') - self.package_number = attributes[:'package_number'] - end - - if attributes.key?(:'carrier_code') - self.carrier_code = attributes[:'carrier_code'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'estimated_arrival_date') - self.estimated_arrival_date = attributes[:'estimated_arrival_date'] - end - - if attributes.key?(:'locker_details') - self.locker_details = attributes[:'locker_details'] - end - - if attributes.key?(:'delivery_information') - self.delivery_information = attributes[:'delivery_information'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @package_number.nil? - invalid_properties.push('invalid value for "package_number", package_number cannot be nil.') - end - - if @carrier_code.nil? - invalid_properties.push('invalid value for "carrier_code", carrier_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @package_number.nil? - return false if @carrier_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - package_number == o.package_number && - carrier_code == o.carrier_code && - tracking_number == o.tracking_number && - estimated_arrival_date == o.estimated_arrival_date && - locker_details == o.locker_details && - delivery_information == o.delivery_information - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [package_number, carrier_code, tracking_number, estimated_arrival_date, locker_details, delivery_information].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package_list.rb deleted file mode 100644 index 252f856..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/fulfillment_shipment_package_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment shipment package information. - class FulfillmentShipmentPackageList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentPackageList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::FulfillmentShipmentPackageList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_product.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_product.rb deleted file mode 100644 index 7283139..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_product.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The product details for the delivery offer. - class GetDeliveryOffersProduct - attr_accessor :product_identifier - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_identifier' => :'productIdentifier', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_identifier' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersProduct` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersProduct`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_identifier') - self.product_identifier = attributes[:'product_identifier'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product_identifier.nil? - invalid_properties.push('invalid value for "product_identifier", product_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_identifier == o.product_identifier && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_identifier, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_request.rb deleted file mode 100644 index 550118e..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_request.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request body schema for the getDeliveryOffers operation. - class GetDeliveryOffersRequest - attr_accessor :product - - attr_accessor :terms - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product' => :'product', - :'terms' => :'terms' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product' => :'Object', - :'terms' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product') - self.product = attributes[:'product'] - end - - if attributes.key?(:'terms') - self.terms = attributes[:'terms'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product.nil? - invalid_properties.push('invalid value for "product", product cannot be nil.') - end - - if @terms.nil? - invalid_properties.push('invalid value for "terms", terms cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product.nil? - return false if @terms.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product == o.product && - terms == o.terms - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product, terms].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_response.rb deleted file mode 100644 index 5d57a45..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the getDeliveryOffers operation. - class GetDeliveryOffersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_result.rb deleted file mode 100644 index 0c7c63a..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_result.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A list of delivery offers, including offer expiration, earliest and latest date and time range, and the delivery offer policy. - class GetDeliveryOffersResult - attr_accessor :delivery_offers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_offers' => :'deliveryOffers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_offers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_offers') - self.delivery_offers = attributes[:'delivery_offers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_offers == o.delivery_offers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_offers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_terms.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_terms.rb deleted file mode 100644 index 350d3b6..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_delivery_offers_terms.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The delivery terms for the delivery offer. - class GetDeliveryOffersTerms - attr_accessor :origin - - attr_accessor :destination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'origin' => :'origin', - :'destination' => :'destination' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'origin' => :'Object', - :'destination' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetDeliveryOffersTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'origin') - self.origin = attributes[:'origin'] - end - - if attributes.key?(:'destination') - self.destination = attributes[:'destination'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @origin.nil? - invalid_properties.push('invalid value for "origin", origin cannot be nil.') - end - - if @destination.nil? - invalid_properties.push('invalid value for "destination", destination cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @origin.nil? - return false if @destination.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - origin == o.origin && - destination == o.destination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [origin, destination].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_response.rb deleted file mode 100644 index 9bb6905..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The breakdown of eligibility inventory by feature. - class GetFeatureInventoryResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureInventoryResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureInventoryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_result.rb deleted file mode 100644 index 888080e..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_inventory_result.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The payload for the `getEligibileInventory` operation. - class GetFeatureInventoryResult - # The requested marketplace. - attr_accessor :marketplace_id - - # The name of the feature. - attr_accessor :feature_name - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # An array of SKUs eligible for this feature and the quantity available. - attr_accessor :feature_skus - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'feature_name' => :'featureName', - :'next_token' => :'nextToken', - :'feature_skus' => :'featureSkus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'feature_name' => :'Object', - :'next_token' => :'Object', - :'feature_skus' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureInventoryResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureInventoryResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'feature_name') - self.feature_name = attributes[:'feature_name'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'feature_skus') - if (value = attributes[:'feature_skus']).is_a?(Array) - self.feature_skus = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @feature_name.nil? - invalid_properties.push('invalid value for "feature_name", feature_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @feature_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - feature_name == o.feature_name && - next_token == o.next_token && - feature_skus == o.feature_skus - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, feature_name, next_token, feature_skus].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_response.rb deleted file mode 100644 index 338f195..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `getFeatureSKU` operation. - class GetFeatureSkuResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureSkuResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureSkuResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_result.rb deleted file mode 100644 index d8b106b..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_feature_sku_result.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The payload for the `getFeatureSKU` operation. - class GetFeatureSkuResult - # The requested marketplace. - attr_accessor :marketplace_id - - # The name of the feature. - attr_accessor :feature_name - - # When true, the seller SKU is eligible for the requested feature. - attr_accessor :is_eligible - - # A list of one or more reasons that the seller SKU is ineligibile for the feature. Possible values: * `MERCHANT_NOT_ENROLLED` - The merchant isn't enrolled for the feature. * `SKU_NOT_ELIGIBLE` - The SKU doesn't reside in a warehouse that supports the feature. * `INVALID_SKU` - There is an issue with the SKU provided. - attr_accessor :ineligible_reasons - - attr_accessor :sku_info - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'feature_name' => :'featureName', - :'is_eligible' => :'isEligible', - :'ineligible_reasons' => :'ineligibleReasons', - :'sku_info' => :'skuInfo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'feature_name' => :'Object', - :'is_eligible' => :'Object', - :'ineligible_reasons' => :'Object', - :'sku_info' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureSkuResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeatureSkuResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'feature_name') - self.feature_name = attributes[:'feature_name'] - end - - if attributes.key?(:'is_eligible') - self.is_eligible = attributes[:'is_eligible'] - end - - if attributes.key?(:'ineligible_reasons') - if (value = attributes[:'ineligible_reasons']).is_a?(Array) - self.ineligible_reasons = value - end - end - - if attributes.key?(:'sku_info') - self.sku_info = attributes[:'sku_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @feature_name.nil? - invalid_properties.push('invalid value for "feature_name", feature_name cannot be nil.') - end - - if @is_eligible.nil? - invalid_properties.push('invalid value for "is_eligible", is_eligible cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @feature_name.nil? - return false if @is_eligible.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - feature_name == o.feature_name && - is_eligible == o.is_eligible && - ineligible_reasons == o.ineligible_reasons && - sku_info == o.sku_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, feature_name, is_eligible, ineligible_reasons, sku_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_response.rb deleted file mode 100644 index 26c604c..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `getFeatures` operation. - class GetFeaturesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_result.rb deleted file mode 100644 index d480b11..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_features_result.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The payload for the `getFeatures` operation. - class GetFeaturesResult - attr_accessor :features - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'features' => :'features' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'features' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeaturesResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFeaturesResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'features') - self.features = attributes[:'features'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @features.nil? - invalid_properties.push('invalid value for "features", features cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @features.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - features == o.features - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [features].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_response.rb deleted file mode 100644 index c7744bc..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `getFulfillmentOrder` operation. - class GetFulfillmentOrderResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_result.rb deleted file mode 100644 index b2bdaa1..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_order_result.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request for the getFulfillmentOrder operation. - class GetFulfillmentOrderResult - attr_accessor :fulfillment_order - - attr_accessor :fulfillment_order_items - - attr_accessor :fulfillment_shipments - - attr_accessor :return_items - - attr_accessor :return_authorizations - - attr_accessor :payment_information - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_order' => :'fulfillmentOrder', - :'fulfillment_order_items' => :'fulfillmentOrderItems', - :'fulfillment_shipments' => :'fulfillmentShipments', - :'return_items' => :'returnItems', - :'return_authorizations' => :'returnAuthorizations', - :'payment_information' => :'paymentInformation' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_order' => :'Object', - :'fulfillment_order_items' => :'Object', - :'fulfillment_shipments' => :'Object', - :'return_items' => :'Object', - :'return_authorizations' => :'Object', - :'payment_information' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentOrderResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentOrderResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_order') - self.fulfillment_order = attributes[:'fulfillment_order'] - end - - if attributes.key?(:'fulfillment_order_items') - self.fulfillment_order_items = attributes[:'fulfillment_order_items'] - end - - if attributes.key?(:'fulfillment_shipments') - self.fulfillment_shipments = attributes[:'fulfillment_shipments'] - end - - if attributes.key?(:'return_items') - self.return_items = attributes[:'return_items'] - end - - if attributes.key?(:'return_authorizations') - self.return_authorizations = attributes[:'return_authorizations'] - end - - if attributes.key?(:'payment_information') - self.payment_information = attributes[:'payment_information'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fulfillment_order.nil? - invalid_properties.push('invalid value for "fulfillment_order", fulfillment_order cannot be nil.') - end - - if @fulfillment_order_items.nil? - invalid_properties.push('invalid value for "fulfillment_order_items", fulfillment_order_items cannot be nil.') - end - - if @return_items.nil? - invalid_properties.push('invalid value for "return_items", return_items cannot be nil.') - end - - if @return_authorizations.nil? - invalid_properties.push('invalid value for "return_authorizations", return_authorizations cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fulfillment_order.nil? - return false if @fulfillment_order_items.nil? - return false if @return_items.nil? - return false if @return_authorizations.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_order == o.fulfillment_order && - fulfillment_order_items == o.fulfillment_order_items && - fulfillment_shipments == o.fulfillment_shipments && - return_items == o.return_items && - return_authorizations == o.return_authorizations && - payment_information == o.payment_information - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_order, fulfillment_order_items, fulfillment_shipments, return_items, return_authorizations, payment_information].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item.rb deleted file mode 100644 index a5e9d40..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for a fulfillment order preview. - class GetFulfillmentPreviewItem - # The seller SKU of the item. - attr_accessor :seller_sku - - attr_accessor :quantity - - attr_accessor :per_unit_declared_value - - # A fulfillment order item identifier that the seller creates to track items in the fulfillment preview. - attr_accessor :seller_fulfillment_order_item_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'quantity' => :'quantity', - :'per_unit_declared_value' => :'perUnitDeclaredValue', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'quantity' => :'Object', - :'per_unit_declared_value' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'per_unit_declared_value') - self.per_unit_declared_value = attributes[:'per_unit_declared_value'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @quantity.nil? - return false if @seller_fulfillment_order_item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - quantity == o.quantity && - per_unit_declared_value == o.per_unit_declared_value && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, quantity, per_unit_declared_value, seller_fulfillment_order_item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item_list.rb deleted file mode 100644 index 07e2763..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment preview item information. - class GetFulfillmentPreviewItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_request.rb deleted file mode 100644 index fb3bfe8..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_request.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request body schema for the `getFulfillmentPreview` operation. - class GetFulfillmentPreviewRequest - # The marketplace the fulfillment order is placed against. - attr_accessor :marketplace_id - - attr_accessor :address - - attr_accessor :items - - attr_accessor :shipping_speed_categories - - # When true, returns all fulfillment order previews both for COD and not for COD. Otherwise, returns only fulfillment order previews that are not for COD. - attr_accessor :include_cod_fulfillment_preview - - # When true, returns the `ScheduledDeliveryInfo` response object, which contains the available delivery windows for a Scheduled Delivery. The `ScheduledDeliveryInfo` response object can only be returned for fulfillment order previews with `ShippingSpeedCategories` = `ScheduledDelivery`. - attr_accessor :include_delivery_windows - - # A list of features and their fulfillment policies to apply to the order. - attr_accessor :feature_constraints - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'address' => :'address', - :'items' => :'items', - :'shipping_speed_categories' => :'shippingSpeedCategories', - :'include_cod_fulfillment_preview' => :'includeCODFulfillmentPreview', - :'include_delivery_windows' => :'includeDeliveryWindows', - :'feature_constraints' => :'featureConstraints' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'address' => :'Object', - :'items' => :'Object', - :'shipping_speed_categories' => :'Object', - :'include_cod_fulfillment_preview' => :'Object', - :'include_delivery_windows' => :'Object', - :'feature_constraints' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'items') - self.items = attributes[:'items'] - end - - if attributes.key?(:'shipping_speed_categories') - self.shipping_speed_categories = attributes[:'shipping_speed_categories'] - end - - if attributes.key?(:'include_cod_fulfillment_preview') - self.include_cod_fulfillment_preview = attributes[:'include_cod_fulfillment_preview'] - end - - if attributes.key?(:'include_delivery_windows') - self.include_delivery_windows = attributes[:'include_delivery_windows'] - end - - if attributes.key?(:'feature_constraints') - if (value = attributes[:'feature_constraints']).is_a?(Array) - self.feature_constraints = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - address == o.address && - items == o.items && - shipping_speed_categories == o.shipping_speed_categories && - include_cod_fulfillment_preview == o.include_cod_fulfillment_preview && - include_delivery_windows == o.include_delivery_windows && - feature_constraints == o.feature_constraints - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, address, items, shipping_speed_categories, include_cod_fulfillment_preview, include_delivery_windows, feature_constraints].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_response.rb deleted file mode 100644 index 32102b6..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `getFulfillmentPreview` operation. - class GetFulfillmentPreviewResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_result.rb deleted file mode 100644 index a738191..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_fulfillment_preview_result.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A list of fulfillment order previews, including estimated shipping weights, estimated shipping fees, and estimated ship dates and arrival dates. - class GetFulfillmentPreviewResult - attr_accessor :fulfillment_previews - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_previews' => :'fulfillmentPreviews' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_previews' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetFulfillmentPreviewResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_previews') - self.fulfillment_previews = attributes[:'fulfillment_previews'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_previews == o.fulfillment_previews - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_previews].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_package_tracking_details_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_package_tracking_details_response.rb deleted file mode 100644 index 98bb4c7..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/get_package_tracking_details_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `getPackageTrackingDetails` operation. - class GetPackageTrackingDetailsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::GetPackageTrackingDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::GetPackageTrackingDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason.rb deleted file mode 100644 index 8503b5d..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The reason that the item is invalid for return. - class InvalidItemReason - attr_accessor :invalid_item_reason_code - - # A human readable description of the invalid item reason code. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invalid_item_reason_code' => :'invalidItemReasonCode', - :'description' => :'description' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invalid_item_reason_code' => :'Object', - :'description' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidItemReason` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidItemReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invalid_item_reason_code') - self.invalid_item_reason_code = attributes[:'invalid_item_reason_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @invalid_item_reason_code.nil? - invalid_properties.push('invalid value for "invalid_item_reason_code", invalid_item_reason_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @invalid_item_reason_code.nil? - return false if @description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invalid_item_reason_code == o.invalid_item_reason_code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invalid_item_reason_code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason_code.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason_code.rb deleted file mode 100644 index ce22a68..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_item_reason_code.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class InvalidItemReasonCode - INVALID_VALUES = 'InvalidValues'.freeze - DUPLICATE_REQUEST = 'DuplicateRequest'.freeze - NO_COMPLETED_SHIP_ITEMS = 'NoCompletedShipItems'.freeze - NO_RETURNABLE_QUANTITY = 'NoReturnableQuantity'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = InvalidItemReasonCode.constants.select { |c| InvalidItemReasonCode::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #InvalidItemReasonCode" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item.rb deleted file mode 100644 index 56bd63e..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An item that is invalid for return. - class InvalidReturnItem - # An identifier assigned by the seller to the return item. - attr_accessor :seller_return_item_id - - # The identifier assigned to the item by the seller when the fulfillment order was created. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :invalid_item_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_return_item_id' => :'sellerReturnItemId', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'invalid_item_reason' => :'invalidItemReason' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_return_item_id' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'invalid_item_reason' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidReturnItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidReturnItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_return_item_id') - self.seller_return_item_id = attributes[:'seller_return_item_id'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'invalid_item_reason') - self.invalid_item_reason = attributes[:'invalid_item_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_return_item_id.nil? - invalid_properties.push('invalid value for "seller_return_item_id", seller_return_item_id cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @invalid_item_reason.nil? - invalid_properties.push('invalid value for "invalid_item_reason", invalid_item_reason cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_return_item_id.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @invalid_item_reason.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_return_item_id == o.seller_return_item_id && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - invalid_item_reason == o.invalid_item_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_return_item_id, seller_fulfillment_order_item_id, invalid_item_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item_list.rb deleted file mode 100644 index b3ff0b4..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/invalid_return_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of invalid return item information. - class InvalidReturnItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidReturnItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::InvalidReturnItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/ip_address.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/ip_address.rb deleted file mode 100644 index dc3f477..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/ip_address.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An IP Address. - class IpAddress - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::IpAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::IpAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_response.rb deleted file mode 100644 index 0a0c752..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `listAllFulfillmentOrders` operation. - class ListAllFulfillmentOrdersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_result.rb deleted file mode 100644 index 382a3ed..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_all_fulfillment_orders_result.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request for the listAllFulfillmentOrders operation. - class ListAllFulfillmentOrdersResult - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # An array of fulfillment order information. - attr_accessor :fulfillment_orders - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken', - :'fulfillment_orders' => :'fulfillmentOrders' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object', - :'fulfillment_orders' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ListAllFulfillmentOrdersResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'fulfillment_orders') - if (value = attributes[:'fulfillment_orders']).is_a?(Array) - self.fulfillment_orders = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token && - fulfillment_orders == o.fulfillment_orders - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token, fulfillment_orders].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_response.rb deleted file mode 100644 index 29c90c5..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `listReturnReasonCodes` operation. - class ListReturnReasonCodesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ListReturnReasonCodesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ListReturnReasonCodesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_result.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_result.rb deleted file mode 100644 index 76c0787..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/list_return_reason_codes_result.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request for the listReturnReasonCodes operation. - class ListReturnReasonCodesResult - attr_accessor :reason_code_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reason_code_details' => :'reasonCodeDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reason_code_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ListReturnReasonCodesResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ListReturnReasonCodesResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reason_code_details') - self.reason_code_details = attributes[:'reason_code_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reason_code_details == o.reason_code_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reason_code_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/locker_details.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/locker_details.rb deleted file mode 100644 index 48d4077..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/locker_details.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The locker details, which you can use to access the locker delivery box. - class LockerDetails - # Indicates the locker number - attr_accessor :locker_number - - # Indicates the locker access code - attr_accessor :locker_access_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'locker_number' => :'lockerNumber', - :'locker_access_code' => :'lockerAccessCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'locker_number' => :'Object', - :'locker_access_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::LockerDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::LockerDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'locker_number') - self.locker_number = attributes[:'locker_number'] - end - - if attributes.key?(:'locker_access_code') - self.locker_access_code = attributes[:'locker_access_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - locker_number == o.locker_number && - locker_access_code == o.locker_access_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [locker_number, locker_access_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/money.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/money.rb deleted file mode 100644 index ec96db3..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/money.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An amount of money, including units in the form of currency. - class Money - # Three digit currency code in ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/notification_email_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/notification_email_list.rb deleted file mode 100644 index 7c9c736..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/notification_email_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A list of email addresses that the seller provides that are used by Amazon to send ship-complete notifications to recipients on behalf of the seller. - class NotificationEmailList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::NotificationEmailList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::NotificationEmailList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/origin.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/origin.rb deleted file mode 100644 index 888d1dd..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/origin.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The origin for the delivery offer. - class Origin - # The two digit country code the items should ship from. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'country_code' => :'countryCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'country_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Origin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Origin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/package_tracking_details.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/package_tracking_details.rb deleted file mode 100644 index f5133ae..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/package_tracking_details.rb +++ /dev/null @@ -1,350 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Tracking details of package - class PackageTrackingDetails - # The package identifier. - attr_accessor :package_number - - # The tracking number for the package. - attr_accessor :tracking_number - - # Link on swiship.com that allows customers to track the package. - attr_accessor :customer_tracking_link - - # The name of the carrier. - attr_accessor :carrier_code - - # The phone number of the carrier. - attr_accessor :carrier_phone_number - - # The URL of the carrier's website. - attr_accessor :carrier_url - - attr_accessor :ship_date - - attr_accessor :estimated_arrival_date - - attr_accessor :ship_to_address - - attr_accessor :current_status - - # Description corresponding to the CurrentStatus value. - attr_accessor :current_status_description - - attr_accessor :delivery_window - - # The name of the person who signed for the package. - attr_accessor :signed_for_by - - attr_accessor :additional_location_info - - attr_accessor :tracking_events - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'package_number' => :'packageNumber', - :'tracking_number' => :'trackingNumber', - :'customer_tracking_link' => :'customerTrackingLink', - :'carrier_code' => :'carrierCode', - :'carrier_phone_number' => :'carrierPhoneNumber', - :'carrier_url' => :'carrierURL', - :'ship_date' => :'shipDate', - :'estimated_arrival_date' => :'estimatedArrivalDate', - :'ship_to_address' => :'shipToAddress', - :'current_status' => :'currentStatus', - :'current_status_description' => :'currentStatusDescription', - :'delivery_window' => :'deliveryWindow', - :'signed_for_by' => :'signedForBy', - :'additional_location_info' => :'additionalLocationInfo', - :'tracking_events' => :'trackingEvents' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'package_number' => :'Object', - :'tracking_number' => :'Object', - :'customer_tracking_link' => :'Object', - :'carrier_code' => :'Object', - :'carrier_phone_number' => :'Object', - :'carrier_url' => :'Object', - :'ship_date' => :'Object', - :'estimated_arrival_date' => :'Object', - :'ship_to_address' => :'Object', - :'current_status' => :'Object', - :'current_status_description' => :'Object', - :'delivery_window' => :'Object', - :'signed_for_by' => :'Object', - :'additional_location_info' => :'Object', - :'tracking_events' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::PackageTrackingDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::PackageTrackingDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'package_number') - self.package_number = attributes[:'package_number'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'customer_tracking_link') - self.customer_tracking_link = attributes[:'customer_tracking_link'] - end - - if attributes.key?(:'carrier_code') - self.carrier_code = attributes[:'carrier_code'] - end - - if attributes.key?(:'carrier_phone_number') - self.carrier_phone_number = attributes[:'carrier_phone_number'] - end - - if attributes.key?(:'carrier_url') - self.carrier_url = attributes[:'carrier_url'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'estimated_arrival_date') - self.estimated_arrival_date = attributes[:'estimated_arrival_date'] - end - - if attributes.key?(:'ship_to_address') - self.ship_to_address = attributes[:'ship_to_address'] - end - - if attributes.key?(:'current_status') - self.current_status = attributes[:'current_status'] - end - - if attributes.key?(:'current_status_description') - self.current_status_description = attributes[:'current_status_description'] - end - - if attributes.key?(:'delivery_window') - self.delivery_window = attributes[:'delivery_window'] - end - - if attributes.key?(:'signed_for_by') - self.signed_for_by = attributes[:'signed_for_by'] - end - - if attributes.key?(:'additional_location_info') - self.additional_location_info = attributes[:'additional_location_info'] - end - - if attributes.key?(:'tracking_events') - self.tracking_events = attributes[:'tracking_events'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @package_number.nil? - invalid_properties.push('invalid value for "package_number", package_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @package_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - package_number == o.package_number && - tracking_number == o.tracking_number && - customer_tracking_link == o.customer_tracking_link && - carrier_code == o.carrier_code && - carrier_phone_number == o.carrier_phone_number && - carrier_url == o.carrier_url && - ship_date == o.ship_date && - estimated_arrival_date == o.estimated_arrival_date && - ship_to_address == o.ship_to_address && - current_status == o.current_status && - current_status_description == o.current_status_description && - delivery_window == o.delivery_window && - signed_for_by == o.signed_for_by && - additional_location_info == o.additional_location_info && - tracking_events == o.tracking_events - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [package_number, tracking_number, customer_tracking_link, carrier_code, carrier_phone_number, carrier_url, ship_date, estimated_arrival_date, ship_to_address, current_status, current_status_description, delivery_window, signed_for_by, additional_location_info, tracking_events].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information.rb deleted file mode 100644 index d073aec..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The attributes related to the payment made from customer to seller for this order. - class PaymentInformation - # The transaction identifier of this payment. - attr_accessor :payment_transaction_id - - # The transaction mode of this payment. - attr_accessor :payment_mode - - attr_accessor :payment_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_transaction_id' => :'paymentTransactionId', - :'payment_mode' => :'paymentMode', - :'payment_date' => :'paymentDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_transaction_id' => :'Object', - :'payment_mode' => :'Object', - :'payment_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::PaymentInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::PaymentInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_transaction_id') - self.payment_transaction_id = attributes[:'payment_transaction_id'] - end - - if attributes.key?(:'payment_mode') - self.payment_mode = attributes[:'payment_mode'] - end - - if attributes.key?(:'payment_date') - self.payment_date = attributes[:'payment_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_transaction_id.nil? - invalid_properties.push('invalid value for "payment_transaction_id", payment_transaction_id cannot be nil.') - end - - if @payment_mode.nil? - invalid_properties.push('invalid value for "payment_mode", payment_mode cannot be nil.') - end - - if @payment_date.nil? - invalid_properties.push('invalid value for "payment_date", payment_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_transaction_id.nil? - return false if @payment_mode.nil? - return false if @payment_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_transaction_id == o.payment_transaction_id && - payment_mode == o.payment_mode && - payment_date == o.payment_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_transaction_id, payment_mode, payment_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information_list.rb deleted file mode 100644 index b66e626..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/payment_information_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of various payment attributes related to this fulfillment order. - class PaymentInformationList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::PaymentInformationList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::PaymentInformationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/product_identifier.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/product_identifier.rb deleted file mode 100644 index 853183c..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/product_identifier.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Product identifier input that locates a product for MCF. - class ProductIdentifier - # The merchant SKU for the product. - attr_accessor :merchant_sku - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'merchant_sku' => :'merchantSku' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'merchant_sku' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ProductIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ProductIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'merchant_sku') - self.merchant_sku = attributes[:'merchant_sku'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @merchant_sku.nil? - invalid_properties.push('invalid value for "merchant_sku", merchant_sku cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @merchant_sku.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - merchant_sku == o.merchant_sku - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [merchant_sku].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/quantity.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/quantity.rb deleted file mode 100644 index 1a948ab..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/quantity.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The item quantity. - class Quantity - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Quantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Quantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details.rb deleted file mode 100644 index 39a38fd..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A return reason code, a description, and an optional description translation. - class ReasonCodeDetails - # A code that indicates a valid return reason. - attr_accessor :return_reason_code - - # A human readable description of the return reason code. - attr_accessor :description - - # A translation of the description. The translation is in the language specified in the Language request parameter. - attr_accessor :translated_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_reason_code' => :'returnReasonCode', - :'description' => :'description', - :'translated_description' => :'translatedDescription' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_reason_code' => :'Object', - :'description' => :'Object', - :'translated_description' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReasonCodeDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReasonCodeDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_reason_code') - self.return_reason_code = attributes[:'return_reason_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'translated_description') - self.translated_description = attributes[:'translated_description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @return_reason_code.nil? - invalid_properties.push('invalid value for "return_reason_code", return_reason_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @return_reason_code.nil? - return false if @description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_reason_code == o.return_reason_code && - description == o.description && - translated_description == o.translated_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_reason_code, description, translated_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details_list.rb deleted file mode 100644 index b85430b..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/reason_code_details_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of return reason code details. - class ReasonCodeDetailsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReasonCodeDetailsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReasonCodeDetailsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization.rb deleted file mode 100644 index 1200ae6..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Return authorization information for items accepted for return. - class ReturnAuthorization - # An identifier for the return authorization. This identifier associates return items with the return authorization used to return them. - attr_accessor :return_authorization_id - - # An identifier for the Amazon fulfillment center that the return items should be sent to. - attr_accessor :fulfillment_center_id - - attr_accessor :return_to_address - - # The return merchandise authorization (RMA) that Amazon needs to process the return. - attr_accessor :amazon_rma_id - - # A URL for a web page that contains the return authorization barcode and the mailing label. This does not include pre-paid shipping. - attr_accessor :rma_page_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_authorization_id' => :'returnAuthorizationId', - :'fulfillment_center_id' => :'fulfillmentCenterId', - :'return_to_address' => :'returnToAddress', - :'amazon_rma_id' => :'amazonRmaId', - :'rma_page_url' => :'rmaPageURL' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_authorization_id' => :'Object', - :'fulfillment_center_id' => :'Object', - :'return_to_address' => :'Object', - :'amazon_rma_id' => :'Object', - :'rma_page_url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnAuthorization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnAuthorization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_authorization_id') - self.return_authorization_id = attributes[:'return_authorization_id'] - end - - if attributes.key?(:'fulfillment_center_id') - self.fulfillment_center_id = attributes[:'fulfillment_center_id'] - end - - if attributes.key?(:'return_to_address') - self.return_to_address = attributes[:'return_to_address'] - end - - if attributes.key?(:'amazon_rma_id') - self.amazon_rma_id = attributes[:'amazon_rma_id'] - end - - if attributes.key?(:'rma_page_url') - self.rma_page_url = attributes[:'rma_page_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @return_authorization_id.nil? - invalid_properties.push('invalid value for "return_authorization_id", return_authorization_id cannot be nil.') - end - - if @fulfillment_center_id.nil? - invalid_properties.push('invalid value for "fulfillment_center_id", fulfillment_center_id cannot be nil.') - end - - if @return_to_address.nil? - invalid_properties.push('invalid value for "return_to_address", return_to_address cannot be nil.') - end - - if @amazon_rma_id.nil? - invalid_properties.push('invalid value for "amazon_rma_id", amazon_rma_id cannot be nil.') - end - - if @rma_page_url.nil? - invalid_properties.push('invalid value for "rma_page_url", rma_page_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @return_authorization_id.nil? - return false if @fulfillment_center_id.nil? - return false if @return_to_address.nil? - return false if @amazon_rma_id.nil? - return false if @rma_page_url.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_authorization_id == o.return_authorization_id && - fulfillment_center_id == o.fulfillment_center_id && - return_to_address == o.return_to_address && - amazon_rma_id == o.amazon_rma_id && - rma_page_url == o.rma_page_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_authorization_id, fulfillment_center_id, return_to_address, amazon_rma_id, rma_page_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization_list.rb deleted file mode 100644 index 7568ad1..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_authorization_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of return authorization information. - class ReturnAuthorizationList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnAuthorizationList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnAuthorizationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item.rb deleted file mode 100644 index 0b02c2f..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item.rb +++ /dev/null @@ -1,339 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An item that Amazon accepted for return. - class ReturnItem - # An identifier assigned by the seller to the return item. - attr_accessor :seller_return_item_id - - # The identifier assigned to the item by the seller when the fulfillment order was created. - attr_accessor :seller_fulfillment_order_item_id - - # The identifier for the shipment that is associated with the return item. - attr_accessor :amazon_shipment_id - - # The return reason code assigned to the return item by the seller. - attr_accessor :seller_return_reason_code - - # An optional comment about the return item. - attr_accessor :return_comment - - # The return reason code that the Amazon fulfillment center assigned to the return item. - attr_accessor :amazon_return_reason_code - - attr_accessor :status - - attr_accessor :status_changed_date - - # Identifies the return authorization used to return this item. Refer to `ReturnAuthorization`. - attr_accessor :return_authorization_id - - attr_accessor :return_received_condition - - # The identifier for the Amazon fulfillment center that processed the return item. - attr_accessor :fulfillment_center_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_return_item_id' => :'sellerReturnItemId', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'amazon_shipment_id' => :'amazonShipmentId', - :'seller_return_reason_code' => :'sellerReturnReasonCode', - :'return_comment' => :'returnComment', - :'amazon_return_reason_code' => :'amazonReturnReasonCode', - :'status' => :'status', - :'status_changed_date' => :'statusChangedDate', - :'return_authorization_id' => :'returnAuthorizationId', - :'return_received_condition' => :'returnReceivedCondition', - :'fulfillment_center_id' => :'fulfillmentCenterId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_return_item_id' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'amazon_shipment_id' => :'Object', - :'seller_return_reason_code' => :'Object', - :'return_comment' => :'Object', - :'amazon_return_reason_code' => :'Object', - :'status' => :'Object', - :'status_changed_date' => :'Object', - :'return_authorization_id' => :'Object', - :'return_received_condition' => :'Object', - :'fulfillment_center_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_return_item_id') - self.seller_return_item_id = attributes[:'seller_return_item_id'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'amazon_shipment_id') - self.amazon_shipment_id = attributes[:'amazon_shipment_id'] - end - - if attributes.key?(:'seller_return_reason_code') - self.seller_return_reason_code = attributes[:'seller_return_reason_code'] - end - - if attributes.key?(:'return_comment') - self.return_comment = attributes[:'return_comment'] - end - - if attributes.key?(:'amazon_return_reason_code') - self.amazon_return_reason_code = attributes[:'amazon_return_reason_code'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'status_changed_date') - self.status_changed_date = attributes[:'status_changed_date'] - end - - if attributes.key?(:'return_authorization_id') - self.return_authorization_id = attributes[:'return_authorization_id'] - end - - if attributes.key?(:'return_received_condition') - self.return_received_condition = attributes[:'return_received_condition'] - end - - if attributes.key?(:'fulfillment_center_id') - self.fulfillment_center_id = attributes[:'fulfillment_center_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_return_item_id.nil? - invalid_properties.push('invalid value for "seller_return_item_id", seller_return_item_id cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @amazon_shipment_id.nil? - invalid_properties.push('invalid value for "amazon_shipment_id", amazon_shipment_id cannot be nil.') - end - - if @seller_return_reason_code.nil? - invalid_properties.push('invalid value for "seller_return_reason_code", seller_return_reason_code cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @status_changed_date.nil? - invalid_properties.push('invalid value for "status_changed_date", status_changed_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_return_item_id.nil? - return false if @seller_fulfillment_order_item_id.nil? - return false if @amazon_shipment_id.nil? - return false if @seller_return_reason_code.nil? - return false if @status.nil? - return false if @status_changed_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_return_item_id == o.seller_return_item_id && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - amazon_shipment_id == o.amazon_shipment_id && - seller_return_reason_code == o.seller_return_reason_code && - return_comment == o.return_comment && - amazon_return_reason_code == o.amazon_return_reason_code && - status == o.status && - status_changed_date == o.status_changed_date && - return_authorization_id == o.return_authorization_id && - return_received_condition == o.return_received_condition && - fulfillment_center_id == o.fulfillment_center_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_return_item_id, seller_fulfillment_order_item_id, amazon_shipment_id, seller_return_reason_code, return_comment, amazon_return_reason_code, status, status_changed_date, return_authorization_id, return_received_condition, fulfillment_center_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_disposition.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_disposition.rb deleted file mode 100644 index 50aeebd..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_disposition.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class ReturnItemDisposition - SELLABLE = 'Sellable'.freeze - DEFECTIVE = 'Defective'.freeze - CUSTOMER_DAMAGED = 'CustomerDamaged'.freeze - CARRIER_DAMAGED = 'CarrierDamaged'.freeze - FULFILLER_DAMAGED = 'FulfillerDamaged'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ReturnItemDisposition.constants.select { |c| ReturnItemDisposition::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ReturnItemDisposition" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_list.rb deleted file mode 100644 index f22b277..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/return_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of items that Amazon accepted for return. Returns empty if no items were accepted for return. - class ReturnItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ReturnItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/scheduled_delivery_info.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/scheduled_delivery_info.rb deleted file mode 100644 index 7f2679a..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/scheduled_delivery_info.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Delivery information for a scheduled delivery. This is only available in the JP marketplace. - class ScheduledDeliveryInfo - # The time zone of the destination address for the fulfillment order preview. Must be an IANA time zone name. Example: Asia/Tokyo. - attr_accessor :delivery_time_zone - - attr_accessor :delivery_windows - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_time_zone' => :'deliveryTimeZone', - :'delivery_windows' => :'deliveryWindows' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_time_zone' => :'Object', - :'delivery_windows' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ScheduledDeliveryInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ScheduledDeliveryInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_time_zone') - self.delivery_time_zone = attributes[:'delivery_time_zone'] - end - - if attributes.key?(:'delivery_windows') - self.delivery_windows = attributes[:'delivery_windows'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @delivery_time_zone.nil? - invalid_properties.push('invalid value for "delivery_time_zone", delivery_time_zone cannot be nil.') - end - - if @delivery_windows.nil? - invalid_properties.push('invalid value for "delivery_windows", delivery_windows cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @delivery_time_zone.nil? - return false if @delivery_windows.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_time_zone == o.delivery_time_zone && - delivery_windows == o.delivery_windows - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_time_zone, delivery_windows].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category.rb deleted file mode 100644 index 3890c1f..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - class ShippingSpeedCategory - STANDARD = 'Standard'.freeze - EXPEDITED = 'Expedited'.freeze - PRIORITY = 'Priority'.freeze - SCHEDULED_DELIVERY = 'ScheduledDelivery'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ShippingSpeedCategory.constants.select { |c| ShippingSpeedCategory::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ShippingSpeedCategory" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category_list.rb deleted file mode 100644 index 19cb453..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/shipping_speed_category_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # ShippingSpeedCategory List - class ShippingSpeedCategoryList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::ShippingSpeedCategoryList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::ShippingSpeedCategoryList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/string_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/string_list.rb deleted file mode 100644 index 68be16d..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/string_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # String list - class StringList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::StringList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::StringList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_request.rb deleted file mode 100644 index 89c47e4..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request body schema for the `submitFulfillmentOrderStatusUpdate` operation. - class SubmitFulfillmentOrderStatusUpdateRequest - attr_accessor :fulfillment_order_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_order_status' => :'fulfillmentOrderStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_order_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_order_status') - self.fulfillment_order_status = attributes[:'fulfillment_order_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_order_status == o.fulfillment_order_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_order_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_response.rb deleted file mode 100644 index 6dc9c7b..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/submit_fulfillment_order_status_update_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `SubmitFulfillmentOrderStatusUpdate` operation. - class SubmitFulfillmentOrderStatusUpdateResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::SubmitFulfillmentOrderStatusUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/timestamp.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/timestamp.rb deleted file mode 100644 index 5620a86..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/timestamp.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Date timestamp - class Timestamp - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Timestamp` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Timestamp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_address.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_address.rb deleted file mode 100644 index d9957aa..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_address.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Address information for tracking the package. - class TrackingAddress - # The city. - attr_accessor :city - - # The state. - attr_accessor :state - - # The country. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'state' => :'state', - :'country' => :'country' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'Object', - :'state' => :'Object', - :'country' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @state.nil? - invalid_properties.push('invalid value for "state", state cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @city.nil? - return false if @state.nil? - return false if @country.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - state == o.state && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, state, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event.rb deleted file mode 100644 index 958df57..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Information for tracking package deliveries. - class TrackingEvent - attr_accessor :event_date - - attr_accessor :event_address - - attr_accessor :event_code - - # A description for the corresponding event code. - attr_accessor :event_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_date' => :'eventDate', - :'event_address' => :'eventAddress', - :'event_code' => :'eventCode', - :'event_description' => :'eventDescription' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_date' => :'Object', - :'event_address' => :'Object', - :'event_code' => :'Object', - :'event_description' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingEvent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_date') - self.event_date = attributes[:'event_date'] - end - - if attributes.key?(:'event_address') - self.event_address = attributes[:'event_address'] - end - - if attributes.key?(:'event_code') - self.event_code = attributes[:'event_code'] - end - - if attributes.key?(:'event_description') - self.event_description = attributes[:'event_description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @event_date.nil? - invalid_properties.push('invalid value for "event_date", event_date cannot be nil.') - end - - if @event_address.nil? - invalid_properties.push('invalid value for "event_address", event_address cannot be nil.') - end - - if @event_code.nil? - invalid_properties.push('invalid value for "event_code", event_code cannot be nil.') - end - - if @event_description.nil? - invalid_properties.push('invalid value for "event_description", event_description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_date.nil? - return false if @event_address.nil? - return false if @event_code.nil? - return false if @event_description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_date == o.event_date && - event_address == o.event_address && - event_code == o.event_code && - event_description == o.event_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_date, event_address, event_code, event_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event_list.rb deleted file mode 100644 index a42b218..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/tracking_event_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of tracking event information. - class TrackingEventList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingEventList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::TrackingEventList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item.rb deleted file mode 100644 index 0a9f569..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Information about unfulfillable items in a fulfillment order preview. - class UnfulfillablePreviewItem - # The seller SKU of the item. - attr_accessor :seller_sku - - attr_accessor :quantity - - # A fulfillment order item identifier created with a call to the `getFulfillmentPreview` operation. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :item_unfulfillable_reasons - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'quantity' => :'quantity', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'item_unfulfillable_reasons' => :'itemUnfulfillableReasons' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'quantity' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'item_unfulfillable_reasons' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UnfulfillablePreviewItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UnfulfillablePreviewItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'item_unfulfillable_reasons') - self.item_unfulfillable_reasons = attributes[:'item_unfulfillable_reasons'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_sku.nil? - invalid_properties.push('invalid value for "seller_sku", seller_sku cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_sku.nil? - return false if @quantity.nil? - return false if @seller_fulfillment_order_item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - quantity == o.quantity && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - item_unfulfillable_reasons == o.item_unfulfillable_reasons - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, quantity, seller_fulfillment_order_item_id, item_unfulfillable_reasons].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item_list.rb deleted file mode 100644 index 8888fcb..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/unfulfillable_preview_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of unfulfillable preview item information. - class UnfulfillablePreviewItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UnfulfillablePreviewItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UnfulfillablePreviewItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item.rb deleted file mode 100644 index 7637c76..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # Item information for updating a fulfillment order. - class UpdateFulfillmentOrderItem - # The seller SKU of the item. - attr_accessor :seller_sku - - # Identifies the fulfillment order item to update. Created with a previous call to the createFulfillmentOrder operation. - attr_accessor :seller_fulfillment_order_item_id - - attr_accessor :quantity - - # A message to the gift recipient, if applicable. - attr_accessor :gift_message - - # Item-specific text that displays in recipient-facing materials such as the outbound shipment packing slip. - attr_accessor :displayable_comment - - # Amazon's fulfillment network SKU of the item. - attr_accessor :fulfillment_network_sku - - # Indicates whether the item is sellable or unsellable. - attr_accessor :order_item_disposition - - attr_accessor :per_unit_declared_value - - attr_accessor :per_unit_price - - attr_accessor :per_unit_tax - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'seller_sku' => :'sellerSku', - :'seller_fulfillment_order_item_id' => :'sellerFulfillmentOrderItemId', - :'quantity' => :'quantity', - :'gift_message' => :'giftMessage', - :'displayable_comment' => :'displayableComment', - :'fulfillment_network_sku' => :'fulfillmentNetworkSku', - :'order_item_disposition' => :'orderItemDisposition', - :'per_unit_declared_value' => :'perUnitDeclaredValue', - :'per_unit_price' => :'perUnitPrice', - :'per_unit_tax' => :'perUnitTax' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'seller_sku' => :'Object', - :'seller_fulfillment_order_item_id' => :'Object', - :'quantity' => :'Object', - :'gift_message' => :'Object', - :'displayable_comment' => :'Object', - :'fulfillment_network_sku' => :'Object', - :'order_item_disposition' => :'Object', - :'per_unit_declared_value' => :'Object', - :'per_unit_price' => :'Object', - :'per_unit_tax' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'seller_fulfillment_order_item_id') - self.seller_fulfillment_order_item_id = attributes[:'seller_fulfillment_order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'gift_message') - self.gift_message = attributes[:'gift_message'] - end - - if attributes.key?(:'displayable_comment') - self.displayable_comment = attributes[:'displayable_comment'] - end - - if attributes.key?(:'fulfillment_network_sku') - self.fulfillment_network_sku = attributes[:'fulfillment_network_sku'] - end - - if attributes.key?(:'order_item_disposition') - self.order_item_disposition = attributes[:'order_item_disposition'] - end - - if attributes.key?(:'per_unit_declared_value') - self.per_unit_declared_value = attributes[:'per_unit_declared_value'] - end - - if attributes.key?(:'per_unit_price') - self.per_unit_price = attributes[:'per_unit_price'] - end - - if attributes.key?(:'per_unit_tax') - self.per_unit_tax = attributes[:'per_unit_tax'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seller_fulfillment_order_item_id.nil? - invalid_properties.push('invalid value for "seller_fulfillment_order_item_id", seller_fulfillment_order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seller_fulfillment_order_item_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - seller_sku == o.seller_sku && - seller_fulfillment_order_item_id == o.seller_fulfillment_order_item_id && - quantity == o.quantity && - gift_message == o.gift_message && - displayable_comment == o.displayable_comment && - fulfillment_network_sku == o.fulfillment_network_sku && - order_item_disposition == o.order_item_disposition && - per_unit_declared_value == o.per_unit_declared_value && - per_unit_price == o.per_unit_price && - per_unit_tax == o.per_unit_tax - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [seller_sku, seller_fulfillment_order_item_id, quantity, gift_message, displayable_comment, fulfillment_network_sku, order_item_disposition, per_unit_declared_value, per_unit_price, per_unit_tax].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item_list.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item_list.rb deleted file mode 100644 index da2fa1f..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # An array of fulfillment order item information for updating a fulfillment order. - class UpdateFulfillmentOrderItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_request.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_request.rb deleted file mode 100644 index f4bc3e9..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_request.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The request body schema for the `updateFulfillmentOrder` operation. - class UpdateFulfillmentOrderRequest - # The marketplace the fulfillment order is placed against. - attr_accessor :marketplace_id - - # A fulfillment order identifier that the seller creates. This value displays as the order identifier in recipient-facing materials such as the outbound shipment packing slip. The value of `DisplayableOrderId` should match the order identifier that the seller provides to the recipient. The seller can use the `SellerFulfillmentOrderId` for this value or they can specify an alternate value if they want the recipient to reference an alternate order identifier. - attr_accessor :displayable_order_id - - attr_accessor :displayable_order_date - - # Order-specific text that appears in recipient-facing materials such as the outbound shipment packing slip. - attr_accessor :displayable_order_comment - - attr_accessor :shipping_speed_category - - attr_accessor :destination_address - - attr_accessor :fulfillment_action - - attr_accessor :fulfillment_policy - - # The two-character country code for the country from which the fulfillment order ships. Must be in ISO 3166-1 alpha-2 format. - attr_accessor :ship_from_country_code - - attr_accessor :notification_emails - - # A list of features and their fulfillment policies to apply to the order. - attr_accessor :feature_constraints - - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'displayable_order_id' => :'displayableOrderId', - :'displayable_order_date' => :'displayableOrderDate', - :'displayable_order_comment' => :'displayableOrderComment', - :'shipping_speed_category' => :'shippingSpeedCategory', - :'destination_address' => :'destinationAddress', - :'fulfillment_action' => :'fulfillmentAction', - :'fulfillment_policy' => :'fulfillmentPolicy', - :'ship_from_country_code' => :'shipFromCountryCode', - :'notification_emails' => :'notificationEmails', - :'feature_constraints' => :'featureConstraints', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'displayable_order_id' => :'Object', - :'displayable_order_date' => :'Object', - :'displayable_order_comment' => :'Object', - :'shipping_speed_category' => :'Object', - :'destination_address' => :'Object', - :'fulfillment_action' => :'Object', - :'fulfillment_policy' => :'Object', - :'ship_from_country_code' => :'Object', - :'notification_emails' => :'Object', - :'feature_constraints' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'displayable_order_id') - self.displayable_order_id = attributes[:'displayable_order_id'] - end - - if attributes.key?(:'displayable_order_date') - self.displayable_order_date = attributes[:'displayable_order_date'] - end - - if attributes.key?(:'displayable_order_comment') - self.displayable_order_comment = attributes[:'displayable_order_comment'] - end - - if attributes.key?(:'shipping_speed_category') - self.shipping_speed_category = attributes[:'shipping_speed_category'] - end - - if attributes.key?(:'destination_address') - self.destination_address = attributes[:'destination_address'] - end - - if attributes.key?(:'fulfillment_action') - self.fulfillment_action = attributes[:'fulfillment_action'] - end - - if attributes.key?(:'fulfillment_policy') - self.fulfillment_policy = attributes[:'fulfillment_policy'] - end - - if attributes.key?(:'ship_from_country_code') - self.ship_from_country_code = attributes[:'ship_from_country_code'] - end - - if attributes.key?(:'notification_emails') - self.notification_emails = attributes[:'notification_emails'] - end - - if attributes.key?(:'feature_constraints') - if (value = attributes[:'feature_constraints']).is_a?(Array) - self.feature_constraints = value - end - end - - if attributes.key?(:'items') - self.items = attributes[:'items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - displayable_order_id == o.displayable_order_id && - displayable_order_date == o.displayable_order_date && - displayable_order_comment == o.displayable_order_comment && - shipping_speed_category == o.shipping_speed_category && - destination_address == o.destination_address && - fulfillment_action == o.fulfillment_action && - fulfillment_policy == o.fulfillment_policy && - ship_from_country_code == o.ship_from_country_code && - notification_emails == o.notification_emails && - feature_constraints == o.feature_constraints && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, displayable_order_id, displayable_order_date, displayable_order_comment, shipping_speed_category, destination_address, fulfillment_action, fulfillment_policy, ship_from_country_code, notification_emails, feature_constraints, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_response.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_response.rb deleted file mode 100644 index 7eb1728..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/update_fulfillment_order_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The response schema for the `updateFulfillmentOrder` operation. - class UpdateFulfillmentOrderResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::UpdateFulfillmentOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/variable_precision_address.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/variable_precision_address.rb deleted file mode 100644 index 2fd1331..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/variable_precision_address.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # A physical address with varying degrees of precision. A more precise address can provide more accurate results than country code and postal code alone. - class VariablePrecisionAddress - # The first line of the address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - # The city where the person, business, or institution is located. This property should not be used in Japan. - attr_accessor :city - - # The district or county where the person, business, or institution is located. - attr_accessor :district_or_county - - # The state or region where the person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of the address. - attr_accessor :postal_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'district_or_county' => :'districtOrCounty', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'district_or_county' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::VariablePrecisionAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::VariablePrecisionAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'district_or_county') - self.district_or_county = attributes[:'district_or_county'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @postal_code.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - district_or_county == o.district_or_county && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address_line1, address_line2, address_line3, city, district_or_county, state_or_region, postal_code, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/weight.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/weight.rb deleted file mode 100644 index 3156535..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/models/weight.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpFulfillmentOutbound2020 - # The weight. - class Weight - # The unit of weight. - attr_accessor :unit - - # The weight value. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit' => :'unit', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpFulfillmentOutbound2020::Weight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpFulfillmentOutbound2020::Weight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit.nil? - unit_validator = EnumAttributeValidator.new('Object', ['KG', 'KILOGRAMS', 'LB', 'POUNDS']) - return false unless unit_validator.valid?(@unit) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('Object', ['KG', 'KILOGRAMS', 'LB', 'POUNDS']) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit == o.unit && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpFulfillmentOutbound2020.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/version.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/version.rb deleted file mode 100644 index ceb360a..0000000 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpFulfillmentOutbound2020 - VERSION = '1.0.0' -end diff --git a/vendor/fulfillment_outbound_2020/sp_fulfillment_outbound_2020.gemspec b/vendor/fulfillment_outbound_2020/sp_fulfillment_outbound_2020.gemspec deleted file mode 100644 index d519b8b..0000000 --- a/vendor/fulfillment_outbound_2020/sp_fulfillment_outbound_2020.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner APIs for Fulfillment Outbound - -#The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. - -OpenAPI spec version: 2020-07-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_fulfillment_outbound_2020/version" - -Gem::Specification.new do |s| - s.name = "sp_fulfillment_outbound_2020" - s.version = SpFulfillmentOutbound2020::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner APIs for Fulfillment Outbound Ruby Gem" - s.description = "The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/listings_items_2021/.gitignore b/vendor/listings_items_2021/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/listings_items_2021/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/listings_items_2021/.rspec b/vendor/listings_items_2021/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/listings_items_2021/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/listings_items_2021/.rubocop.yml b/vendor/listings_items_2021/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/listings_items_2021/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/listings_items_2021/.swagger-codegen-ignore b/vendor/listings_items_2021/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/listings_items_2021/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/listings_items_2021/.swagger-codegen/VERSION b/vendor/listings_items_2021/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/listings_items_2021/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/listings_items_2021/Gemfile b/vendor/listings_items_2021/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/listings_items_2021/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/listings_items_2021/README.md b/vendor/listings_items_2021/README.md deleted file mode 100644 index dfe96ac..0000000 --- a/vendor/listings_items_2021/README.md +++ /dev/null @@ -1,208 +0,0 @@ -# sp_listings_items_2021 - -SpListingsItems2021 - the Ruby gem for the Selling Partner API for Listings Items - -The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2021-08-01 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_listings_items_2021.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_listings_items_2021-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_listings_items_2021-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_listings_items_2021', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_listings_items_2021', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_listings_items_2021' - -api_instance = SpListingsItems2021::ListingsApi.new -seller_id = 'seller_id_example' # String | A selling partner identifier, such as a merchant account or vendor code. -sku = 'sku_example' # String | A selling partner provided identifier for an Amazon listing. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - issue_locale: 'issue_locale_example' # String | A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. -} - -begin - result = api_instance.delete_listings_item(seller_id, sku, marketplace_ids, opts) - p result -rescue SpListingsItems2021::ApiError => e - puts "Exception when calling ListingsApi->delete_listings_item: #{e}" -end - -api_instance = SpListingsItems2021::ListingsApi.new -seller_id = 'seller_id_example' # String | A selling partner identifier, such as a merchant account or vendor code. -sku = 'sku_example' # String | A selling partner provided identifier for an Amazon listing. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - issue_locale: 'issue_locale_example', # String | A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. - included_data: ['included_data_example'] # Array | A comma-delimited list of data sets to include in the response. Default: `summaries`. -} - -begin - result = api_instance.get_listings_item(seller_id, sku, marketplace_ids, opts) - p result -rescue SpListingsItems2021::ApiError => e - puts "Exception when calling ListingsApi->get_listings_item: #{e}" -end - -api_instance = SpListingsItems2021::ListingsApi.new -body = SpListingsItems2021::ListingsItemPatchRequest.new # ListingsItemPatchRequest | The request body schema for the `patchListingsItem` operation. -seller_id = 'seller_id_example' # String | A selling partner identifier, such as a merchant account or vendor code. -sku = 'sku_example' # String | A selling partner provided identifier for an Amazon listing. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - included_data: ['included_data_example'], # Array | A comma-delimited list of data sets to include in the response. Default: `issues`. - mode: 'mode_example', # String | The mode of operation for the request. - issue_locale: 'issue_locale_example' # String | A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. -} - -begin - result = api_instance.patch_listings_item(body, seller_id, sku, marketplace_ids, opts) - p result -rescue SpListingsItems2021::ApiError => e - puts "Exception when calling ListingsApi->patch_listings_item: #{e}" -end - -api_instance = SpListingsItems2021::ListingsApi.new -body = SpListingsItems2021::ListingsItemPutRequest.new # ListingsItemPutRequest | The request body schema for the `putListingsItem` operation. -seller_id = 'seller_id_example' # String | A selling partner identifier, such as a merchant account or vendor code. -sku = 'sku_example' # String | A selling partner provided identifier for an Amazon listing. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - included_data: ['included_data_example'], # Array | A comma-delimited list of data sets to include in the response. Default: `issues`. - mode: 'mode_example', # String | The mode of operation for the request. - issue_locale: 'issue_locale_example' # String | A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. -} - -begin - result = api_instance.put_listings_item(body, seller_id, sku, marketplace_ids, opts) - p result -rescue SpListingsItems2021::ApiError => e - puts "Exception when calling ListingsApi->put_listings_item: #{e}" -end - -api_instance = SpListingsItems2021::ListingsApi.new -seller_id = 'seller_id_example' # String | A selling partner identifier, such as a merchant account or vendor code. -marketplace_ids = ['marketplace_ids_example'] # Array | A comma-delimited list of Amazon marketplace identifiers for the request. -opts = { - issue_locale: 'issue_locale_example', # String | A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\". - included_data: ['included_data_example'], # Array | A comma-delimited list of datasets that you want to include in the response. Default: `summaries`. - identifiers: ['identifiers_example'], # Array | A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`. - identifiers_type: 'identifiers_type_example', # String | A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided. - variation_parent_sku: 'variation_parent_sku_example', # String | Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request. - package_hierarchy_sku: 'package_hierarchy_sku_example', # String | Filter results to include listing items that contain or are contained by the specified SKU. **Note**: You cannot use `packageHierarchySku` if you include `identifiers` or `variationParentSku` in your request. - created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date-time that is used to filter listing items. The response includes listings items that were created at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. - created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date-time that is used to filter listing items. The response includes listings items that were created at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. - last_updated_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date-time that is used to filter listing items. The response includes listings items that were last updated at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. - last_updated_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | A date-time that is used to filter listing items. The response includes listings items that were last updated at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. - with_issue_severity: ['with_issue_severity_example'], # Array | Filter results to include only listing items that have issues that match one or more of the specified severity levels. - with_status: ['with_status_example'], # Array | Filter results to include only listing items that have the specified status. - without_status: ['without_status_example'], # Array | Filter results to include only listing items that don't contain the specified statuses. - sort_by: 'lastUpdatedDate', # String | An attribute by which to sort the returned listing items. - sort_order: 'DESC', # String | The order in which to sort the result items. - page_size: 10, # Integer | The number of results that you want to include on each page. - page_token: 'page_token_example' # String | A token that you can use to fetch a specific page when there are multiple pages of results. -} - -begin - result = api_instance.search_listings_items(seller_id, marketplace_ids, opts) - p result -rescue SpListingsItems2021::ApiError => e - puts "Exception when calling ListingsApi->search_listings_items: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpListingsItems2021::ListingsApi* | [**delete_listings_item**](docs/ListingsApi.md#delete_listings_item) | **DELETE** /listings/2021-08-01/items/{sellerId}/{sku} | -*SpListingsItems2021::ListingsApi* | [**get_listings_item**](docs/ListingsApi.md#get_listings_item) | **GET** /listings/2021-08-01/items/{sellerId}/{sku} | -*SpListingsItems2021::ListingsApi* | [**patch_listings_item**](docs/ListingsApi.md#patch_listings_item) | **PATCH** /listings/2021-08-01/items/{sellerId}/{sku} | -*SpListingsItems2021::ListingsApi* | [**put_listings_item**](docs/ListingsApi.md#put_listings_item) | **PUT** /listings/2021-08-01/items/{sellerId}/{sku} | -*SpListingsItems2021::ListingsApi* | [**search_listings_items**](docs/ListingsApi.md#search_listings_items) | **GET** /listings/2021-08-01/items/{sellerId} | - -## Documentation for Models - - - [SpListingsItems2021::Audience](docs/Audience.md) - - [SpListingsItems2021::Decimal](docs/Decimal.md) - - [SpListingsItems2021::Error](docs/Error.md) - - [SpListingsItems2021::ErrorList](docs/ErrorList.md) - - [SpListingsItems2021::FulfillmentAvailability](docs/FulfillmentAvailability.md) - - [SpListingsItems2021::Issue](docs/Issue.md) - - [SpListingsItems2021::IssueEnforcementAction](docs/IssueEnforcementAction.md) - - [SpListingsItems2021::IssueEnforcements](docs/IssueEnforcements.md) - - [SpListingsItems2021::IssueExemption](docs/IssueExemption.md) - - [SpListingsItems2021::Item](docs/Item.md) - - [SpListingsItems2021::ItemAttributes](docs/ItemAttributes.md) - - [SpListingsItems2021::ItemIdentifiers](docs/ItemIdentifiers.md) - - [SpListingsItems2021::ItemIdentifiersByMarketplace](docs/ItemIdentifiersByMarketplace.md) - - [SpListingsItems2021::ItemImage](docs/ItemImage.md) - - [SpListingsItems2021::ItemIssues](docs/ItemIssues.md) - - [SpListingsItems2021::ItemOfferByMarketplace](docs/ItemOfferByMarketplace.md) - - [SpListingsItems2021::ItemOffers](docs/ItemOffers.md) - - [SpListingsItems2021::ItemProcurement](docs/ItemProcurement.md) - - [SpListingsItems2021::ItemProductTypeByMarketplace](docs/ItemProductTypeByMarketplace.md) - - [SpListingsItems2021::ItemProductTypes](docs/ItemProductTypes.md) - - [SpListingsItems2021::ItemRelationship](docs/ItemRelationship.md) - - [SpListingsItems2021::ItemRelationships](docs/ItemRelationships.md) - - [SpListingsItems2021::ItemRelationshipsByMarketplace](docs/ItemRelationshipsByMarketplace.md) - - [SpListingsItems2021::ItemSearchResults](docs/ItemSearchResults.md) - - [SpListingsItems2021::ItemSummaries](docs/ItemSummaries.md) - - [SpListingsItems2021::ItemSummaryByMarketplace](docs/ItemSummaryByMarketplace.md) - - [SpListingsItems2021::ItemVariationTheme](docs/ItemVariationTheme.md) - - [SpListingsItems2021::ListingsItemPatchRequest](docs/ListingsItemPatchRequest.md) - - [SpListingsItems2021::ListingsItemPutRequest](docs/ListingsItemPutRequest.md) - - [SpListingsItems2021::ListingsItemSubmissionResponse](docs/ListingsItemSubmissionResponse.md) - - [SpListingsItems2021::Money](docs/Money.md) - - [SpListingsItems2021::Pagination](docs/Pagination.md) - - [SpListingsItems2021::PatchOperation](docs/PatchOperation.md) - - [SpListingsItems2021::Points](docs/Points.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/listings_items_2021/Rakefile b/vendor/listings_items_2021/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/listings_items_2021/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/listings_items_2021/git_push.sh b/vendor/listings_items_2021/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/listings_items_2021/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/api_client.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/api_client.rb deleted file mode 100644 index 0bb74b7..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpListingsItems2021 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpListingsItems2021.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/api_error.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/api_error.rb deleted file mode 100644 index 6ab1717..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpListingsItems2021 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/configuration.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/configuration.rb deleted file mode 100644 index 67c3efb..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpListingsItems2021 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/audience.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/audience.rb deleted file mode 100644 index 30218ea..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/audience.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Buyer segment or program this offer is applicable to. - class Audience - # Name of the audience an offer is applicable to. Common values: * 'ALL' - Standard offer audience for buyers on Amazon retail websites. * 'B2B' - Offer audience for Amazon Business website buyers. - attr_accessor :value - - # Localized display name for the audience. - attr_accessor :display_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'display_name' => :'displayName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Object', - :'display_name' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Audience` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Audience`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - display_name == o.display_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, display_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/decimal.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/decimal.rb deleted file mode 100644 index 081d57a..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # A decimal number with no loss of precision. Useful when precision loss is unnaceptable, as with currencies. Follows RFC7159 for number representation. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error.rb deleted file mode 100644 index 6b9889a..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error_list.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error_list.rb deleted file mode 100644 index 4e721c2..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/error_list.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/fulfillment_availability.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/fulfillment_availability.rb deleted file mode 100644 index a27dbdf..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/fulfillment_availability.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The fulfillment availability details for the listings item. - class FulfillmentAvailability - # The code of the fulfillment network that will be used. - attr_accessor :fulfillment_channel_code - - # The quantity of the item you are making available for sale. - attr_accessor :quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_channel_code' => :'fulfillmentChannelCode', - :'quantity' => :'quantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_channel_code' => :'Object', - :'quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::FulfillmentAvailability` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::FulfillmentAvailability`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_channel_code') - self.fulfillment_channel_code = attributes[:'fulfillment_channel_code'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fulfillment_channel_code.nil? - invalid_properties.push('invalid value for "fulfillment_channel_code", fulfillment_channel_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fulfillment_channel_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_channel_code == o.fulfillment_channel_code && - quantity == o.quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_channel_code, quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue.rb deleted file mode 100644 index 20b5621..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # An issue with a listings item. - class Issue - # An issue code that identifies the type of issue. - attr_accessor :code - - # A message that describes the issue. - attr_accessor :message - - # The severity of the issue. - attr_accessor :severity - - # The names of the attributes associated with the issue, if applicable. - attr_accessor :attribute_names - - # List of issue categories. Possible vales: * `INVALID_ATTRIBUTE` - Indicating an invalid attribute in the listing. * `MISSING_ATTRIBUTE` - Highlighting a missing attribute in the listing. * `INVALID_IMAGE` - Signifying an invalid image in the listing. * `MISSING_IMAGE` - Noting the absence of an image in the listing. * `INVALID_PRICE` - Pertaining to issues with the listing's price-related attributes. * `MISSING_PRICE` - Pointing out the absence of a price attribute in the listing. * `DUPLICATE` - Identifying listings with potential duplicate problems, such as this ASIN potentially being a duplicate of another ASIN. * `QUALIFICATION_REQUIRED` - Indicating that the listing requires qualification-related approval. - attr_accessor :categories - - attr_accessor :enforcements - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'severity' => :'severity', - :'attribute_names' => :'attributeNames', - :'categories' => :'categories', - :'enforcements' => :'enforcements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'severity' => :'Object', - :'attribute_names' => :'Object', - :'categories' => :'Object', - :'enforcements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Issue` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Issue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'severity') - self.severity = attributes[:'severity'] - end - - if attributes.key?(:'attribute_names') - if (value = attributes[:'attribute_names']).is_a?(Array) - self.attribute_names = value - end - end - - if attributes.key?(:'categories') - if (value = attributes[:'categories']).is_a?(Array) - self.categories = value - end - end - - if attributes.key?(:'enforcements') - self.enforcements = attributes[:'enforcements'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - if @severity.nil? - invalid_properties.push('invalid value for "severity", severity cannot be nil.') - end - - if @categories.nil? - invalid_properties.push('invalid value for "categories", categories cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - return false if @severity.nil? - severity_validator = EnumAttributeValidator.new('Object', ['ERROR', 'WARNING', 'INFO']) - return false unless severity_validator.valid?(@severity) - return false if @categories.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] severity Object to be assigned - def severity=(severity) - validator = EnumAttributeValidator.new('Object', ['ERROR', 'WARNING', 'INFO']) - unless validator.valid?(severity) - fail ArgumentError, "invalid value for \"severity\", must be one of #{validator.allowable_values}." - end - @severity = severity - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - severity == o.severity && - attribute_names == o.attribute_names && - categories == o.categories && - enforcements == o.enforcements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, severity, attribute_names, categories, enforcements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcement_action.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcement_action.rb deleted file mode 100644 index aad21b4..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcement_action.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The enforcement action taken by Amazon that affect the publishing or status of a listing - class IssueEnforcementAction - # The enforcement action name. Possible values: * `LISTING_SUPPRESSED` - This enforcement takes down the current listing item's buyability. * `ATTRIBUTE_SUPPRESSED` - An attribute's value on the listing item is invalid, which causes it to be rejected by Amazon. * `CATALOG_ITEM_REMOVED` - This catalog item is inactive on Amazon, and all offers against it in the applicable marketplace are non-buyable. * `SEARCH_SUPPRESSED` - This value indicates that the catalog item is hidden from search results. - attr_accessor :action - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action' => :'action' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'action' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::IssueEnforcementAction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::IssueEnforcementAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action') - self.action = attributes[:'action'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action.nil? - invalid_properties.push('invalid value for "action", action cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @action.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action == o.action - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcements.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcements.rb deleted file mode 100644 index 478a721..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_enforcements.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # This field provides information about the enforcement actions taken by Amazon that affect the publishing or status of a listing. It also includes details about any associated exemptions. - class IssueEnforcements - # List of enforcement actions taken by Amazon that affect the publishing or status of a listing. - attr_accessor :actions - - attr_accessor :exemption - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'actions' => :'actions', - :'exemption' => :'exemption' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'actions' => :'Object', - :'exemption' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::IssueEnforcements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::IssueEnforcements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'actions') - if (value = attributes[:'actions']).is_a?(Array) - self.actions = value - end - end - - if attributes.key?(:'exemption') - self.exemption = attributes[:'exemption'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @actions.nil? - invalid_properties.push('invalid value for "actions", actions cannot be nil.') - end - - if @exemption.nil? - invalid_properties.push('invalid value for "exemption", exemption cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @actions.nil? - return false if @exemption.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - actions == o.actions && - exemption == o.exemption - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [actions, exemption].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_exemption.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_exemption.rb deleted file mode 100644 index e516c0e..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/issue_exemption.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Conveying the status of the listed enforcement actions and, if applicable, provides information about the exemption's expiry date. - class IssueExemption - # This field indicates the current exemption status for the listed enforcement actions. It can take values such as `EXEMPT`, signifying permanent exemption, `EXEMPT_UNTIL_EXPIRY_DATE` indicating temporary exemption until a specified date, or `NOT_EXEMPT` signifying no exemptions, and enforcement actions were already applied. - attr_accessor :status - - # This field represents the timestamp, following the ISO 8601 format, which specifies the date when temporary exemptions, if applicable, will expire, and Amazon will begin enforcing the listed actions. - attr_accessor :expiry_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'expiry_date' => :'expiryDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object', - :'expiry_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::IssueExemption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::IssueExemption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'expiry_date') - self.expiry_date = attributes[:'expiry_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - status_validator = EnumAttributeValidator.new('Object', ['EXEMPT', 'EXEMPT_UNTIL_EXPIRY_DATE', 'NOT_EXEMPT']) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('Object', ['EXEMPT', 'EXEMPT_UNTIL_EXPIRY_DATE', 'NOT_EXEMPT']) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - expiry_date == o.expiry_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, expiry_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item.rb deleted file mode 100644 index 2e3627d..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item.rb +++ /dev/null @@ -1,295 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # A listings item. - class Item - # A selling partner provided identifier for an Amazon listing. - attr_accessor :sku - - attr_accessor :summaries - - attr_accessor :attributes - - attr_accessor :issues - - attr_accessor :offers - - # The fulfillment availability for the listings item. - attr_accessor :fulfillment_availability - - # The vendor procurement information for the listings item. - attr_accessor :procurement - - attr_accessor :relationships - - attr_accessor :product_types - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sku' => :'sku', - :'summaries' => :'summaries', - :'attributes' => :'attributes', - :'issues' => :'issues', - :'offers' => :'offers', - :'fulfillment_availability' => :'fulfillmentAvailability', - :'procurement' => :'procurement', - :'relationships' => :'relationships', - :'product_types' => :'productTypes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'sku' => :'Object', - :'summaries' => :'Object', - :'attributes' => :'Object', - :'issues' => :'Object', - :'offers' => :'Object', - :'fulfillment_availability' => :'Object', - :'procurement' => :'Object', - :'relationships' => :'Object', - :'product_types' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sku') - self.sku = attributes[:'sku'] - end - - if attributes.key?(:'summaries') - self.summaries = attributes[:'summaries'] - end - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'issues') - self.issues = attributes[:'issues'] - end - - if attributes.key?(:'offers') - self.offers = attributes[:'offers'] - end - - if attributes.key?(:'fulfillment_availability') - if (value = attributes[:'fulfillment_availability']).is_a?(Array) - self.fulfillment_availability = value - end - end - - if attributes.key?(:'procurement') - if (value = attributes[:'procurement']).is_a?(Array) - self.procurement = value - end - end - - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] - end - - if attributes.key?(:'product_types') - self.product_types = attributes[:'product_types'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sku.nil? - invalid_properties.push('invalid value for "sku", sku cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sku.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sku == o.sku && - summaries == o.summaries && - attributes == o.attributes && - issues == o.issues && - offers == o.offers && - fulfillment_availability == o.fulfillment_availability && - procurement == o.procurement && - relationships == o.relationships && - product_types == o.product_types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sku, summaries, attributes, issues, offers, fulfillment_availability, procurement, relationships, product_types].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_attributes.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_attributes.rb deleted file mode 100644 index bb281cc..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_attributes.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # A JSON object containing structured listings item attribute data keyed by attribute name. - class ItemAttributes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers.rb deleted file mode 100644 index 898c64c..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Identity attributes associated with the item in the Amazon catalog, such as the ASIN. - class ItemIdentifiers - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemIdentifiers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemIdentifiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers_by_marketplace.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers_by_marketplace.rb deleted file mode 100644 index 058ce69..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_identifiers_by_marketplace.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Identity attributes associated with the item in the Amazon catalog for the indicated Amazon marketplace. - class ItemIdentifiersByMarketplace - # A marketplace identifier. Identifies the Amazon marketplace for the listings item. - attr_accessor :marketplace_id - - # Amazon Standard Identification Number (ASIN) of the listings item. - attr_accessor :asin - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'asin' => :'asin' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemIdentifiersByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemIdentifiersByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_image.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_image.rb deleted file mode 100644 index 46a301b..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_image.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The image for the listings item. - class ItemImage - # The link, or URL, to the image. - attr_accessor :link - - # The height of the image in pixels. - attr_accessor :height - - # The width of the image in pixels. - attr_accessor :width - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link' => :'link', - :'height' => :'height', - :'width' => :'width' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'link' => :'Object', - :'height' => :'Object', - :'width' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemImage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemImage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link') - self.link = attributes[:'link'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link.nil? - invalid_properties.push('invalid value for "link", link cannot be nil.') - end - - if @height.nil? - invalid_properties.push('invalid value for "height", height cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link.nil? - return false if @height.nil? - return false if @width.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link == o.link && - height == o.height && - width == o.width - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link, height, width].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_issues.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_issues.rb deleted file mode 100644 index 20a4645..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_issues.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The issues associated with the listings item. - class ItemIssues - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemIssues` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemIssues`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offer_by_marketplace.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offer_by_marketplace.rb deleted file mode 100644 index 94e16da..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offer_by_marketplace.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Offer details of a listings item for an Amazon marketplace. - class ItemOfferByMarketplace - # The Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Type of offer for the listings item. - attr_accessor :offer_type - - attr_accessor :price - - attr_accessor :points - - attr_accessor :audience - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'offer_type' => :'offerType', - :'price' => :'price', - :'points' => :'points', - :'audience' => :'audience' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'offer_type' => :'Object', - :'price' => :'Object', - :'points' => :'Object', - :'audience' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemOfferByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemOfferByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'offer_type') - self.offer_type = attributes[:'offer_type'] - end - - if attributes.key?(:'price') - self.price = attributes[:'price'] - end - - if attributes.key?(:'points') - self.points = attributes[:'points'] - end - - if attributes.key?(:'audience') - self.audience = attributes[:'audience'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @offer_type.nil? - invalid_properties.push('invalid value for "offer_type", offer_type cannot be nil.') - end - - if @price.nil? - invalid_properties.push('invalid value for "price", price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @offer_type.nil? - offer_type_validator = EnumAttributeValidator.new('Object', ['B2C', 'B2B']) - return false unless offer_type_validator.valid?(@offer_type) - return false if @price.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] offer_type Object to be assigned - def offer_type=(offer_type) - validator = EnumAttributeValidator.new('Object', ['B2C', 'B2B']) - unless validator.valid?(offer_type) - fail ArgumentError, "invalid value for \"offer_type\", must be one of #{validator.allowable_values}." - end - @offer_type = offer_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - offer_type == o.offer_type && - price == o.price && - points == o.points && - audience == o.audience - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, offer_type, price, points, audience].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offers.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offers.rb deleted file mode 100644 index 59d1e5d..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_offers.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Offer details for the listings item. - class ItemOffers - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemOffers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemOffers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_procurement.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_procurement.rb deleted file mode 100644 index 6d1d88d..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_procurement.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The vendor procurement information for the listings item. - class ItemProcurement - attr_accessor :cost_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'cost_price' => :'costPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'cost_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemProcurement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemProcurement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'cost_price') - self.cost_price = attributes[:'cost_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @cost_price.nil? - invalid_properties.push('invalid value for "cost_price", cost_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @cost_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cost_price == o.cost_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [cost_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_type_by_marketplace.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_type_by_marketplace.rb deleted file mode 100644 index 302446e..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_type_by_marketplace.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Product types that are associated with the listing item for the specified marketplace. - class ItemProductTypeByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # The name of the product type that is submitted by the Selling Partner. - attr_accessor :product_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'product_type' => :'productType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'product_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemProductTypeByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemProductTypeByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'product_type') - self.product_type = attributes[:'product_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @product_type.nil? - invalid_properties.push('invalid value for "product_type", product_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @product_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - product_type == o.product_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, product_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_types.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_types.rb deleted file mode 100644 index f8fc413..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_product_types.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Product types for a listing item, by marketplace. - class ItemProductTypes - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemProductTypes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemProductTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationship.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationship.rb deleted file mode 100644 index 9dbb424..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationship.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # the relationship details for a listing item. - class ItemRelationship - # Identifiers (SKUs) of the related items that are children of this listing item. - attr_accessor :child_skus - - # Identifiers (SKUs) of the related items that are parents of this listing item. - attr_accessor :parent_skus - - attr_accessor :variation_theme - - # The type of relationship. - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'child_skus' => :'childSkus', - :'parent_skus' => :'parentSkus', - :'variation_theme' => :'variationTheme', - :'type' => :'type' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'child_skus' => :'Object', - :'parent_skus' => :'Object', - :'variation_theme' => :'Object', - :'type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemRelationship` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemRelationship`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'child_skus') - if (value = attributes[:'child_skus']).is_a?(Array) - self.child_skus = value - end - end - - if attributes.key?(:'parent_skus') - if (value = attributes[:'parent_skus']).is_a?(Array) - self.parent_skus = value - end - end - - if attributes.key?(:'variation_theme') - self.variation_theme = attributes[:'variation_theme'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['VARIATION', 'PACKAGE_HIERARCHY']) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['VARIATION', 'PACKAGE_HIERARCHY']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - child_skus == o.child_skus && - parent_skus == o.parent_skus && - variation_theme == o.variation_theme && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [child_skus, parent_skus, variation_theme, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships.rb deleted file mode 100644 index 8c36109..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Relationships for a listing item, by marketplace (for example, variations). - class ItemRelationships - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemRelationships` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships_by_marketplace.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships_by_marketplace.rb deleted file mode 100644 index 772d328..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_relationships_by_marketplace.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Relationship details for the listing item in the specified marketplace. - class ItemRelationshipsByMarketplace - # Amazon marketplace identifier. - attr_accessor :marketplace_id - - # Relationships for the listing item. - attr_accessor :relationships - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'relationships' => :'relationships' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'relationships' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemRelationshipsByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemRelationshipsByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'relationships') - if (value = attributes[:'relationships']).is_a?(Array) - self.relationships = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @relationships.nil? - invalid_properties.push('invalid value for "relationships", relationships cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @relationships.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - relationships == o.relationships - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, relationships].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_search_results.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_search_results.rb deleted file mode 100644 index 7a643f9..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_search_results.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Selling partner listings items and search related metadata. - class ItemSearchResults - # The total number of selling partner listings items found for the search criteria (only results up to the page count limit will be returned per request regardless of the number found). Note: The maximum number of items (SKUs) that can be returned and paged through is 1000. - attr_accessor :number_of_results - - attr_accessor :pagination - - # A list of listings items. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number_of_results' => :'numberOfResults', - :'pagination' => :'pagination', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'number_of_results' => :'Object', - :'pagination' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemSearchResults` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemSearchResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number_of_results') - self.number_of_results = attributes[:'number_of_results'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @number_of_results.nil? - invalid_properties.push('invalid value for "number_of_results", number_of_results cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @number_of_results.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number_of_results == o.number_of_results && - pagination == o.pagination && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number_of_results, pagination, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summaries.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summaries.rb deleted file mode 100644 index dbeb3d8..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summaries.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Summary details of a listings item. - class ItemSummaries - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemSummaries` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemSummaries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summary_by_marketplace.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summary_by_marketplace.rb deleted file mode 100644 index 603b91f..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_summary_by_marketplace.rb +++ /dev/null @@ -1,362 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Summary details of a listings item for an Amazon marketplace. - class ItemSummaryByMarketplace - # A marketplace identifier. Identifies the Amazon marketplace for the listings item. - attr_accessor :marketplace_id - - # Amazon Standard Identification Number (ASIN) of the listings item. - attr_accessor :asin - - # The Amazon product type of the listings item. - attr_accessor :product_type - - # Identifies the condition of the listings item. - attr_accessor :condition_type - - # Statuses that apply to the listings item. - attr_accessor :status - - # The fulfillment network stock keeping unit is an identifier used by Amazon fulfillment centers to identify each unique item. - attr_accessor :fn_sku - - # The name or title associated with an Amazon catalog item. - attr_accessor :item_name - - # The date the listings item was created in ISO 8601 format. - attr_accessor :created_date - - # The date the listings item was last updated in ISO 8601 format. - attr_accessor :last_updated_date - - attr_accessor :main_image - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'asin' => :'asin', - :'product_type' => :'productType', - :'condition_type' => :'conditionType', - :'status' => :'status', - :'fn_sku' => :'fnSku', - :'item_name' => :'itemName', - :'created_date' => :'createdDate', - :'last_updated_date' => :'lastUpdatedDate', - :'main_image' => :'mainImage' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'asin' => :'Object', - :'product_type' => :'Object', - :'condition_type' => :'Object', - :'status' => :'Object', - :'fn_sku' => :'Object', - :'item_name' => :'Object', - :'created_date' => :'Object', - :'last_updated_date' => :'Object', - :'main_image' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemSummaryByMarketplace` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemSummaryByMarketplace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'product_type') - self.product_type = attributes[:'product_type'] - end - - if attributes.key?(:'condition_type') - self.condition_type = attributes[:'condition_type'] - end - - if attributes.key?(:'status') - if (value = attributes[:'status']).is_a?(Array) - self.status = value - end - end - - if attributes.key?(:'fn_sku') - self.fn_sku = attributes[:'fn_sku'] - end - - if attributes.key?(:'item_name') - self.item_name = attributes[:'item_name'] - end - - if attributes.key?(:'created_date') - self.created_date = attributes[:'created_date'] - end - - if attributes.key?(:'last_updated_date') - self.last_updated_date = attributes[:'last_updated_date'] - end - - if attributes.key?(:'main_image') - self.main_image = attributes[:'main_image'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @product_type.nil? - invalid_properties.push('invalid value for "product_type", product_type cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_date.nil? - invalid_properties.push('invalid value for "created_date", created_date cannot be nil.') - end - - if @last_updated_date.nil? - invalid_properties.push('invalid value for "last_updated_date", last_updated_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @product_type.nil? - condition_type_validator = EnumAttributeValidator.new('Object', ['new_new', 'new_open_box', 'new_oem', 'refurbished_refurbished', 'used_like_new', 'used_very_good', 'used_good', 'used_acceptable', 'collectible_like_new', 'collectible_very_good', 'collectible_good', 'collectible_acceptable', 'club_club']) - return false unless condition_type_validator.valid?(@condition_type) - return false if @status.nil? - return false if @created_date.nil? - return false if @last_updated_date.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] condition_type Object to be assigned - def condition_type=(condition_type) - validator = EnumAttributeValidator.new('Object', ['new_new', 'new_open_box', 'new_oem', 'refurbished_refurbished', 'used_like_new', 'used_very_good', 'used_good', 'used_acceptable', 'collectible_like_new', 'collectible_very_good', 'collectible_good', 'collectible_acceptable', 'club_club']) - unless validator.valid?(condition_type) - fail ArgumentError, "invalid value for \"condition_type\", must be one of #{validator.allowable_values}." - end - @condition_type = condition_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - asin == o.asin && - product_type == o.product_type && - condition_type == o.condition_type && - status == o.status && - fn_sku == o.fn_sku && - item_name == o.item_name && - created_date == o.created_date && - last_updated_date == o.last_updated_date && - main_image == o.main_image - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, asin, product_type, condition_type, status, fn_sku, item_name, created_date, last_updated_date, main_image].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_variation_theme.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_variation_theme.rb deleted file mode 100644 index f34bc58..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/item_variation_theme.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # A variation theme that indicates the combination of listing item attributes that define the variation family. - class ItemVariationTheme - # The names of the listing item attributes that are associated with the variation theme. - attr_accessor :attributes - - # The variation theme that indicates the combination of listing item attributes that define the variation family. - attr_accessor :theme - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attributes' => :'attributes', - :'theme' => :'theme' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attributes' => :'Object', - :'theme' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ItemVariationTheme` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ItemVariationTheme`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Array) - self.attributes = value - end - end - - if attributes.key?(:'theme') - self.theme = attributes[:'theme'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @attributes.nil? - invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') - end - - if @theme.nil? - invalid_properties.push('invalid value for "theme", theme cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @attributes.nil? - return false if @theme.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attributes == o.attributes && - theme == o.theme - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attributes, theme].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_patch_request.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_patch_request.rb deleted file mode 100644 index 7bb08b6..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_patch_request.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The request body schema for the `patchListingsItem` operation. - class ListingsItemPatchRequest - # The Amazon product type of the listings item. - attr_accessor :product_type - - # One or more JSON Patch operations to perform on the listings item. - attr_accessor :patches - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_type' => :'productType', - :'patches' => :'patches' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_type' => :'Object', - :'patches' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ListingsItemPatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ListingsItemPatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_type') - self.product_type = attributes[:'product_type'] - end - - if attributes.key?(:'patches') - if (value = attributes[:'patches']).is_a?(Array) - self.patches = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product_type.nil? - invalid_properties.push('invalid value for "product_type", product_type cannot be nil.') - end - - if @patches.nil? - invalid_properties.push('invalid value for "patches", patches cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product_type.nil? - return false if @patches.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_type == o.product_type && - patches == o.patches - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_type, patches].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_put_request.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_put_request.rb deleted file mode 100644 index 196b2f0..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_put_request.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The request body schema for the `putListingsItem` operation. - class ListingsItemPutRequest - # The Amazon product type of the listings item. - attr_accessor :product_type - - # The name of the requirements set for the provided data. - attr_accessor :requirements - - # A JSON object containing structured listings item attribute data keyed by attribute name. - attr_accessor :attributes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_type' => :'productType', - :'requirements' => :'requirements', - :'attributes' => :'attributes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_type' => :'Object', - :'requirements' => :'Object', - :'attributes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ListingsItemPutRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ListingsItemPutRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_type') - self.product_type = attributes[:'product_type'] - end - - if attributes.key?(:'requirements') - self.requirements = attributes[:'requirements'] - end - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Hash) - self.attributes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @product_type.nil? - invalid_properties.push('invalid value for "product_type", product_type cannot be nil.') - end - - if @attributes.nil? - invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @product_type.nil? - requirements_validator = EnumAttributeValidator.new('Object', ['LISTING', 'LISTING_PRODUCT_ONLY', 'LISTING_OFFER_ONLY']) - return false unless requirements_validator.valid?(@requirements) - return false if @attributes.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] requirements Object to be assigned - def requirements=(requirements) - validator = EnumAttributeValidator.new('Object', ['LISTING', 'LISTING_PRODUCT_ONLY', 'LISTING_OFFER_ONLY']) - unless validator.valid?(requirements) - fail ArgumentError, "invalid value for \"requirements\", must be one of #{validator.allowable_values}." - end - @requirements = requirements - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_type == o.product_type && - requirements == o.requirements && - attributes == o.attributes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_type, requirements, attributes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_submission_response.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_submission_response.rb deleted file mode 100644 index ccf87d9..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/listings_item_submission_response.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Response containing the results of a submission to the Selling Partner API for Listings Items. - class ListingsItemSubmissionResponse - # A selling partner provided identifier for an Amazon listing. - attr_accessor :sku - - # The status of the listings item submission. - attr_accessor :status - - # The unique identifier of the listings item submission. - attr_accessor :submission_id - - # Listings item issues related to the listings item submission. - attr_accessor :issues - - attr_accessor :identifiers - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sku' => :'sku', - :'status' => :'status', - :'submission_id' => :'submissionId', - :'issues' => :'issues', - :'identifiers' => :'identifiers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'sku' => :'Object', - :'status' => :'Object', - :'submission_id' => :'Object', - :'issues' => :'Object', - :'identifiers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::ListingsItemSubmissionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::ListingsItemSubmissionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sku') - self.sku = attributes[:'sku'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'submission_id') - self.submission_id = attributes[:'submission_id'] - end - - if attributes.key?(:'issues') - if (value = attributes[:'issues']).is_a?(Array) - self.issues = value - end - end - - if attributes.key?(:'identifiers') - self.identifiers = attributes[:'identifiers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sku.nil? - invalid_properties.push('invalid value for "sku", sku cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @submission_id.nil? - invalid_properties.push('invalid value for "submission_id", submission_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sku.nil? - return false if @status.nil? - status_validator = EnumAttributeValidator.new('Object', ['ACCEPTED', 'INVALID', 'VALID']) - return false unless status_validator.valid?(@status) - return false if @submission_id.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('Object', ['ACCEPTED', 'INVALID', 'VALID']) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sku == o.sku && - status == o.status && - submission_id == o.submission_id && - issues == o.issues && - identifiers == o.identifiers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sku, status, submission_id, issues, identifiers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/money.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/money.rb deleted file mode 100644 index 55bfb89..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/money.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The currency type and amount. - class Money - # Three-digit currency code in ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/pagination.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/pagination.rb deleted file mode 100644 index 4fa040b..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/pagination.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # When a request produces a response that exceeds the `pageSize`, pagination occurs. This means the response is divided into individual pages. To retrieve the next page or the previous page, you must pass the `nextToken` value or the `previousToken` value as the `pageToken` parameter in the next request. When you receive the last page, there will be no `nextToken` key in the pagination object. - class Pagination - # A token that can be used to fetch the next page. - attr_accessor :next_token - - # A token that can be used to fetch the previous page. - attr_accessor :previous_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken', - :'previous_token' => :'previousToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object', - :'previous_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'previous_token') - self.previous_token = attributes[:'previous_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token && - previous_token == o.previous_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token, previous_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/patch_operation.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/patch_operation.rb deleted file mode 100644 index 0bfda1b..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/patch_operation.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # Individual JSON Patch operation for an HTTP PATCH request. - class PatchOperation - # Type of JSON Patch operation. Supported JSON Patch operations include add, replace, and delete. Refer to [JavaScript Object Notation (JSON) Patch](https://tools.ietf.org/html/rfc6902) for more information. - attr_accessor :op - - # JSON Pointer path of the element to patch. Refer to [JavaScript Object Notation (JSON) Patch](https://tools.ietf.org/html/rfc6902) for more information. - attr_accessor :path - - # JSON value to add, replace, or delete. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'op' => :'op', - :'path' => :'path', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'op' => :'Object', - :'path' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::PatchOperation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::PatchOperation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'op') - self.op = attributes[:'op'] - end - - if attributes.key?(:'path') - self.path = attributes[:'path'] - end - - if attributes.key?(:'value') - if (value = attributes[:'value']).is_a?(Array) - self.value = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @op.nil? - invalid_properties.push('invalid value for "op", op cannot be nil.') - end - - if @path.nil? - invalid_properties.push('invalid value for "path", path cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @op.nil? - op_validator = EnumAttributeValidator.new('Object', ['add', 'replace', 'delete']) - return false unless op_validator.valid?(@op) - return false if @path.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] op Object to be assigned - def op=(op) - validator = EnumAttributeValidator.new('Object', ['add', 'replace', 'delete']) - unless validator.valid?(op) - fail ArgumentError, "invalid value for \"op\", must be one of #{validator.allowable_values}." - end - @op = op - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - op == o.op && - path == o.path && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [op, path, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/points.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/models/points.rb deleted file mode 100644 index cc062a9..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/models/points.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpListingsItems2021 - # The number of Amazon Points offered with the purchase of an item, and their monetary value. Note that the `Points` element is only returned in Japan (JP). - class Points - attr_accessor :points_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'points_number' => :'pointsNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'points_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpListingsItems2021::Points` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpListingsItems2021::Points`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'points_number') - self.points_number = attributes[:'points_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @points_number.nil? - invalid_properties.push('invalid value for "points_number", points_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @points_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - points_number == o.points_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [points_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpListingsItems2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/version.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/version.rb deleted file mode 100644 index 412f4e7..0000000 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpListingsItems2021 - VERSION = '1.0.0' -end diff --git a/vendor/listings_items_2021/sp_listings_items_2021.gemspec b/vendor/listings_items_2021/sp_listings_items_2021.gemspec deleted file mode 100644 index c5cd80c..0000000 --- a/vendor/listings_items_2021/sp_listings_items_2021.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Listings Items - -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). - -OpenAPI spec version: 2021-08-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_listings_items_2021/version" - -Gem::Specification.new do |s| - s.name = "sp_listings_items_2021" - s.version = SpListingsItems2021::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Listings Items Ruby Gem" - s.description = "The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide)." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/orders_v0/.gitignore b/vendor/orders_v0/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/orders_v0/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/orders_v0/.rspec b/vendor/orders_v0/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/orders_v0/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/orders_v0/.rubocop.yml b/vendor/orders_v0/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/orders_v0/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/orders_v0/.swagger-codegen-ignore b/vendor/orders_v0/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/orders_v0/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/orders_v0/.swagger-codegen/VERSION b/vendor/orders_v0/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/orders_v0/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/orders_v0/Gemfile b/vendor/orders_v0/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/orders_v0/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/orders_v0/README.md b/vendor/orders_v0/README.md deleted file mode 100644 index d0eca89..0000000 --- a/vendor/orders_v0/README.md +++ /dev/null @@ -1,303 +0,0 @@ -# sp_orders_v0 - -SpOrdersV0 - the Ruby gem for the Selling Partner API for Orders - -Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v0 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_orders_v0.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_orders_v0-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_orders_v0-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_orders_v0', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_orders_v0', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_orders_v0' - -api_instance = SpOrdersV0::OrdersV0Api.new -body = SpOrdersV0::ConfirmShipmentRequest.new # ConfirmShipmentRequest | Request body of `confirmShipment`. -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. - - -begin - api_instance.confirm_shipment(body, order_id) -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->confirm_shipment: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. - - -begin - result = api_instance.get_order(order_id) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. - - -begin - result = api_instance.get_order_address(order_id) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order_address: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. - - -begin - result = api_instance.get_order_buyer_info(order_id) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order_buyer_info: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. -opts = { - next_token: 'next_token_example' # String | A string token returned in the response of your previous request. -} - -begin - result = api_instance.get_order_items(order_id, opts) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order_items: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. -opts = { - next_token: 'next_token_example' # String | A string token returned in the response of your previous request. -} - -begin - result = api_instance.get_order_items_buyer_info(order_id, opts) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order_items_buyer_info: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. - - -begin - result = api_instance.get_order_regulated_info(order_id) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_order_regulated_info: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -marketplace_ids = ['marketplace_ids_example'] # Array | A list of `MarketplaceId` values. Used to select orders that were placed in the specified marketplaces. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. -opts = { - created_after: 'created_after_example', # String | Use this date to select orders created after (or at) a specified time. Only orders placed after the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and `LastUpdatedBefore` cannot be set when `CreatedAfter` is set. - created_before: 'created_before_example', # String | Use this date to select orders created before (or at) a specified time. Only orders placed before the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `CreatedBefore` is optional when `CreatedAfter` is set. If specified, `CreatedBefore` must be equal to or after the `CreatedAfter` date and at least two minutes before current time. - last_updated_after: 'last_updated_after_example', # String | Use this date to select orders that were last updated after (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `CreatedAfter` or `CreatedBefore` cannot be set when `LastUpdatedAfter` is set. - last_updated_before: 'last_updated_before_example', # String | Use this date to select orders that were last updated before (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `LastUpdatedBefore` is optional when `LastUpdatedAfter` is set. But if specified, `LastUpdatedBefore` must be equal to or after the `LastUpdatedAfter` date and at least two minutes before current time. - order_statuses: ['order_statuses_example'], # Array | A list of `OrderStatus` values used to filter the results. **Possible values:** - `PendingAvailability` (This status is available for pre-orders only. The order has been placed, payment has not been authorized, and the release date of the item is in the future.) - `Pending` (The order has been placed but payment has not been authorized.) - `Unshipped` (Payment has been authorized and the order is ready for shipment, but no items in the order have been shipped.) - `PartiallyShipped` (One or more, but not all, items in the order have been shipped.) - `Shipped` (All items in the order have been shipped.) - `InvoiceUnconfirmed` (All items in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been shipped to the buyer.) - `Canceled` (The order has been canceled.) - `Unfulfillable` (The order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) - fulfillment_channels: ['fulfillment_channels_example'], # Array | A list that indicates how an order was fulfilled. Filters the results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller). - payment_methods: ['payment_methods_example'], # Array | A list of payment method values. Use this field to select orders that were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS` (convenience store), `Other` (Any payment method other than COD or CVS). - buyer_email: 'buyer_email_example', # String | The email address of a buyer. Used to select orders that contain the specified email address. - seller_order_id: 'seller_order_id_example', # String | An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified. - max_results_per_page: 56, # Integer | A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. - easy_ship_shipment_statuses: ['easy_ship_shipment_statuses_example'], # Array | A list of `EasyShipShipmentStatus` values. Used to select Easy Ship orders with statuses that match the specified values. If `EasyShipShipmentStatus` is specified, only Amazon Easy Ship orders are returned. **Possible values:** - `PendingSchedule` (The package is awaiting the schedule for pick-up.) - `PendingPickUp` (Amazon has not yet picked up the package from the seller.) - `PendingDropOff` (The seller will deliver the package to the carrier.) - `LabelCanceled` (The seller canceled the pickup.) - `PickedUp` (Amazon has picked up the package from the seller.) - `DroppedOff` (The package is delivered to the carrier by the seller.) - `AtOriginFC` (The packaged is at the origin fulfillment center.) - `AtDestinationFC` (The package is at the destination fulfillment center.) - `Delivered` (The package has been delivered.) - `RejectedByBuyer` (The package has been rejected by the buyer.) - `Undeliverable` (The package cannot be delivered.) - `ReturningToSeller` (The package was not delivered and is being returned to the seller.) - `ReturnedToSeller` (The package was not delivered and was returned to the seller.) - `Lost` (The package is lost.) - `OutForDelivery` (The package is out for delivery.) - `Damaged` (The package was damaged by the carrier.) - electronic_invoice_statuses: ['electronic_invoice_statuses_example'], # Array | A list of `ElectronicInvoiceStatus` values. Used to select orders with electronic invoice statuses that match the specified values. **Possible values:** - `NotRequired` (Electronic invoice submission is not required for this order.) - `NotFound` (The electronic invoice was not submitted for this order.) - `Processing` (The electronic invoice is being processed for this order.) - `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last submitted electronic invoice was submitted and accepted.) - next_token: 'next_token_example', # String | A string token returned in the response of your previous request. - amazon_order_ids: ['amazon_order_ids_example'], # Array | A list of `AmazonOrderId` values. An `AmazonOrderId` is an Amazon-defined order identifier, in 3-7-7 format. - actual_fulfillment_supply_source_id: 'actual_fulfillment_supply_source_id_example', # String | The `sourceId` of the location from where you want the order fulfilled. - is_ispu: true, # BOOLEAN | When true, this order is marked to be picked up from a store rather than delivered. - store_chain_store_id: 'store_chain_store_id_example', # String | The store chain store identifier. Linked to a specific store in a store chain. - earliest_delivery_date_before: 'earliest_delivery_date_before_example', # String | Use this date to select orders with a earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - earliest_delivery_date_after: 'earliest_delivery_date_after_example', # String | Use this date to select orders with a earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - latest_delivery_date_before: 'latest_delivery_date_before_example', # String | Use this date to select orders with a latest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - latest_delivery_date_after: 'latest_delivery_date_after_example' # String | Use this date to select orders with a latest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. -} - -begin - result = api_instance.get_orders(marketplace_ids, opts) - p result -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->get_orders: #{e}" -end - -api_instance = SpOrdersV0::OrdersV0Api.new -body = SpOrdersV0::UpdateVerificationStatusRequest.new # UpdateVerificationStatusRequest | The request body for the `updateVerificationStatus` operation. -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. - - -begin - api_instance.update_verification_status(body, order_id) -rescue SpOrdersV0::ApiError => e - puts "Exception when calling OrdersV0Api->update_verification_status: #{e}" -end - -api_instance = SpOrdersV0::ShipmentApi.new -body = SpOrdersV0::UpdateShipmentStatusRequest.new # UpdateShipmentStatusRequest | The request body for the `updateShipmentStatus` operation. -order_id = 'order_id_example' # String | An Amazon-defined order identifier, in 3-7-7 format. - - -begin - api_instance.update_shipment_status(body, order_id) -rescue SpOrdersV0::ApiError => e - puts "Exception when calling ShipmentApi->update_shipment_status: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpOrdersV0::OrdersV0Api* | [**confirm_shipment**](docs/OrdersV0Api.md#confirm_shipment) | **POST** /orders/v0/orders/{orderId}/shipmentConfirmation | -*SpOrdersV0::OrdersV0Api* | [**get_order**](docs/OrdersV0Api.md#get_order) | **GET** /orders/v0/orders/{orderId} | -*SpOrdersV0::OrdersV0Api* | [**get_order_address**](docs/OrdersV0Api.md#get_order_address) | **GET** /orders/v0/orders/{orderId}/address | -*SpOrdersV0::OrdersV0Api* | [**get_order_buyer_info**](docs/OrdersV0Api.md#get_order_buyer_info) | **GET** /orders/v0/orders/{orderId}/buyerInfo | -*SpOrdersV0::OrdersV0Api* | [**get_order_items**](docs/OrdersV0Api.md#get_order_items) | **GET** /orders/v0/orders/{orderId}/orderItems | -*SpOrdersV0::OrdersV0Api* | [**get_order_items_buyer_info**](docs/OrdersV0Api.md#get_order_items_buyer_info) | **GET** /orders/v0/orders/{orderId}/orderItems/buyerInfo | -*SpOrdersV0::OrdersV0Api* | [**get_order_regulated_info**](docs/OrdersV0Api.md#get_order_regulated_info) | **GET** /orders/v0/orders/{orderId}/regulatedInfo | -*SpOrdersV0::OrdersV0Api* | [**get_orders**](docs/OrdersV0Api.md#get_orders) | **GET** /orders/v0/orders | -*SpOrdersV0::OrdersV0Api* | [**update_verification_status**](docs/OrdersV0Api.md#update_verification_status) | **PATCH** /orders/v0/orders/{orderId}/regulatedInfo | -*SpOrdersV0::ShipmentApi* | [**update_shipment_status**](docs/ShipmentApi.md#update_shipment_status) | **POST** /orders/v0/orders/{orderId}/shipment | - -## Documentation for Models - - - [SpOrdersV0::Address](docs/Address.md) - - [SpOrdersV0::AddressExtendedFields](docs/AddressExtendedFields.md) - - [SpOrdersV0::AmazonPrograms](docs/AmazonPrograms.md) - - [SpOrdersV0::AssociatedItem](docs/AssociatedItem.md) - - [SpOrdersV0::AssociationType](docs/AssociationType.md) - - [SpOrdersV0::AutomatedShippingSettings](docs/AutomatedShippingSettings.md) - - [SpOrdersV0::BusinessHours](docs/BusinessHours.md) - - [SpOrdersV0::BuyerCustomizedInfoDetail](docs/BuyerCustomizedInfoDetail.md) - - [SpOrdersV0::BuyerInfo](docs/BuyerInfo.md) - - [SpOrdersV0::BuyerRequestedCancel](docs/BuyerRequestedCancel.md) - - [SpOrdersV0::BuyerTaxInfo](docs/BuyerTaxInfo.md) - - [SpOrdersV0::BuyerTaxInformation](docs/BuyerTaxInformation.md) - - [SpOrdersV0::ConfirmShipmentErrorResponse](docs/ConfirmShipmentErrorResponse.md) - - [SpOrdersV0::ConfirmShipmentOrderItem](docs/ConfirmShipmentOrderItem.md) - - [SpOrdersV0::ConfirmShipmentOrderItemsList](docs/ConfirmShipmentOrderItemsList.md) - - [SpOrdersV0::ConfirmShipmentRequest](docs/ConfirmShipmentRequest.md) - - [SpOrdersV0::ConstraintType](docs/ConstraintType.md) - - [SpOrdersV0::DeliveryPreferences](docs/DeliveryPreferences.md) - - [SpOrdersV0::EasyShipShipmentStatus](docs/EasyShipShipmentStatus.md) - - [SpOrdersV0::ElectronicInvoiceStatus](docs/ElectronicInvoiceStatus.md) - - [SpOrdersV0::Error](docs/Error.md) - - [SpOrdersV0::ErrorList](docs/ErrorList.md) - - [SpOrdersV0::ExceptionDates](docs/ExceptionDates.md) - - [SpOrdersV0::ExportInfo](docs/ExportInfo.md) - - [SpOrdersV0::FulfillmentInstruction](docs/FulfillmentInstruction.md) - - [SpOrdersV0::GetOrderAddressResponse](docs/GetOrderAddressResponse.md) - - [SpOrdersV0::GetOrderBuyerInfoResponse](docs/GetOrderBuyerInfoResponse.md) - - [SpOrdersV0::GetOrderItemsBuyerInfoResponse](docs/GetOrderItemsBuyerInfoResponse.md) - - [SpOrdersV0::GetOrderItemsResponse](docs/GetOrderItemsResponse.md) - - [SpOrdersV0::GetOrderRegulatedInfoResponse](docs/GetOrderRegulatedInfoResponse.md) - - [SpOrdersV0::GetOrderResponse](docs/GetOrderResponse.md) - - [SpOrdersV0::GetOrdersResponse](docs/GetOrdersResponse.md) - - [SpOrdersV0::ItemBuyerInfo](docs/ItemBuyerInfo.md) - - [SpOrdersV0::MarketplaceId](docs/MarketplaceId.md) - - [SpOrdersV0::MarketplaceTaxInfo](docs/MarketplaceTaxInfo.md) - - [SpOrdersV0::Measurement](docs/Measurement.md) - - [SpOrdersV0::Money](docs/Money.md) - - [SpOrdersV0::OpenInterval](docs/OpenInterval.md) - - [SpOrdersV0::OpenTimeInterval](docs/OpenTimeInterval.md) - - [SpOrdersV0::Order](docs/Order.md) - - [SpOrdersV0::OrderAddress](docs/OrderAddress.md) - - [SpOrdersV0::OrderBuyerInfo](docs/OrderBuyerInfo.md) - - [SpOrdersV0::OrderItem](docs/OrderItem.md) - - [SpOrdersV0::OrderItemBuyerInfo](docs/OrderItemBuyerInfo.md) - - [SpOrdersV0::OrderItemBuyerInfoList](docs/OrderItemBuyerInfoList.md) - - [SpOrdersV0::OrderItemList](docs/OrderItemList.md) - - [SpOrdersV0::OrderItems](docs/OrderItems.md) - - [SpOrdersV0::OrderItemsBuyerInfoList](docs/OrderItemsBuyerInfoList.md) - - [SpOrdersV0::OrderItemsInner](docs/OrderItemsInner.md) - - [SpOrdersV0::OrderItemsList](docs/OrderItemsList.md) - - [SpOrdersV0::OrderList](docs/OrderList.md) - - [SpOrdersV0::OrderRegulatedInfo](docs/OrderRegulatedInfo.md) - - [SpOrdersV0::OrdersList](docs/OrdersList.md) - - [SpOrdersV0::OtherDeliveryAttributes](docs/OtherDeliveryAttributes.md) - - [SpOrdersV0::PackageDetail](docs/PackageDetail.md) - - [SpOrdersV0::PackageReferenceId](docs/PackageReferenceId.md) - - [SpOrdersV0::PaymentExecutionDetailItem](docs/PaymentExecutionDetailItem.md) - - [SpOrdersV0::PaymentExecutionDetailItemList](docs/PaymentExecutionDetailItemList.md) - - [SpOrdersV0::PaymentMethodDetailItemList](docs/PaymentMethodDetailItemList.md) - - [SpOrdersV0::PointsGrantedDetail](docs/PointsGrantedDetail.md) - - [SpOrdersV0::PreferredDeliveryTime](docs/PreferredDeliveryTime.md) - - [SpOrdersV0::PrescriptionDetail](docs/PrescriptionDetail.md) - - [SpOrdersV0::ProductInfoDetail](docs/ProductInfoDetail.md) - - [SpOrdersV0::PromotionIdList](docs/PromotionIdList.md) - - [SpOrdersV0::RegulatedInformation](docs/RegulatedInformation.md) - - [SpOrdersV0::RegulatedInformationField](docs/RegulatedInformationField.md) - - [SpOrdersV0::RegulatedOrderVerificationStatus](docs/RegulatedOrderVerificationStatus.md) - - [SpOrdersV0::RejectionReason](docs/RejectionReason.md) - - [SpOrdersV0::ShipmentStatus](docs/ShipmentStatus.md) - - [SpOrdersV0::ShippingConstraints](docs/ShippingConstraints.md) - - [SpOrdersV0::SubstitutionOption](docs/SubstitutionOption.md) - - [SpOrdersV0::SubstitutionOptionList](docs/SubstitutionOptionList.md) - - [SpOrdersV0::SubstitutionPreferences](docs/SubstitutionPreferences.md) - - [SpOrdersV0::TaxClassification](docs/TaxClassification.md) - - [SpOrdersV0::TaxCollection](docs/TaxCollection.md) - - [SpOrdersV0::TransparencyCode](docs/TransparencyCode.md) - - [SpOrdersV0::TransparencyCodeList](docs/TransparencyCodeList.md) - - [SpOrdersV0::UpdateShipmentStatusErrorResponse](docs/UpdateShipmentStatusErrorResponse.md) - - [SpOrdersV0::UpdateShipmentStatusRequest](docs/UpdateShipmentStatusRequest.md) - - [SpOrdersV0::UpdateVerificationStatusErrorResponse](docs/UpdateVerificationStatusErrorResponse.md) - - [SpOrdersV0::UpdateVerificationStatusRequest](docs/UpdateVerificationStatusRequest.md) - - [SpOrdersV0::UpdateVerificationStatusRequestBody](docs/UpdateVerificationStatusRequestBody.md) - - [SpOrdersV0::ValidVerificationDetail](docs/ValidVerificationDetail.md) - - [SpOrdersV0::VerificationDetails](docs/VerificationDetails.md) - - [SpOrdersV0::VerificationStatus](docs/VerificationStatus.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/orders_v0/Rakefile b/vendor/orders_v0/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/orders_v0/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/orders_v0/git_push.sh b/vendor/orders_v0/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/orders_v0/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/orders_v0/lib/sp_orders_v0/api_client.rb b/vendor/orders_v0/lib/sp_orders_v0/api_client.rb deleted file mode 100644 index 6387b85..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpOrdersV0 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpOrdersV0.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/api_error.rb b/vendor/orders_v0/lib/sp_orders_v0/api_error.rb deleted file mode 100644 index 1b2ca36..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpOrdersV0 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/configuration.rb b/vendor/orders_v0/lib/sp_orders_v0/configuration.rb deleted file mode 100644 index 2658ca7..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpOrdersV0 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/address.rb b/vendor/orders_v0/lib/sp_orders_v0/models/address.rb deleted file mode 100644 index 63b1cfb..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/address.rb +++ /dev/null @@ -1,390 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The shipping address for the order. - class Address - # The name. - attr_accessor :name - - # The company name of the recipient. **Note**: This attribute is only available for shipping address. - attr_accessor :company_name - - # The street address. - attr_accessor :address_line1 - - # Additional street address information, if required. - attr_accessor :address_line2 - - # Additional street address information, if required. - attr_accessor :address_line3 - - # The city. - attr_accessor :city - - # The county. - attr_accessor :county - - # The district. - attr_accessor :district - - # The state or region. - attr_accessor :state_or_region - - # The municipality. - attr_accessor :municipality - - # The postal code. - attr_accessor :postal_code - - # The country code. A two-character country code, in ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the buyer. **Note**: 1. This attribute is only available for shipping address. 2. In some cases, the buyer phone number is suppressed: a. Phone is suppressed for all `AFN` (fulfilled by Amazon) orders. b. Phone is suppressed for the shipped `MFN` (fulfilled by seller) order when the current date is past the Latest Delivery Date. - attr_accessor :phone - - attr_accessor :extended_fields - - # The address type of the shipping address. - attr_accessor :address_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'company_name' => :'CompanyName', - :'address_line1' => :'AddressLine1', - :'address_line2' => :'AddressLine2', - :'address_line3' => :'AddressLine3', - :'city' => :'City', - :'county' => :'County', - :'district' => :'District', - :'state_or_region' => :'StateOrRegion', - :'municipality' => :'Municipality', - :'postal_code' => :'PostalCode', - :'country_code' => :'CountryCode', - :'phone' => :'Phone', - :'extended_fields' => :'ExtendedFields', - :'address_type' => :'AddressType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'company_name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'municipality' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object', - :'extended_fields' => :'Object', - :'address_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'municipality') - self.municipality = attributes[:'municipality'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'extended_fields') - self.extended_fields = attributes[:'extended_fields'] - end - - if attributes.key?(:'address_type') - self.address_type = attributes[:'address_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - address_type_validator = EnumAttributeValidator.new('Object', ['Residential', 'Commercial']) - return false unless address_type_validator.valid?(@address_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] address_type Object to be assigned - def address_type=(address_type) - validator = EnumAttributeValidator.new('Object', ['Residential', 'Commercial']) - unless validator.valid?(address_type) - fail ArgumentError, "invalid value for \"address_type\", must be one of #{validator.allowable_values}." - end - @address_type = address_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - company_name == o.company_name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - municipality == o.municipality && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone && - extended_fields == o.extended_fields && - address_type == o.address_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, company_name, address_line1, address_line2, address_line3, city, county, district, state_or_region, municipality, postal_code, country_code, phone, extended_fields, address_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/address_extended_fields.rb b/vendor/orders_v0/lib/sp_orders_v0/models/address_extended_fields.rb deleted file mode 100644 index aa113c5..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/address_extended_fields.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The container for address extended fields (such as `street name` and `street number`). Currently only available with Brazil shipping addresses. - class AddressExtendedFields - # The street name. - attr_accessor :street_name - - # The house, building, or property number associated with the location's street address. - attr_accessor :street_number - - # The floor number/unit number in the building/private house number. - attr_accessor :complement - - # The neighborhood. This value is only used in some countries (such as Brazil). - attr_accessor :neighborhood - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street_name' => :'StreetName', - :'street_number' => :'StreetNumber', - :'complement' => :'Complement', - :'neighborhood' => :'Neighborhood' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'street_name' => :'Object', - :'street_number' => :'Object', - :'complement' => :'Object', - :'neighborhood' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::AddressExtendedFields` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::AddressExtendedFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street_name') - self.street_name = attributes[:'street_name'] - end - - if attributes.key?(:'street_number') - self.street_number = attributes[:'street_number'] - end - - if attributes.key?(:'complement') - self.complement = attributes[:'complement'] - end - - if attributes.key?(:'neighborhood') - self.neighborhood = attributes[:'neighborhood'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street_name == o.street_name && - street_number == o.street_number && - complement == o.complement && - neighborhood == o.neighborhood - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street_name, street_number, complement, neighborhood].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/amazon_programs.rb b/vendor/orders_v0/lib/sp_orders_v0/models/amazon_programs.rb deleted file mode 100644 index ba6769f..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/amazon_programs.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains the list of programs that are associated with an item. Possible programs are: - **Subscribe and Save**: Offers recurring, scheduled deliveries to Amazon customers and Amazon Business customers for their frequently ordered products. - class AmazonPrograms - # A list of the programs that are associated with the specified order item. **Possible values**: `SUBSCRIBE_AND_SAVE` - attr_accessor :programs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'programs' => :'Programs' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'programs' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::AmazonPrograms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::AmazonPrograms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'programs') - if (value = attributes[:'programs']).is_a?(Array) - self.programs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @programs.nil? - invalid_properties.push('invalid value for "programs", programs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @programs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - programs == o.programs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [programs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/associated_item.rb b/vendor/orders_v0/lib/sp_orders_v0/models/associated_item.rb deleted file mode 100644 index 83301ec..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/associated_item.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # An item that is associated with an order item. For example, a tire installation service that is purchased with tires. - class AssociatedItem - # The order item's order identifier, in 3-7-7 format. - attr_accessor :order_id - - # An Amazon-defined item identifier for the associated item. - attr_accessor :order_item_id - - attr_accessor :association_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_id' => :'OrderId', - :'order_item_id' => :'OrderItemId', - :'association_type' => :'AssociationType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_id' => :'Object', - :'order_item_id' => :'Object', - :'association_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::AssociatedItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::AssociatedItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_id') - self.order_id = attributes[:'order_id'] - end - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'association_type') - self.association_type = attributes[:'association_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_id == o.order_id && - order_item_id == o.order_item_id && - association_type == o.association_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_id, order_item_id, association_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/association_type.rb b/vendor/orders_v0/lib/sp_orders_v0/models/association_type.rb deleted file mode 100644 index 6bab1d6..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/association_type.rb +++ /dev/null @@ -1,29 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class AssociationType - VALUE_ADD_SERVICE = 'VALUE_ADD_SERVICE'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AssociationType.constants.select { |c| AssociationType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AssociationType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/automated_shipping_settings.rb b/vendor/orders_v0/lib/sp_orders_v0/models/automated_shipping_settings.rb deleted file mode 100644 index dcaf7d5..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/automated_shipping_settings.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains information regarding the Shipping Settings Automation program, such as whether the order's shipping settings were generated automatically, and what those settings are. - class AutomatedShippingSettings - # When true, this order has automated shipping settings generated by Amazon. This order could be identified as an SSA order. - attr_accessor :has_automated_shipping_settings - - # Auto-generated carrier for SSA orders. - attr_accessor :automated_carrier - - # Auto-generated ship method for SSA orders. - attr_accessor :automated_ship_method - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'has_automated_shipping_settings' => :'HasAutomatedShippingSettings', - :'automated_carrier' => :'AutomatedCarrier', - :'automated_ship_method' => :'AutomatedShipMethod' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'has_automated_shipping_settings' => :'Object', - :'automated_carrier' => :'Object', - :'automated_ship_method' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::AutomatedShippingSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::AutomatedShippingSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'has_automated_shipping_settings') - self.has_automated_shipping_settings = attributes[:'has_automated_shipping_settings'] - end - - if attributes.key?(:'automated_carrier') - self.automated_carrier = attributes[:'automated_carrier'] - end - - if attributes.key?(:'automated_ship_method') - self.automated_ship_method = attributes[:'automated_ship_method'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - has_automated_shipping_settings == o.has_automated_shipping_settings && - automated_carrier == o.automated_carrier && - automated_ship_method == o.automated_ship_method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [has_automated_shipping_settings, automated_carrier, automated_ship_method].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/business_hours.rb b/vendor/orders_v0/lib/sp_orders_v0/models/business_hours.rb deleted file mode 100644 index 5d1ed4e..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/business_hours.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Business days and hours when the destination is open for deliveries. - class BusinessHours - # Day of the week. - attr_accessor :day_of_week - - # Time window during the day when the business is open. - attr_accessor :open_intervals - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'day_of_week' => :'DayOfWeek', - :'open_intervals' => :'OpenIntervals' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'day_of_week' => :'Object', - :'open_intervals' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BusinessHours` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BusinessHours`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'day_of_week') - self.day_of_week = attributes[:'day_of_week'] - end - - if attributes.key?(:'open_intervals') - if (value = attributes[:'open_intervals']).is_a?(Array) - self.open_intervals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - day_of_week_validator = EnumAttributeValidator.new('Object', ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']) - return false unless day_of_week_validator.valid?(@day_of_week) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] day_of_week Object to be assigned - def day_of_week=(day_of_week) - validator = EnumAttributeValidator.new('Object', ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']) - unless validator.valid?(day_of_week) - fail ArgumentError, "invalid value for \"day_of_week\", must be one of #{validator.allowable_values}." - end - @day_of_week = day_of_week - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - day_of_week == o.day_of_week && - open_intervals == o.open_intervals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [day_of_week, open_intervals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_customized_info_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/buyer_customized_info_detail.rb deleted file mode 100644 index 0196d17..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_customized_info_detail.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Buyer information for custom orders from the Amazon Custom program. - class BuyerCustomizedInfoDetail - # The location of a ZIP file containing Amazon Custom data. - attr_accessor :customized_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'customized_url' => :'CustomizedURL' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'customized_url' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BuyerCustomizedInfoDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BuyerCustomizedInfoDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'customized_url') - self.customized_url = attributes[:'customized_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - customized_url == o.customized_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [customized_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/buyer_info.rb deleted file mode 100644 index cbfbe47..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_info.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Buyer information. - class BuyerInfo - # The anonymized email address of the buyer. - attr_accessor :buyer_email - - # The buyer name or the recipient name. - attr_accessor :buyer_name - - # The county of the buyer. **Note**: This attribute is only available in the Brazil marketplace. - attr_accessor :buyer_county - - attr_accessor :buyer_tax_info - - # The purchase order (PO) number entered by the buyer at checkout. Only returned for orders where the buyer entered a PO number at checkout. - attr_accessor :purchase_order_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer_email' => :'BuyerEmail', - :'buyer_name' => :'BuyerName', - :'buyer_county' => :'BuyerCounty', - :'buyer_tax_info' => :'BuyerTaxInfo', - :'purchase_order_number' => :'PurchaseOrderNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer_email' => :'Object', - :'buyer_name' => :'Object', - :'buyer_county' => :'Object', - :'buyer_tax_info' => :'Object', - :'purchase_order_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BuyerInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BuyerInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer_email') - self.buyer_email = attributes[:'buyer_email'] - end - - if attributes.key?(:'buyer_name') - self.buyer_name = attributes[:'buyer_name'] - end - - if attributes.key?(:'buyer_county') - self.buyer_county = attributes[:'buyer_county'] - end - - if attributes.key?(:'buyer_tax_info') - self.buyer_tax_info = attributes[:'buyer_tax_info'] - end - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer_email == o.buyer_email && - buyer_name == o.buyer_name && - buyer_county == o.buyer_county && - buyer_tax_info == o.buyer_tax_info && - purchase_order_number == o.purchase_order_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer_email, buyer_name, buyer_county, buyer_tax_info, purchase_order_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_requested_cancel.rb b/vendor/orders_v0/lib/sp_orders_v0/models/buyer_requested_cancel.rb deleted file mode 100644 index 2ff95c7..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_requested_cancel.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Information about whether or not a buyer requested cancellation. - class BuyerRequestedCancel - # Indicate whether the buyer has requested cancellation. **Possible Values**: `true`, `false`. - attr_accessor :is_buyer_requested_cancel - - # The reason that the buyer requested cancellation. - attr_accessor :buyer_cancel_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_buyer_requested_cancel' => :'IsBuyerRequestedCancel', - :'buyer_cancel_reason' => :'BuyerCancelReason' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_buyer_requested_cancel' => :'Object', - :'buyer_cancel_reason' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BuyerRequestedCancel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BuyerRequestedCancel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_buyer_requested_cancel') - self.is_buyer_requested_cancel = attributes[:'is_buyer_requested_cancel'] - end - - if attributes.key?(:'buyer_cancel_reason') - self.buyer_cancel_reason = attributes[:'buyer_cancel_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_buyer_requested_cancel == o.is_buyer_requested_cancel && - buyer_cancel_reason == o.buyer_cancel_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_buyer_requested_cancel, buyer_cancel_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_info.rb deleted file mode 100644 index ac3df6e..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_info.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Tax information about the buyer. - class BuyerTaxInfo - # The legal name of the company. - attr_accessor :company_legal_name - - # The country or region imposing the tax. - attr_accessor :taxing_region - - # A list of tax classifications that apply to the order. - attr_accessor :tax_classifications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'company_legal_name' => :'CompanyLegalName', - :'taxing_region' => :'TaxingRegion', - :'tax_classifications' => :'TaxClassifications' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'company_legal_name' => :'Object', - :'taxing_region' => :'Object', - :'tax_classifications' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BuyerTaxInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BuyerTaxInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'company_legal_name') - self.company_legal_name = attributes[:'company_legal_name'] - end - - if attributes.key?(:'taxing_region') - self.taxing_region = attributes[:'taxing_region'] - end - - if attributes.key?(:'tax_classifications') - if (value = attributes[:'tax_classifications']).is_a?(Array) - self.tax_classifications = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - company_legal_name == o.company_legal_name && - taxing_region == o.taxing_region && - tax_classifications == o.tax_classifications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [company_legal_name, taxing_region, tax_classifications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_information.rb b/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_information.rb deleted file mode 100644 index d8e72a2..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/buyer_tax_information.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains the business invoice tax information. Available only in the TR marketplace. - class BuyerTaxInformation - # Business buyer's company legal name. - attr_accessor :buyer_legal_company_name - - # Business buyer's address. - attr_accessor :buyer_business_address - - # Business buyer's tax registration ID. - attr_accessor :buyer_tax_registration_id - - # Business buyer's tax office. - attr_accessor :buyer_tax_office - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer_legal_company_name' => :'BuyerLegalCompanyName', - :'buyer_business_address' => :'BuyerBusinessAddress', - :'buyer_tax_registration_id' => :'BuyerTaxRegistrationId', - :'buyer_tax_office' => :'BuyerTaxOffice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer_legal_company_name' => :'Object', - :'buyer_business_address' => :'Object', - :'buyer_tax_registration_id' => :'Object', - :'buyer_tax_office' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::BuyerTaxInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::BuyerTaxInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer_legal_company_name') - self.buyer_legal_company_name = attributes[:'buyer_legal_company_name'] - end - - if attributes.key?(:'buyer_business_address') - self.buyer_business_address = attributes[:'buyer_business_address'] - end - - if attributes.key?(:'buyer_tax_registration_id') - self.buyer_tax_registration_id = attributes[:'buyer_tax_registration_id'] - end - - if attributes.key?(:'buyer_tax_office') - self.buyer_tax_office = attributes[:'buyer_tax_office'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer_legal_company_name == o.buyer_legal_company_name && - buyer_business_address == o.buyer_business_address && - buyer_tax_registration_id == o.buyer_tax_registration_id && - buyer_tax_office == o.buyer_tax_office - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer_legal_company_name, buyer_business_address, buyer_tax_registration_id, buyer_tax_office].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_error_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_error_response.rb deleted file mode 100644 index 46c8ead..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_error_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The error response schema for the `confirmShipment` operation. - class ConfirmShipmentErrorResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ConfirmShipmentErrorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ConfirmShipmentErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_item.rb b/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_item.rb deleted file mode 100644 index 941ff35..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_item.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single order item. - class ConfirmShipmentOrderItem - # The order item's unique identifier. - attr_accessor :order_item_id - - # The item's quantity. - attr_accessor :quantity - - attr_accessor :transparency_codes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_item_id' => :'orderItemId', - :'quantity' => :'quantity', - :'transparency_codes' => :'transparencyCodes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_item_id' => :'Object', - :'quantity' => :'Object', - :'transparency_codes' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ConfirmShipmentOrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ConfirmShipmentOrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'transparency_codes') - self.transparency_codes = attributes[:'transparency_codes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @order_item_id.nil? - invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @order_item_id.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_item_id == o.order_item_id && - quantity == o.quantity && - transparency_codes == o.transparency_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_item_id, quantity, transparency_codes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_items_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_items_list.rb deleted file mode 100644 index 88b2598..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_order_items_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of order items. - class ConfirmShipmentOrderItemsList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ConfirmShipmentOrderItemsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ConfirmShipmentOrderItemsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_request.rb b/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_request.rb deleted file mode 100644 index 6805ec0..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/confirm_shipment_request.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The request schema for an shipment confirmation. - class ConfirmShipmentRequest - attr_accessor :package_detail - - # The COD collection method (only supported in the JP marketplace). - attr_accessor :cod_collection_method - - attr_accessor :marketplace_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'package_detail' => :'packageDetail', - :'cod_collection_method' => :'codCollectionMethod', - :'marketplace_id' => :'marketplaceId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'package_detail' => :'Object', - :'cod_collection_method' => :'Object', - :'marketplace_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ConfirmShipmentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ConfirmShipmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'package_detail') - self.package_detail = attributes[:'package_detail'] - end - - if attributes.key?(:'cod_collection_method') - self.cod_collection_method = attributes[:'cod_collection_method'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @package_detail.nil? - invalid_properties.push('invalid value for "package_detail", package_detail cannot be nil.') - end - - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @package_detail.nil? - cod_collection_method_validator = EnumAttributeValidator.new('Object', ['DirectPayment']) - return false unless cod_collection_method_validator.valid?(@cod_collection_method) - return false if @marketplace_id.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] cod_collection_method Object to be assigned - def cod_collection_method=(cod_collection_method) - validator = EnumAttributeValidator.new('Object', ['DirectPayment']) - unless validator.valid?(cod_collection_method) - fail ArgumentError, "invalid value for \"cod_collection_method\", must be one of #{validator.allowable_values}." - end - @cod_collection_method = cod_collection_method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - package_detail == o.package_detail && - cod_collection_method == o.cod_collection_method && - marketplace_id == o.marketplace_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [package_detail, cod_collection_method, marketplace_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/constraint_type.rb b/vendor/orders_v0/lib/sp_orders_v0/models/constraint_type.rb deleted file mode 100644 index d6214e6..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/constraint_type.rb +++ /dev/null @@ -1,29 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class ConstraintType - MANDATORY = 'MANDATORY'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ConstraintType.constants.select { |c| ConstraintType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ConstraintType" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/delivery_preferences.rb b/vendor/orders_v0/lib/sp_orders_v0/models/delivery_preferences.rb deleted file mode 100644 index adbfd35..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/delivery_preferences.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains all of the delivery instructions provided by the customer for the shipping address. - class DeliveryPreferences - # Drop-off location selected by the customer. - attr_accessor :drop_off_location - - attr_accessor :preferred_delivery_time - - # Enumerated list of miscellaneous delivery attributes associated with the shipping address. - attr_accessor :other_attributes - - # Building instructions, nearby landmark or navigation instructions. - attr_accessor :address_instructions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'drop_off_location' => :'DropOffLocation', - :'preferred_delivery_time' => :'PreferredDeliveryTime', - :'other_attributes' => :'OtherAttributes', - :'address_instructions' => :'AddressInstructions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'drop_off_location' => :'Object', - :'preferred_delivery_time' => :'Object', - :'other_attributes' => :'Object', - :'address_instructions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::DeliveryPreferences` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::DeliveryPreferences`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'drop_off_location') - self.drop_off_location = attributes[:'drop_off_location'] - end - - if attributes.key?(:'preferred_delivery_time') - self.preferred_delivery_time = attributes[:'preferred_delivery_time'] - end - - if attributes.key?(:'other_attributes') - if (value = attributes[:'other_attributes']).is_a?(Array) - self.other_attributes = value - end - end - - if attributes.key?(:'address_instructions') - self.address_instructions = attributes[:'address_instructions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - drop_off_location == o.drop_off_location && - preferred_delivery_time == o.preferred_delivery_time && - other_attributes == o.other_attributes && - address_instructions == o.address_instructions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [drop_off_location, preferred_delivery_time, other_attributes, address_instructions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/easy_ship_shipment_status.rb b/vendor/orders_v0/lib/sp_orders_v0/models/easy_ship_shipment_status.rb deleted file mode 100644 index 09101ec..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/easy_ship_shipment_status.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class EasyShipShipmentStatus - PENDING_SCHEDULE = 'PendingSchedule'.freeze - PENDING_PICK_UP = 'PendingPickUp'.freeze - PENDING_DROP_OFF = 'PendingDropOff'.freeze - LABEL_CANCELED = 'LabelCanceled'.freeze - PICKED_UP = 'PickedUp'.freeze - DROPPED_OFF = 'DroppedOff'.freeze - AT_ORIGIN_FC = 'AtOriginFC'.freeze - AT_DESTINATION_FC = 'AtDestinationFC'.freeze - DELIVERED = 'Delivered'.freeze - REJECTED_BY_BUYER = 'RejectedByBuyer'.freeze - UNDELIVERABLE = 'Undeliverable'.freeze - RETURNING_TO_SELLER = 'ReturningToSeller'.freeze - RETURNED_TO_SELLER = 'ReturnedToSeller'.freeze - LOST = 'Lost'.freeze - OUT_FOR_DELIVERY = 'OutForDelivery'.freeze - DAMAGED = 'Damaged'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = EasyShipShipmentStatus.constants.select { |c| EasyShipShipmentStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #EasyShipShipmentStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/electronic_invoice_status.rb b/vendor/orders_v0/lib/sp_orders_v0/models/electronic_invoice_status.rb deleted file mode 100644 index abdd0e9..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/electronic_invoice_status.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class ElectronicInvoiceStatus - NOT_REQUIRED = 'NotRequired'.freeze - NOT_FOUND = 'NotFound'.freeze - PROCESSING = 'Processing'.freeze - ERRORED = 'Errored'.freeze - ACCEPTED = 'Accepted'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ElectronicInvoiceStatus.constants.select { |c| ElectronicInvoiceStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ElectronicInvoiceStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/error.rb b/vendor/orders_v0/lib/sp_orders_v0/models/error.rb deleted file mode 100644 index ac1c63f..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/error_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/error_list.rb deleted file mode 100644 index addba0e..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/exception_dates.rb b/vendor/orders_v0/lib/sp_orders_v0/models/exception_dates.rb deleted file mode 100644 index 5bd7041..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/exception_dates.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Dates when the business is closed or open with a different time window. - class ExceptionDates - # Date when the business is closed, in ISO 8601 date format. - attr_accessor :exception_date - - # Boolean indicating if the business is closed or open on that date. - attr_accessor :is_open - - # Time window during the day when the business is open. - attr_accessor :open_intervals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'exception_date' => :'ExceptionDate', - :'is_open' => :'IsOpen', - :'open_intervals' => :'OpenIntervals' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'exception_date' => :'Object', - :'is_open' => :'Object', - :'open_intervals' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ExceptionDates` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ExceptionDates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'exception_date') - self.exception_date = attributes[:'exception_date'] - end - - if attributes.key?(:'is_open') - self.is_open = attributes[:'is_open'] - end - - if attributes.key?(:'open_intervals') - if (value = attributes[:'open_intervals']).is_a?(Array) - self.open_intervals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - exception_date == o.exception_date && - is_open == o.is_open && - open_intervals == o.open_intervals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [exception_date, is_open, open_intervals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/export_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/export_info.rb deleted file mode 100644 index 8f18556..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/export_info.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains information that is related to the export of an order item. - class ExportInfo - attr_accessor :export_charge - - # Holds the `ExportCharge` collection model that is associated with the specified order item.\\n\\n**Possible values**: `AMAZON_FACILITATED`: Import/export charge is withheld by Amazon and remitted to the customs authority by the carrier on behalf of the buyer/seller. - attr_accessor :export_charge_model - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'export_charge' => :'ExportCharge', - :'export_charge_model' => :'ExportChargeModel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'export_charge' => :'Object', - :'export_charge_model' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ExportInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ExportInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'export_charge') - self.export_charge = attributes[:'export_charge'] - end - - if attributes.key?(:'export_charge_model') - self.export_charge_model = attributes[:'export_charge_model'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - export_charge == o.export_charge && - export_charge_model == o.export_charge_model - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [export_charge, export_charge_model].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/fulfillment_instruction.rb b/vendor/orders_v0/lib/sp_orders_v0/models/fulfillment_instruction.rb deleted file mode 100644 index 7c59ca3..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/fulfillment_instruction.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Contains the instructions about the fulfillment, such as the location from where you want the order filled. - class FulfillmentInstruction - # The `sourceId` of the location from where you want the order fulfilled. - attr_accessor :fulfillment_supply_source_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fulfillment_supply_source_id' => :'FulfillmentSupplySourceId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fulfillment_supply_source_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::FulfillmentInstruction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::FulfillmentInstruction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fulfillment_supply_source_id') - self.fulfillment_supply_source_id = attributes[:'fulfillment_supply_source_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fulfillment_supply_source_id == o.fulfillment_supply_source_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fulfillment_supply_source_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_address_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_address_response.rb deleted file mode 100644 index e525f14..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_address_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrderAddress` operation. - class GetOrderAddressResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderAddressResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderAddressResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_buyer_info_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_buyer_info_response.rb deleted file mode 100644 index f5cd34c..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_buyer_info_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrderBuyerInfo` operation. - class GetOrderBuyerInfoResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderBuyerInfoResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderBuyerInfoResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_buyer_info_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_buyer_info_response.rb deleted file mode 100644 index 914309b..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_buyer_info_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrderItemsBuyerInfo` operation. - class GetOrderItemsBuyerInfoResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderItemsBuyerInfoResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderItemsBuyerInfoResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_response.rb deleted file mode 100644 index 8e23e88..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_items_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrderItems` operation. - class GetOrderItemsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderItemsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderItemsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_regulated_info_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_regulated_info_response.rb deleted file mode 100644 index 4f62725..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_regulated_info_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrderRegulatedInfo` operation. - class GetOrderRegulatedInfoResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderRegulatedInfoResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderRegulatedInfoResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_order_response.rb deleted file mode 100644 index 90f69bc..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_order_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrder` operation. - class GetOrderResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/get_orders_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/get_orders_response.rb deleted file mode 100644 index f759b8a..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/get_orders_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The response schema for the `getOrders` operation. - class GetOrdersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::GetOrdersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::GetOrdersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/item_buyer_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/item_buyer_info.rb deleted file mode 100644 index 0eb6342..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/item_buyer_info.rb +++ /dev/null @@ -1,249 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single item's buyer information. - class ItemBuyerInfo - attr_accessor :buyer_customized_info - - attr_accessor :gift_wrap_price - - attr_accessor :gift_wrap_tax - - # A gift message provided by the buyer. **Note**: This attribute is only available for MFN (fulfilled by seller) orders. - attr_accessor :gift_message_text - - # The gift wrap level specified by the buyer. - attr_accessor :gift_wrap_level - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer_customized_info' => :'BuyerCustomizedInfo', - :'gift_wrap_price' => :'GiftWrapPrice', - :'gift_wrap_tax' => :'GiftWrapTax', - :'gift_message_text' => :'GiftMessageText', - :'gift_wrap_level' => :'GiftWrapLevel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer_customized_info' => :'Object', - :'gift_wrap_price' => :'Object', - :'gift_wrap_tax' => :'Object', - :'gift_message_text' => :'Object', - :'gift_wrap_level' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ItemBuyerInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ItemBuyerInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer_customized_info') - self.buyer_customized_info = attributes[:'buyer_customized_info'] - end - - if attributes.key?(:'gift_wrap_price') - self.gift_wrap_price = attributes[:'gift_wrap_price'] - end - - if attributes.key?(:'gift_wrap_tax') - self.gift_wrap_tax = attributes[:'gift_wrap_tax'] - end - - if attributes.key?(:'gift_message_text') - self.gift_message_text = attributes[:'gift_message_text'] - end - - if attributes.key?(:'gift_wrap_level') - self.gift_wrap_level = attributes[:'gift_wrap_level'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer_customized_info == o.buyer_customized_info && - gift_wrap_price == o.gift_wrap_price && - gift_wrap_tax == o.gift_wrap_tax && - gift_message_text == o.gift_message_text && - gift_wrap_level == o.gift_wrap_level - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer_customized_info, gift_wrap_price, gift_wrap_tax, gift_message_text, gift_wrap_level].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_id.rb b/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_id.rb deleted file mode 100644 index 5d9927c..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The unobfuscated marketplace identifier. - class MarketplaceId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::MarketplaceId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::MarketplaceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_tax_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_tax_info.rb deleted file mode 100644 index df7ae73..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/marketplace_tax_info.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Tax information about the marketplace. - class MarketplaceTaxInfo - # A list of tax classifications that apply to the order. - attr_accessor :tax_classifications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_classifications' => :'TaxClassifications' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_classifications' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::MarketplaceTaxInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::MarketplaceTaxInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_classifications') - if (value = attributes[:'tax_classifications']).is_a?(Array) - self.tax_classifications = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_classifications == o.tax_classifications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_classifications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/measurement.rb b/vendor/orders_v0/lib/sp_orders_v0/models/measurement.rb deleted file mode 100644 index e7994bf..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/measurement.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Measurement information for an order item. - class Measurement - # The unit of measure. - attr_accessor :unit - - # The measurement value. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit' => :'Unit', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::Measurement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::Measurement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit.nil? - invalid_properties.push('invalid value for "unit", unit cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit.nil? - unit_validator = EnumAttributeValidator.new('Object', ['OUNCES', 'POUNDS', 'KILOGRAMS', 'GRAMS', 'MILLIGRAMS', 'INCHES', 'FEET', 'METERS', 'CENTIMETERS', 'MILLIMETERS', 'SQUARE_METERS', 'SQUARE_CENTIMETERS', 'SQUARE_FEET', 'SQUARE_INCHES', 'GALLONS', 'PINTS', 'QUARTS', 'FLUID_OUNCES', 'LITERS', 'CUBIC_METERS', 'CUBIC_FEET', 'CUBIC_INCHES', 'CUBIC_CENTIMETERS', 'COUNT']) - return false unless unit_validator.valid?(@unit) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('Object', ['OUNCES', 'POUNDS', 'KILOGRAMS', 'GRAMS', 'MILLIGRAMS', 'INCHES', 'FEET', 'METERS', 'CENTIMETERS', 'MILLIMETERS', 'SQUARE_METERS', 'SQUARE_CENTIMETERS', 'SQUARE_FEET', 'SQUARE_INCHES', 'GALLONS', 'PINTS', 'QUARTS', 'FLUID_OUNCES', 'LITERS', 'CUBIC_METERS', 'CUBIC_FEET', 'CUBIC_INCHES', 'CUBIC_CENTIMETERS', 'COUNT']) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit == o.unit && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/money.rb b/vendor/orders_v0/lib/sp_orders_v0/models/money.rb deleted file mode 100644 index 73ab1c7..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/money.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The monetary value of the order. - class Money - # The three-digit currency code. In ISO 4217 format. - attr_accessor :currency_code - - # The currency amount. - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'CurrencyCode', - :'amount' => :'Amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/open_interval.rb b/vendor/orders_v0/lib/sp_orders_v0/models/open_interval.rb deleted file mode 100644 index cb28f87..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/open_interval.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The time interval for which the business is open. - class OpenInterval - attr_accessor :start_time - - attr_accessor :end_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'StartTime', - :'end_time' => :'EndTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Object', - :'end_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OpenInterval` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OpenInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/open_time_interval.rb b/vendor/orders_v0/lib/sp_orders_v0/models/open_time_interval.rb deleted file mode 100644 index f008282..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/open_time_interval.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The time when the business opens or closes. - class OpenTimeInterval - # The hour when the business opens or closes. - attr_accessor :hour - - # The minute when the business opens or closes. - attr_accessor :minute - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hour' => :'Hour', - :'minute' => :'Minute' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'hour' => :'Object', - :'minute' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OpenTimeInterval` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OpenTimeInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hour') - self.hour = attributes[:'hour'] - end - - if attributes.key?(:'minute') - self.minute = attributes[:'minute'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hour == o.hour && - minute == o.minute - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hour, minute].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order.rb deleted file mode 100644 index b9f8d40..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order.rb +++ /dev/null @@ -1,762 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Order information. - class Order - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - # A seller-defined order identifier. - attr_accessor :seller_order_id - - # The date when the order was created. - attr_accessor :purchase_date - - # The date when the order was last updated. __Note__: `LastUpdateDate` is returned with an incorrect date for orders that were last updated before 2009-04-01. - attr_accessor :last_update_date - - # The current order status. - attr_accessor :order_status - - # Whether the order was fulfilled by Amazon (`AFN`) or by the seller (`MFN`). - attr_accessor :fulfillment_channel - - # The sales channel for the first item in the order. - attr_accessor :sales_channel - - # The order channel for the first item in the order. - attr_accessor :order_channel - - # The order's shipment service level. - attr_accessor :ship_service_level - - attr_accessor :order_total - - # The number of items shipped. - attr_accessor :number_of_items_shipped - - # The number of items unshipped. - attr_accessor :number_of_items_unshipped - - attr_accessor :payment_execution_detail - - # The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the `PaymentExecutionDetailItem` object, we recommend using the `PaymentMethodDetails` property to get payment method information. - attr_accessor :payment_method - - attr_accessor :payment_method_details - - # The identifier for the marketplace where the order was placed. - attr_accessor :marketplace_id - - # The shipment service level category for the order. **Possible values**: `Expedited`, `FreeEconomy`, `NextDay`, `Priority`, `SameDay`, `SecondDay`, `Scheduled`, and `Standard`. - attr_accessor :shipment_service_level_category - - attr_accessor :easy_ship_shipment_status - - # Custom ship label for Checkout by Amazon (CBA). - attr_accessor :cba_displayable_shipping_label - - # The order's type. - attr_accessor :order_type - - # The start of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders. __Note__: `EarliestShipDate` might not be returned for orders placed before February 1, 2013. - attr_accessor :earliest_ship_date - - # The end of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders. __Note__: `LatestShipDate` might not be returned for orders placed before February 1, 2013. - attr_accessor :latest_ship_date - - # The start of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders. - attr_accessor :earliest_delivery_date - - # The end of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders that do not have a `PendingAvailability`, `Pending`, or `Canceled` status. - attr_accessor :latest_delivery_date - - # When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer. - attr_accessor :is_business_order - - # When true, the order is a seller-fulfilled Amazon Prime order. - attr_accessor :is_prime - - # When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, refer to \"Premium Shipping Options\" in the Seller Central Help for your marketplace. - attr_accessor :is_premium_order - - # When true, the order is a `GlobalExpress` order. - attr_accessor :is_global_express_enabled - - # The order ID value for the order that is being replaced. Returned only if IsReplacementOrder = true. - attr_accessor :replaced_order_id - - # When true, this is a replacement order. - attr_accessor :is_replacement_order - - # Indicates the date by which the seller must respond to the buyer with an estimated ship date. Only returned for Sourcing on Demand orders. - attr_accessor :promise_response_due_date - - # When true, the estimated ship date is set for the order. Only returned for Sourcing on Demand orders. - attr_accessor :is_estimated_ship_date_set - - # When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller. - attr_accessor :is_sold_by_ab - - # When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller. - attr_accessor :is_iba - - attr_accessor :default_ship_from_location_address - - # The buyer's invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey. **Note**: This attribute is only available in the Turkey marketplace. - attr_accessor :buyer_invoice_preference - - attr_accessor :buyer_tax_information - - attr_accessor :fulfillment_instruction - - # When true, this order is marked to be picked up from a store rather than delivered. - attr_accessor :is_ispu - - # When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers. - attr_accessor :is_access_point_order - - attr_accessor :marketplace_tax_info - - # The seller’s friendly name registered in the marketplace where the sale took place. Sellers can use this data to issue electronic invoices for orders in Brazil. **Note**: This attribute is only available in the Brazil marketplace for the orders with `Pending` or `Unshipped` status. - attr_accessor :seller_display_name - - attr_accessor :shipping_address - - attr_accessor :buyer_info - - attr_accessor :automated_shipping_settings - - # Whether the order contains regulated items which may require additional approval steps before being fulfilled. - attr_accessor :has_regulated_items - - attr_accessor :electronic_invoice_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_order_id' => :'AmazonOrderId', - :'seller_order_id' => :'SellerOrderId', - :'purchase_date' => :'PurchaseDate', - :'last_update_date' => :'LastUpdateDate', - :'order_status' => :'OrderStatus', - :'fulfillment_channel' => :'FulfillmentChannel', - :'sales_channel' => :'SalesChannel', - :'order_channel' => :'OrderChannel', - :'ship_service_level' => :'ShipServiceLevel', - :'order_total' => :'OrderTotal', - :'number_of_items_shipped' => :'NumberOfItemsShipped', - :'number_of_items_unshipped' => :'NumberOfItemsUnshipped', - :'payment_execution_detail' => :'PaymentExecutionDetail', - :'payment_method' => :'PaymentMethod', - :'payment_method_details' => :'PaymentMethodDetails', - :'marketplace_id' => :'MarketplaceId', - :'shipment_service_level_category' => :'ShipmentServiceLevelCategory', - :'easy_ship_shipment_status' => :'EasyShipShipmentStatus', - :'cba_displayable_shipping_label' => :'CbaDisplayableShippingLabel', - :'order_type' => :'OrderType', - :'earliest_ship_date' => :'EarliestShipDate', - :'latest_ship_date' => :'LatestShipDate', - :'earliest_delivery_date' => :'EarliestDeliveryDate', - :'latest_delivery_date' => :'LatestDeliveryDate', - :'is_business_order' => :'IsBusinessOrder', - :'is_prime' => :'IsPrime', - :'is_premium_order' => :'IsPremiumOrder', - :'is_global_express_enabled' => :'IsGlobalExpressEnabled', - :'replaced_order_id' => :'ReplacedOrderId', - :'is_replacement_order' => :'IsReplacementOrder', - :'promise_response_due_date' => :'PromiseResponseDueDate', - :'is_estimated_ship_date_set' => :'IsEstimatedShipDateSet', - :'is_sold_by_ab' => :'IsSoldByAB', - :'is_iba' => :'IsIBA', - :'default_ship_from_location_address' => :'DefaultShipFromLocationAddress', - :'buyer_invoice_preference' => :'BuyerInvoicePreference', - :'buyer_tax_information' => :'BuyerTaxInformation', - :'fulfillment_instruction' => :'FulfillmentInstruction', - :'is_ispu' => :'IsISPU', - :'is_access_point_order' => :'IsAccessPointOrder', - :'marketplace_tax_info' => :'MarketplaceTaxInfo', - :'seller_display_name' => :'SellerDisplayName', - :'shipping_address' => :'ShippingAddress', - :'buyer_info' => :'BuyerInfo', - :'automated_shipping_settings' => :'AutomatedShippingSettings', - :'has_regulated_items' => :'HasRegulatedItems', - :'electronic_invoice_status' => :'ElectronicInvoiceStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_order_id' => :'Object', - :'seller_order_id' => :'Object', - :'purchase_date' => :'Object', - :'last_update_date' => :'Object', - :'order_status' => :'Object', - :'fulfillment_channel' => :'Object', - :'sales_channel' => :'Object', - :'order_channel' => :'Object', - :'ship_service_level' => :'Object', - :'order_total' => :'Object', - :'number_of_items_shipped' => :'Object', - :'number_of_items_unshipped' => :'Object', - :'payment_execution_detail' => :'Object', - :'payment_method' => :'Object', - :'payment_method_details' => :'Object', - :'marketplace_id' => :'Object', - :'shipment_service_level_category' => :'Object', - :'easy_ship_shipment_status' => :'Object', - :'cba_displayable_shipping_label' => :'Object', - :'order_type' => :'Object', - :'earliest_ship_date' => :'Object', - :'latest_ship_date' => :'Object', - :'earliest_delivery_date' => :'Object', - :'latest_delivery_date' => :'Object', - :'is_business_order' => :'Object', - :'is_prime' => :'Object', - :'is_premium_order' => :'Object', - :'is_global_express_enabled' => :'Object', - :'replaced_order_id' => :'Object', - :'is_replacement_order' => :'Object', - :'promise_response_due_date' => :'Object', - :'is_estimated_ship_date_set' => :'Object', - :'is_sold_by_ab' => :'Object', - :'is_iba' => :'Object', - :'default_ship_from_location_address' => :'Object', - :'buyer_invoice_preference' => :'Object', - :'buyer_tax_information' => :'Object', - :'fulfillment_instruction' => :'Object', - :'is_ispu' => :'Object', - :'is_access_point_order' => :'Object', - :'marketplace_tax_info' => :'Object', - :'seller_display_name' => :'Object', - :'shipping_address' => :'Object', - :'buyer_info' => :'Object', - :'automated_shipping_settings' => :'Object', - :'has_regulated_items' => :'Object', - :'electronic_invoice_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::Order` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'seller_order_id') - self.seller_order_id = attributes[:'seller_order_id'] - end - - if attributes.key?(:'purchase_date') - self.purchase_date = attributes[:'purchase_date'] - end - - if attributes.key?(:'last_update_date') - self.last_update_date = attributes[:'last_update_date'] - end - - if attributes.key?(:'order_status') - self.order_status = attributes[:'order_status'] - end - - if attributes.key?(:'fulfillment_channel') - self.fulfillment_channel = attributes[:'fulfillment_channel'] - end - - if attributes.key?(:'sales_channel') - self.sales_channel = attributes[:'sales_channel'] - end - - if attributes.key?(:'order_channel') - self.order_channel = attributes[:'order_channel'] - end - - if attributes.key?(:'ship_service_level') - self.ship_service_level = attributes[:'ship_service_level'] - end - - if attributes.key?(:'order_total') - self.order_total = attributes[:'order_total'] - end - - if attributes.key?(:'number_of_items_shipped') - self.number_of_items_shipped = attributes[:'number_of_items_shipped'] - end - - if attributes.key?(:'number_of_items_unshipped') - self.number_of_items_unshipped = attributes[:'number_of_items_unshipped'] - end - - if attributes.key?(:'payment_execution_detail') - self.payment_execution_detail = attributes[:'payment_execution_detail'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - - if attributes.key?(:'payment_method_details') - self.payment_method_details = attributes[:'payment_method_details'] - end - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'shipment_service_level_category') - self.shipment_service_level_category = attributes[:'shipment_service_level_category'] - end - - if attributes.key?(:'easy_ship_shipment_status') - self.easy_ship_shipment_status = attributes[:'easy_ship_shipment_status'] - end - - if attributes.key?(:'cba_displayable_shipping_label') - self.cba_displayable_shipping_label = attributes[:'cba_displayable_shipping_label'] - end - - if attributes.key?(:'order_type') - self.order_type = attributes[:'order_type'] - end - - if attributes.key?(:'earliest_ship_date') - self.earliest_ship_date = attributes[:'earliest_ship_date'] - end - - if attributes.key?(:'latest_ship_date') - self.latest_ship_date = attributes[:'latest_ship_date'] - end - - if attributes.key?(:'earliest_delivery_date') - self.earliest_delivery_date = attributes[:'earliest_delivery_date'] - end - - if attributes.key?(:'latest_delivery_date') - self.latest_delivery_date = attributes[:'latest_delivery_date'] - end - - if attributes.key?(:'is_business_order') - self.is_business_order = attributes[:'is_business_order'] - end - - if attributes.key?(:'is_prime') - self.is_prime = attributes[:'is_prime'] - end - - if attributes.key?(:'is_premium_order') - self.is_premium_order = attributes[:'is_premium_order'] - end - - if attributes.key?(:'is_global_express_enabled') - self.is_global_express_enabled = attributes[:'is_global_express_enabled'] - end - - if attributes.key?(:'replaced_order_id') - self.replaced_order_id = attributes[:'replaced_order_id'] - end - - if attributes.key?(:'is_replacement_order') - self.is_replacement_order = attributes[:'is_replacement_order'] - end - - if attributes.key?(:'promise_response_due_date') - self.promise_response_due_date = attributes[:'promise_response_due_date'] - end - - if attributes.key?(:'is_estimated_ship_date_set') - self.is_estimated_ship_date_set = attributes[:'is_estimated_ship_date_set'] - end - - if attributes.key?(:'is_sold_by_ab') - self.is_sold_by_ab = attributes[:'is_sold_by_ab'] - end - - if attributes.key?(:'is_iba') - self.is_iba = attributes[:'is_iba'] - end - - if attributes.key?(:'default_ship_from_location_address') - self.default_ship_from_location_address = attributes[:'default_ship_from_location_address'] - end - - if attributes.key?(:'buyer_invoice_preference') - self.buyer_invoice_preference = attributes[:'buyer_invoice_preference'] - end - - if attributes.key?(:'buyer_tax_information') - self.buyer_tax_information = attributes[:'buyer_tax_information'] - end - - if attributes.key?(:'fulfillment_instruction') - self.fulfillment_instruction = attributes[:'fulfillment_instruction'] - end - - if attributes.key?(:'is_ispu') - self.is_ispu = attributes[:'is_ispu'] - end - - if attributes.key?(:'is_access_point_order') - self.is_access_point_order = attributes[:'is_access_point_order'] - end - - if attributes.key?(:'marketplace_tax_info') - self.marketplace_tax_info = attributes[:'marketplace_tax_info'] - end - - if attributes.key?(:'seller_display_name') - self.seller_display_name = attributes[:'seller_display_name'] - end - - if attributes.key?(:'shipping_address') - self.shipping_address = attributes[:'shipping_address'] - end - - if attributes.key?(:'buyer_info') - self.buyer_info = attributes[:'buyer_info'] - end - - if attributes.key?(:'automated_shipping_settings') - self.automated_shipping_settings = attributes[:'automated_shipping_settings'] - end - - if attributes.key?(:'has_regulated_items') - self.has_regulated_items = attributes[:'has_regulated_items'] - end - - if attributes.key?(:'electronic_invoice_status') - self.electronic_invoice_status = attributes[:'electronic_invoice_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - if @purchase_date.nil? - invalid_properties.push('invalid value for "purchase_date", purchase_date cannot be nil.') - end - - if @last_update_date.nil? - invalid_properties.push('invalid value for "last_update_date", last_update_date cannot be nil.') - end - - if @order_status.nil? - invalid_properties.push('invalid value for "order_status", order_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_order_id.nil? - return false if @purchase_date.nil? - return false if @last_update_date.nil? - return false if @order_status.nil? - order_status_validator = EnumAttributeValidator.new('Object', ['Pending', 'Unshipped', 'PartiallyShipped', 'Shipped', 'Canceled', 'Unfulfillable', 'InvoiceUnconfirmed', 'PendingAvailability']) - return false unless order_status_validator.valid?(@order_status) - fulfillment_channel_validator = EnumAttributeValidator.new('Object', ['MFN', 'AFN']) - return false unless fulfillment_channel_validator.valid?(@fulfillment_channel) - payment_method_validator = EnumAttributeValidator.new('Object', ['COD', 'CVS', 'Other']) - return false unless payment_method_validator.valid?(@payment_method) - order_type_validator = EnumAttributeValidator.new('Object', ['StandardOrder', 'LongLeadTimeOrder', 'Preorder', 'BackOrder', 'SourcingOnDemandOrder']) - return false unless order_type_validator.valid?(@order_type) - buyer_invoice_preference_validator = EnumAttributeValidator.new('Object', ['INDIVIDUAL', 'BUSINESS']) - return false unless buyer_invoice_preference_validator.valid?(@buyer_invoice_preference) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] order_status Object to be assigned - def order_status=(order_status) - validator = EnumAttributeValidator.new('Object', ['Pending', 'Unshipped', 'PartiallyShipped', 'Shipped', 'Canceled', 'Unfulfillable', 'InvoiceUnconfirmed', 'PendingAvailability']) - unless validator.valid?(order_status) - fail ArgumentError, "invalid value for \"order_status\", must be one of #{validator.allowable_values}." - end - @order_status = order_status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] fulfillment_channel Object to be assigned - def fulfillment_channel=(fulfillment_channel) - validator = EnumAttributeValidator.new('Object', ['MFN', 'AFN']) - unless validator.valid?(fulfillment_channel) - fail ArgumentError, "invalid value for \"fulfillment_channel\", must be one of #{validator.allowable_values}." - end - @fulfillment_channel = fulfillment_channel - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] payment_method Object to be assigned - def payment_method=(payment_method) - validator = EnumAttributeValidator.new('Object', ['COD', 'CVS', 'Other']) - unless validator.valid?(payment_method) - fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." - end - @payment_method = payment_method - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] order_type Object to be assigned - def order_type=(order_type) - validator = EnumAttributeValidator.new('Object', ['StandardOrder', 'LongLeadTimeOrder', 'Preorder', 'BackOrder', 'SourcingOnDemandOrder']) - unless validator.valid?(order_type) - fail ArgumentError, "invalid value for \"order_type\", must be one of #{validator.allowable_values}." - end - @order_type = order_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] buyer_invoice_preference Object to be assigned - def buyer_invoice_preference=(buyer_invoice_preference) - validator = EnumAttributeValidator.new('Object', ['INDIVIDUAL', 'BUSINESS']) - unless validator.valid?(buyer_invoice_preference) - fail ArgumentError, "invalid value for \"buyer_invoice_preference\", must be one of #{validator.allowable_values}." - end - @buyer_invoice_preference = buyer_invoice_preference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_order_id == o.amazon_order_id && - seller_order_id == o.seller_order_id && - purchase_date == o.purchase_date && - last_update_date == o.last_update_date && - order_status == o.order_status && - fulfillment_channel == o.fulfillment_channel && - sales_channel == o.sales_channel && - order_channel == o.order_channel && - ship_service_level == o.ship_service_level && - order_total == o.order_total && - number_of_items_shipped == o.number_of_items_shipped && - number_of_items_unshipped == o.number_of_items_unshipped && - payment_execution_detail == o.payment_execution_detail && - payment_method == o.payment_method && - payment_method_details == o.payment_method_details && - marketplace_id == o.marketplace_id && - shipment_service_level_category == o.shipment_service_level_category && - easy_ship_shipment_status == o.easy_ship_shipment_status && - cba_displayable_shipping_label == o.cba_displayable_shipping_label && - order_type == o.order_type && - earliest_ship_date == o.earliest_ship_date && - latest_ship_date == o.latest_ship_date && - earliest_delivery_date == o.earliest_delivery_date && - latest_delivery_date == o.latest_delivery_date && - is_business_order == o.is_business_order && - is_prime == o.is_prime && - is_premium_order == o.is_premium_order && - is_global_express_enabled == o.is_global_express_enabled && - replaced_order_id == o.replaced_order_id && - is_replacement_order == o.is_replacement_order && - promise_response_due_date == o.promise_response_due_date && - is_estimated_ship_date_set == o.is_estimated_ship_date_set && - is_sold_by_ab == o.is_sold_by_ab && - is_iba == o.is_iba && - default_ship_from_location_address == o.default_ship_from_location_address && - buyer_invoice_preference == o.buyer_invoice_preference && - buyer_tax_information == o.buyer_tax_information && - fulfillment_instruction == o.fulfillment_instruction && - is_ispu == o.is_ispu && - is_access_point_order == o.is_access_point_order && - marketplace_tax_info == o.marketplace_tax_info && - seller_display_name == o.seller_display_name && - shipping_address == o.shipping_address && - buyer_info == o.buyer_info && - automated_shipping_settings == o.automated_shipping_settings && - has_regulated_items == o.has_regulated_items && - electronic_invoice_status == o.electronic_invoice_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_order_id, seller_order_id, purchase_date, last_update_date, order_status, fulfillment_channel, sales_channel, order_channel, ship_service_level, order_total, number_of_items_shipped, number_of_items_unshipped, payment_execution_detail, payment_method, payment_method_details, marketplace_id, shipment_service_level_category, easy_ship_shipment_status, cba_displayable_shipping_label, order_type, earliest_ship_date, latest_ship_date, earliest_delivery_date, latest_delivery_date, is_business_order, is_prime, is_premium_order, is_global_express_enabled, replaced_order_id, is_replacement_order, promise_response_due_date, is_estimated_ship_date_set, is_sold_by_ab, is_iba, default_ship_from_location_address, buyer_invoice_preference, buyer_tax_information, fulfillment_instruction, is_ispu, is_access_point_order, marketplace_tax_info, seller_display_name, shipping_address, buyer_info, automated_shipping_settings, has_regulated_items, electronic_invoice_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_address.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_address.rb deleted file mode 100644 index 56baa52..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_address.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The shipping address for the order. - class OrderAddress - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - # The company name of the contact buyer. For IBA orders, the buyer company must be Amazon entities. - attr_accessor :buyer_company_name - - attr_accessor :shipping_address - - attr_accessor :delivery_preferences - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_order_id' => :'AmazonOrderId', - :'buyer_company_name' => :'BuyerCompanyName', - :'shipping_address' => :'ShippingAddress', - :'delivery_preferences' => :'DeliveryPreferences' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_order_id' => :'Object', - :'buyer_company_name' => :'Object', - :'shipping_address' => :'Object', - :'delivery_preferences' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'buyer_company_name') - self.buyer_company_name = attributes[:'buyer_company_name'] - end - - if attributes.key?(:'shipping_address') - self.shipping_address = attributes[:'shipping_address'] - end - - if attributes.key?(:'delivery_preferences') - self.delivery_preferences = attributes[:'delivery_preferences'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_order_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_order_id == o.amazon_order_id && - buyer_company_name == o.buyer_company_name && - shipping_address == o.shipping_address && - delivery_preferences == o.delivery_preferences - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_order_id, buyer_company_name, shipping_address, delivery_preferences].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_buyer_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_buyer_info.rb deleted file mode 100644 index c7b82c0..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_buyer_info.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Buyer information for an order. - class OrderBuyerInfo - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - # The anonymized email address of the buyer. - attr_accessor :buyer_email - - # The buyer name or the recipient name. - attr_accessor :buyer_name - - # The county of the buyer. **Note**: This attribute is only available in the Brazil marketplace. - attr_accessor :buyer_county - - attr_accessor :buyer_tax_info - - # The purchase order (PO) number entered by the buyer at checkout. Only returned for orders where the buyer entered a PO number at checkout. - attr_accessor :purchase_order_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_order_id' => :'AmazonOrderId', - :'buyer_email' => :'BuyerEmail', - :'buyer_name' => :'BuyerName', - :'buyer_county' => :'BuyerCounty', - :'buyer_tax_info' => :'BuyerTaxInfo', - :'purchase_order_number' => :'PurchaseOrderNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_order_id' => :'Object', - :'buyer_email' => :'Object', - :'buyer_name' => :'Object', - :'buyer_county' => :'Object', - :'buyer_tax_info' => :'Object', - :'purchase_order_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderBuyerInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderBuyerInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'buyer_email') - self.buyer_email = attributes[:'buyer_email'] - end - - if attributes.key?(:'buyer_name') - self.buyer_name = attributes[:'buyer_name'] - end - - if attributes.key?(:'buyer_county') - self.buyer_county = attributes[:'buyer_county'] - end - - if attributes.key?(:'buyer_tax_info') - self.buyer_tax_info = attributes[:'buyer_tax_info'] - end - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_order_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_order_id == o.amazon_order_id && - buyer_email == o.buyer_email && - buyer_name == o.buyer_name && - buyer_county == o.buyer_county && - buyer_tax_info == o.buyer_tax_info && - purchase_order_number == o.purchase_order_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_order_id, buyer_email, buyer_name, buyer_county, buyer_tax_info, purchase_order_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_item.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_item.rb deleted file mode 100644 index 5f96491..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_item.rb +++ /dev/null @@ -1,644 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single order item. - class OrderItem - # The item's Amazon Standard Identification Number (ASIN). - attr_accessor :asin - - # The item's seller stock keeping unit (SKU). - attr_accessor :seller_sku - - # An Amazon-defined order item identifier. - attr_accessor :order_item_id - - # A list of associated items that a customer has purchased with a product. For example, a tire installation service purchased with tires. - attr_accessor :associated_items - - # The item's name. - attr_accessor :title - - # The number of items in the order. - attr_accessor :quantity_ordered - - # The number of items shipped. - attr_accessor :quantity_shipped - - attr_accessor :product_info - - attr_accessor :points_granted - - attr_accessor :item_price - - attr_accessor :shipping_price - - attr_accessor :item_tax - - attr_accessor :shipping_tax - - attr_accessor :shipping_discount - - attr_accessor :shipping_discount_tax - - attr_accessor :promotion_discount - - attr_accessor :promotion_discount_tax - - attr_accessor :promotion_ids - - attr_accessor :cod_fee - - attr_accessor :cod_fee_discount - - # Indicates whether the item is a gift. **Possible values**: `true` and `false`. - attr_accessor :is_gift - - # The condition of the item, as described by the seller. - attr_accessor :condition_note - - # The condition of the item. **Possible values**: `New`, `Used`, `Collectible`, `Refurbished`, `Preorder`, and `Club`. - attr_accessor :condition_id - - # The subcondition of the item. **Possible values**: `New`, `Mint`, `Very Good`, `Good`, `Acceptable`, `Poor`, `Club`, `OEM`, `Warranty`, `Refurbished Warranty`, `Refurbished`, `Open Box`, `Any`, and `Other`. - attr_accessor :condition_subtype_id - - # The start date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. - attr_accessor :scheduled_delivery_start_date - - # The end date of the scheduled delivery window in the time zone for the order destination. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. - attr_accessor :scheduled_delivery_end_date - - # Indicates that the selling price is a special price that is only available for Amazon Business orders. For more information about the Amazon Business Seller Program, refer to the [Amazon Business website](https://www.amazon.com/b2b/info/amazon-business). **Possible values**: `BusinessPrice` - attr_accessor :price_designation - - attr_accessor :tax_collection - - # When true, the product type for this item has a serial number. Only returned for Amazon Easy Ship orders. - attr_accessor :serial_number_required - - # When true, the ASIN is enrolled in Transparency. The Transparency serial number that you must submit is determined by: **1D or 2D Barcode:** This has a **T** logo. Submit either the 29-character alpha-numeric identifier beginning with **AZ** or **ZA**, or the 38-character Serialized Global Trade Item Number (SGTIN). **2D Barcode SN:** Submit the 7- to 20-character serial number barcode, which likely has the prefix **SN**. The serial number is applied to the same side of the packaging as the GTIN (UPC/EAN/ISBN) barcode. **QR code SN:** Submit the URL that the QR code generates. - attr_accessor :is_transparency - - # The IOSS number of the marketplace. Sellers shipping to the EU from outside the EU must provide this IOSS number to their carrier when Amazon has collected the VAT on the sale. - attr_accessor :ioss_number - - # The store chain store identifier. Linked to a specific store in a store chain. - attr_accessor :store_chain_store_id - - # The category of deemed reseller. This applies to selling partners that are not based in the EU and is used to help them meet the VAT Deemed Reseller tax laws in the EU and UK. - attr_accessor :deemed_reseller_category - - attr_accessor :buyer_info - - attr_accessor :buyer_requested_cancel - - # A list of serial numbers for electronic products that are shipped to customers. Returned for FBA orders only. - attr_accessor :serial_numbers - - attr_accessor :substitution_preferences - - attr_accessor :measurement - - attr_accessor :shipping_constraints - - attr_accessor :amazon_programs - - attr_accessor :export_info - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'ASIN', - :'seller_sku' => :'SellerSKU', - :'order_item_id' => :'OrderItemId', - :'associated_items' => :'AssociatedItems', - :'title' => :'Title', - :'quantity_ordered' => :'QuantityOrdered', - :'quantity_shipped' => :'QuantityShipped', - :'product_info' => :'ProductInfo', - :'points_granted' => :'PointsGranted', - :'item_price' => :'ItemPrice', - :'shipping_price' => :'ShippingPrice', - :'item_tax' => :'ItemTax', - :'shipping_tax' => :'ShippingTax', - :'shipping_discount' => :'ShippingDiscount', - :'shipping_discount_tax' => :'ShippingDiscountTax', - :'promotion_discount' => :'PromotionDiscount', - :'promotion_discount_tax' => :'PromotionDiscountTax', - :'promotion_ids' => :'PromotionIds', - :'cod_fee' => :'CODFee', - :'cod_fee_discount' => :'CODFeeDiscount', - :'is_gift' => :'IsGift', - :'condition_note' => :'ConditionNote', - :'condition_id' => :'ConditionId', - :'condition_subtype_id' => :'ConditionSubtypeId', - :'scheduled_delivery_start_date' => :'ScheduledDeliveryStartDate', - :'scheduled_delivery_end_date' => :'ScheduledDeliveryEndDate', - :'price_designation' => :'PriceDesignation', - :'tax_collection' => :'TaxCollection', - :'serial_number_required' => :'SerialNumberRequired', - :'is_transparency' => :'IsTransparency', - :'ioss_number' => :'IossNumber', - :'store_chain_store_id' => :'StoreChainStoreId', - :'deemed_reseller_category' => :'DeemedResellerCategory', - :'buyer_info' => :'BuyerInfo', - :'buyer_requested_cancel' => :'BuyerRequestedCancel', - :'serial_numbers' => :'SerialNumbers', - :'substitution_preferences' => :'SubstitutionPreferences', - :'measurement' => :'Measurement', - :'shipping_constraints' => :'ShippingConstraints', - :'amazon_programs' => :'AmazonPrograms', - :'export_info' => :'ExportInfo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'seller_sku' => :'Object', - :'order_item_id' => :'Object', - :'associated_items' => :'Object', - :'title' => :'Object', - :'quantity_ordered' => :'Object', - :'quantity_shipped' => :'Object', - :'product_info' => :'Object', - :'points_granted' => :'Object', - :'item_price' => :'Object', - :'shipping_price' => :'Object', - :'item_tax' => :'Object', - :'shipping_tax' => :'Object', - :'shipping_discount' => :'Object', - :'shipping_discount_tax' => :'Object', - :'promotion_discount' => :'Object', - :'promotion_discount_tax' => :'Object', - :'promotion_ids' => :'Object', - :'cod_fee' => :'Object', - :'cod_fee_discount' => :'Object', - :'is_gift' => :'Object', - :'condition_note' => :'Object', - :'condition_id' => :'Object', - :'condition_subtype_id' => :'Object', - :'scheduled_delivery_start_date' => :'Object', - :'scheduled_delivery_end_date' => :'Object', - :'price_designation' => :'Object', - :'tax_collection' => :'Object', - :'serial_number_required' => :'Object', - :'is_transparency' => :'Object', - :'ioss_number' => :'Object', - :'store_chain_store_id' => :'Object', - :'deemed_reseller_category' => :'Object', - :'buyer_info' => :'Object', - :'buyer_requested_cancel' => :'Object', - :'serial_numbers' => :'Object', - :'substitution_preferences' => :'Object', - :'measurement' => :'Object', - :'shipping_constraints' => :'Object', - :'amazon_programs' => :'Object', - :'export_info' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'associated_items') - if (value = attributes[:'associated_items']).is_a?(Array) - self.associated_items = value - end - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'quantity_ordered') - self.quantity_ordered = attributes[:'quantity_ordered'] - end - - if attributes.key?(:'quantity_shipped') - self.quantity_shipped = attributes[:'quantity_shipped'] - end - - if attributes.key?(:'product_info') - self.product_info = attributes[:'product_info'] - end - - if attributes.key?(:'points_granted') - self.points_granted = attributes[:'points_granted'] - end - - if attributes.key?(:'item_price') - self.item_price = attributes[:'item_price'] - end - - if attributes.key?(:'shipping_price') - self.shipping_price = attributes[:'shipping_price'] - end - - if attributes.key?(:'item_tax') - self.item_tax = attributes[:'item_tax'] - end - - if attributes.key?(:'shipping_tax') - self.shipping_tax = attributes[:'shipping_tax'] - end - - if attributes.key?(:'shipping_discount') - self.shipping_discount = attributes[:'shipping_discount'] - end - - if attributes.key?(:'shipping_discount_tax') - self.shipping_discount_tax = attributes[:'shipping_discount_tax'] - end - - if attributes.key?(:'promotion_discount') - self.promotion_discount = attributes[:'promotion_discount'] - end - - if attributes.key?(:'promotion_discount_tax') - self.promotion_discount_tax = attributes[:'promotion_discount_tax'] - end - - if attributes.key?(:'promotion_ids') - self.promotion_ids = attributes[:'promotion_ids'] - end - - if attributes.key?(:'cod_fee') - self.cod_fee = attributes[:'cod_fee'] - end - - if attributes.key?(:'cod_fee_discount') - self.cod_fee_discount = attributes[:'cod_fee_discount'] - end - - if attributes.key?(:'is_gift') - self.is_gift = attributes[:'is_gift'] - end - - if attributes.key?(:'condition_note') - self.condition_note = attributes[:'condition_note'] - end - - if attributes.key?(:'condition_id') - self.condition_id = attributes[:'condition_id'] - end - - if attributes.key?(:'condition_subtype_id') - self.condition_subtype_id = attributes[:'condition_subtype_id'] - end - - if attributes.key?(:'scheduled_delivery_start_date') - self.scheduled_delivery_start_date = attributes[:'scheduled_delivery_start_date'] - end - - if attributes.key?(:'scheduled_delivery_end_date') - self.scheduled_delivery_end_date = attributes[:'scheduled_delivery_end_date'] - end - - if attributes.key?(:'price_designation') - self.price_designation = attributes[:'price_designation'] - end - - if attributes.key?(:'tax_collection') - self.tax_collection = attributes[:'tax_collection'] - end - - if attributes.key?(:'serial_number_required') - self.serial_number_required = attributes[:'serial_number_required'] - end - - if attributes.key?(:'is_transparency') - self.is_transparency = attributes[:'is_transparency'] - end - - if attributes.key?(:'ioss_number') - self.ioss_number = attributes[:'ioss_number'] - end - - if attributes.key?(:'store_chain_store_id') - self.store_chain_store_id = attributes[:'store_chain_store_id'] - end - - if attributes.key?(:'deemed_reseller_category') - self.deemed_reseller_category = attributes[:'deemed_reseller_category'] - end - - if attributes.key?(:'buyer_info') - self.buyer_info = attributes[:'buyer_info'] - end - - if attributes.key?(:'buyer_requested_cancel') - self.buyer_requested_cancel = attributes[:'buyer_requested_cancel'] - end - - if attributes.key?(:'serial_numbers') - if (value = attributes[:'serial_numbers']).is_a?(Array) - self.serial_numbers = value - end - end - - if attributes.key?(:'substitution_preferences') - self.substitution_preferences = attributes[:'substitution_preferences'] - end - - if attributes.key?(:'measurement') - self.measurement = attributes[:'measurement'] - end - - if attributes.key?(:'shipping_constraints') - self.shipping_constraints = attributes[:'shipping_constraints'] - end - - if attributes.key?(:'amazon_programs') - self.amazon_programs = attributes[:'amazon_programs'] - end - - if attributes.key?(:'export_info') - self.export_info = attributes[:'export_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asin.nil? - invalid_properties.push('invalid value for "asin", asin cannot be nil.') - end - - if @order_item_id.nil? - invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') - end - - if @quantity_ordered.nil? - invalid_properties.push('invalid value for "quantity_ordered", quantity_ordered cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asin.nil? - return false if @order_item_id.nil? - return false if @quantity_ordered.nil? - deemed_reseller_category_validator = EnumAttributeValidator.new('Object', ['IOSS', 'UOSS']) - return false unless deemed_reseller_category_validator.valid?(@deemed_reseller_category) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] deemed_reseller_category Object to be assigned - def deemed_reseller_category=(deemed_reseller_category) - validator = EnumAttributeValidator.new('Object', ['IOSS', 'UOSS']) - unless validator.valid?(deemed_reseller_category) - fail ArgumentError, "invalid value for \"deemed_reseller_category\", must be one of #{validator.allowable_values}." - end - @deemed_reseller_category = deemed_reseller_category - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - seller_sku == o.seller_sku && - order_item_id == o.order_item_id && - associated_items == o.associated_items && - title == o.title && - quantity_ordered == o.quantity_ordered && - quantity_shipped == o.quantity_shipped && - product_info == o.product_info && - points_granted == o.points_granted && - item_price == o.item_price && - shipping_price == o.shipping_price && - item_tax == o.item_tax && - shipping_tax == o.shipping_tax && - shipping_discount == o.shipping_discount && - shipping_discount_tax == o.shipping_discount_tax && - promotion_discount == o.promotion_discount && - promotion_discount_tax == o.promotion_discount_tax && - promotion_ids == o.promotion_ids && - cod_fee == o.cod_fee && - cod_fee_discount == o.cod_fee_discount && - is_gift == o.is_gift && - condition_note == o.condition_note && - condition_id == o.condition_id && - condition_subtype_id == o.condition_subtype_id && - scheduled_delivery_start_date == o.scheduled_delivery_start_date && - scheduled_delivery_end_date == o.scheduled_delivery_end_date && - price_designation == o.price_designation && - tax_collection == o.tax_collection && - serial_number_required == o.serial_number_required && - is_transparency == o.is_transparency && - ioss_number == o.ioss_number && - store_chain_store_id == o.store_chain_store_id && - deemed_reseller_category == o.deemed_reseller_category && - buyer_info == o.buyer_info && - buyer_requested_cancel == o.buyer_requested_cancel && - serial_numbers == o.serial_numbers && - substitution_preferences == o.substitution_preferences && - measurement == o.measurement && - shipping_constraints == o.shipping_constraints && - amazon_programs == o.amazon_programs && - export_info == o.export_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, seller_sku, order_item_id, associated_items, title, quantity_ordered, quantity_shipped, product_info, points_granted, item_price, shipping_price, item_tax, shipping_tax, shipping_discount, shipping_discount_tax, promotion_discount, promotion_discount_tax, promotion_ids, cod_fee, cod_fee_discount, is_gift, condition_note, condition_id, condition_subtype_id, scheduled_delivery_start_date, scheduled_delivery_end_date, price_designation, tax_collection, serial_number_required, is_transparency, ioss_number, store_chain_store_id, deemed_reseller_category, buyer_info, buyer_requested_cancel, serial_numbers, substitution_preferences, measurement, shipping_constraints, amazon_programs, export_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info.rb deleted file mode 100644 index 032d5e0..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single order item's buyer information. - class OrderItemBuyerInfo - # An Amazon-defined order item identifier. - attr_accessor :order_item_id - - attr_accessor :buyer_customized_info - - attr_accessor :gift_wrap_price - - attr_accessor :gift_wrap_tax - - # A gift message provided by the buyer. **Note**: This attribute is only available for MFN (fulfilled by seller) orders. - attr_accessor :gift_message_text - - # The gift wrap level specified by the buyer. - attr_accessor :gift_wrap_level - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_item_id' => :'OrderItemId', - :'buyer_customized_info' => :'BuyerCustomizedInfo', - :'gift_wrap_price' => :'GiftWrapPrice', - :'gift_wrap_tax' => :'GiftWrapTax', - :'gift_message_text' => :'GiftMessageText', - :'gift_wrap_level' => :'GiftWrapLevel' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_item_id' => :'Object', - :'buyer_customized_info' => :'Object', - :'gift_wrap_price' => :'Object', - :'gift_wrap_tax' => :'Object', - :'gift_message_text' => :'Object', - :'gift_wrap_level' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemBuyerInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemBuyerInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'buyer_customized_info') - self.buyer_customized_info = attributes[:'buyer_customized_info'] - end - - if attributes.key?(:'gift_wrap_price') - self.gift_wrap_price = attributes[:'gift_wrap_price'] - end - - if attributes.key?(:'gift_wrap_tax') - self.gift_wrap_tax = attributes[:'gift_wrap_tax'] - end - - if attributes.key?(:'gift_message_text') - self.gift_message_text = attributes[:'gift_message_text'] - end - - if attributes.key?(:'gift_wrap_level') - self.gift_wrap_level = attributes[:'gift_wrap_level'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @order_item_id.nil? - invalid_properties.push('invalid value for "order_item_id", order_item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @order_item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_item_id == o.order_item_id && - buyer_customized_info == o.buyer_customized_info && - gift_wrap_price == o.gift_wrap_price && - gift_wrap_tax == o.gift_wrap_tax && - gift_message_text == o.gift_message_text && - gift_wrap_level == o.gift_wrap_level - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_item_id, buyer_customized_info, gift_wrap_price, gift_wrap_tax, gift_message_text, gift_wrap_level].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info_list.rb deleted file mode 100644 index 6ce6d61..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_buyer_info_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single order item's buyer information list. - class OrderItemBuyerInfoList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemBuyerInfoList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemBuyerInfoList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_item_list.rb deleted file mode 100644 index ac1e2c2..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of order items. - class OrderItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_items.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_items.rb deleted file mode 100644 index 21d59ad..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_items.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # For partial shipment status updates, the list of order items and quantities to be updated. - class OrderItems - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_buyer_info_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_items_buyer_info_list.rb deleted file mode 100644 index 7a40ca8..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_buyer_info_list.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A single order item's buyer information list with the order ID. - class OrderItemsBuyerInfoList - attr_accessor :order_items - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_items' => :'OrderItems', - :'next_token' => :'NextToken', - :'amazon_order_id' => :'AmazonOrderId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_items' => :'Object', - :'next_token' => :'Object', - :'amazon_order_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemsBuyerInfoList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemsBuyerInfoList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_items') - self.order_items = attributes[:'order_items'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @order_items.nil? - invalid_properties.push('invalid value for "order_items", order_items cannot be nil.') - end - - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @order_items.nil? - return false if @amazon_order_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_items == o.order_items && - next_token == o.next_token && - amazon_order_id == o.amazon_order_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_items, next_token, amazon_order_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_inner.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_items_inner.rb deleted file mode 100644 index 5da62b8..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_inner.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class OrderItemsInner - # The order item's unique identifier. - attr_accessor :order_item_id - - # The quantity for which to update the shipment status. - attr_accessor :quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_item_id' => :'orderItemId', - :'quantity' => :'quantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_item_id' => :'Object', - :'quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemsInner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_item_id') - self.order_item_id = attributes[:'order_item_id'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_item_id == o.order_item_id && - quantity == o.quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_item_id, quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_items_list.rb deleted file mode 100644 index 4a2158b..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_items_list.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The order items list along with the order ID. - class OrderItemsList - attr_accessor :order_items - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_items' => :'OrderItems', - :'next_token' => :'NextToken', - :'amazon_order_id' => :'AmazonOrderId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_items' => :'Object', - :'next_token' => :'Object', - :'amazon_order_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderItemsList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderItemsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_items') - self.order_items = attributes[:'order_items'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @order_items.nil? - invalid_properties.push('invalid value for "order_items", order_items cannot be nil.') - end - - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @order_items.nil? - return false if @amazon_order_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_items == o.order_items && - next_token == o.next_token && - amazon_order_id == o.amazon_order_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_items, next_token, amazon_order_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_list.rb deleted file mode 100644 index 287fcad..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of orders. - class OrderList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/order_regulated_info.rb b/vendor/orders_v0/lib/sp_orders_v0/models/order_regulated_info.rb deleted file mode 100644 index 87ccbee..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/order_regulated_info.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The order's regulated information along with its verification status. - class OrderRegulatedInfo - # An Amazon-defined order identifier, in 3-7-7 format. - attr_accessor :amazon_order_id - - attr_accessor :regulated_information - - # When true, the order requires attaching a dosage information label when shipped. - attr_accessor :requires_dosage_label - - attr_accessor :regulated_order_verification_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amazon_order_id' => :'AmazonOrderId', - :'regulated_information' => :'RegulatedInformation', - :'requires_dosage_label' => :'RequiresDosageLabel', - :'regulated_order_verification_status' => :'RegulatedOrderVerificationStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amazon_order_id' => :'Object', - :'regulated_information' => :'Object', - :'requires_dosage_label' => :'Object', - :'regulated_order_verification_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrderRegulatedInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrderRegulatedInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amazon_order_id') - self.amazon_order_id = attributes[:'amazon_order_id'] - end - - if attributes.key?(:'regulated_information') - self.regulated_information = attributes[:'regulated_information'] - end - - if attributes.key?(:'requires_dosage_label') - self.requires_dosage_label = attributes[:'requires_dosage_label'] - end - - if attributes.key?(:'regulated_order_verification_status') - self.regulated_order_verification_status = attributes[:'regulated_order_verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amazon_order_id.nil? - invalid_properties.push('invalid value for "amazon_order_id", amazon_order_id cannot be nil.') - end - - if @regulated_information.nil? - invalid_properties.push('invalid value for "regulated_information", regulated_information cannot be nil.') - end - - if @requires_dosage_label.nil? - invalid_properties.push('invalid value for "requires_dosage_label", requires_dosage_label cannot be nil.') - end - - if @regulated_order_verification_status.nil? - invalid_properties.push('invalid value for "regulated_order_verification_status", regulated_order_verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amazon_order_id.nil? - return false if @regulated_information.nil? - return false if @requires_dosage_label.nil? - return false if @regulated_order_verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amazon_order_id == o.amazon_order_id && - regulated_information == o.regulated_information && - requires_dosage_label == o.requires_dosage_label && - regulated_order_verification_status == o.regulated_order_verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amazon_order_id, regulated_information, requires_dosage_label, regulated_order_verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/orders_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/orders_list.rb deleted file mode 100644 index 6bb86d9..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/orders_list.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of orders along with additional information to make subsequent API calls. - class OrdersList - attr_accessor :orders - - # When present and not empty, pass this string token in the next request to return the next response page. - attr_accessor :next_token - - # Use this date to select orders that were last updated before (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. All dates must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - attr_accessor :last_updated_before - - # Use this date to select orders created before (or at) a specified time. Only orders placed before the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - attr_accessor :created_before - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'orders' => :'Orders', - :'next_token' => :'NextToken', - :'last_updated_before' => :'LastUpdatedBefore', - :'created_before' => :'CreatedBefore' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'orders' => :'Object', - :'next_token' => :'Object', - :'last_updated_before' => :'Object', - :'created_before' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::OrdersList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::OrdersList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'orders') - self.orders = attributes[:'orders'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - - if attributes.key?(:'last_updated_before') - self.last_updated_before = attributes[:'last_updated_before'] - end - - if attributes.key?(:'created_before') - self.created_before = attributes[:'created_before'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @orders.nil? - invalid_properties.push('invalid value for "orders", orders cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @orders.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - orders == o.orders && - next_token == o.next_token && - last_updated_before == o.last_updated_before && - created_before == o.created_before - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [orders, next_token, last_updated_before, created_before].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/other_delivery_attributes.rb b/vendor/orders_v0/lib/sp_orders_v0/models/other_delivery_attributes.rb deleted file mode 100644 index 53bdccb..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/other_delivery_attributes.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class OtherDeliveryAttributes - HAS_ACCESS_POINT = 'HAS_ACCESS_POINT'.freeze - PALLET_ENABLED = 'PALLET_ENABLED'.freeze - PALLET_DISABLED = 'PALLET_DISABLED'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = OtherDeliveryAttributes.constants.select { |c| OtherDeliveryAttributes::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #OtherDeliveryAttributes" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/package_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/package_detail.rb deleted file mode 100644 index 7a873aa..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/package_detail.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Properties of packages - class PackageDetail - attr_accessor :package_reference_id - - # Identifies the carrier that will deliver the package. This field is required for all marketplaces. For more information, refer to the [`CarrierCode` announcement](https://developer-docs.amazon.com/sp-api/changelog/carriercode-value-required-in-shipment-confirmations-for-br-mx-ca-sg-au-in-jp-marketplaces). - attr_accessor :carrier_code - - # Carrier Name that will deliver the package. Required when `carrierCode` is \"Others\" - attr_accessor :carrier_name - - # Ship method to be used for shipping the order. - attr_accessor :shipping_method - - # The tracking number used to obtain tracking and delivery information. - attr_accessor :tracking_number - - # The shipping date for the package. Must be in ISO 8601 date/time format. - attr_accessor :ship_date - - # The unique identifier for the supply source. - attr_accessor :ship_from_supply_source_id - - attr_accessor :order_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'package_reference_id' => :'packageReferenceId', - :'carrier_code' => :'carrierCode', - :'carrier_name' => :'carrierName', - :'shipping_method' => :'shippingMethod', - :'tracking_number' => :'trackingNumber', - :'ship_date' => :'shipDate', - :'ship_from_supply_source_id' => :'shipFromSupplySourceId', - :'order_items' => :'orderItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'package_reference_id' => :'Object', - :'carrier_code' => :'Object', - :'carrier_name' => :'Object', - :'shipping_method' => :'Object', - :'tracking_number' => :'Object', - :'ship_date' => :'Object', - :'ship_from_supply_source_id' => :'Object', - :'order_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PackageDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PackageDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'package_reference_id') - self.package_reference_id = attributes[:'package_reference_id'] - end - - if attributes.key?(:'carrier_code') - self.carrier_code = attributes[:'carrier_code'] - end - - if attributes.key?(:'carrier_name') - self.carrier_name = attributes[:'carrier_name'] - end - - if attributes.key?(:'shipping_method') - self.shipping_method = attributes[:'shipping_method'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'ship_date') - self.ship_date = attributes[:'ship_date'] - end - - if attributes.key?(:'ship_from_supply_source_id') - self.ship_from_supply_source_id = attributes[:'ship_from_supply_source_id'] - end - - if attributes.key?(:'order_items') - self.order_items = attributes[:'order_items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @package_reference_id.nil? - invalid_properties.push('invalid value for "package_reference_id", package_reference_id cannot be nil.') - end - - if @carrier_code.nil? - invalid_properties.push('invalid value for "carrier_code", carrier_code cannot be nil.') - end - - if @tracking_number.nil? - invalid_properties.push('invalid value for "tracking_number", tracking_number cannot be nil.') - end - - if @ship_date.nil? - invalid_properties.push('invalid value for "ship_date", ship_date cannot be nil.') - end - - if @order_items.nil? - invalid_properties.push('invalid value for "order_items", order_items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @package_reference_id.nil? - return false if @carrier_code.nil? - return false if @tracking_number.nil? - return false if @ship_date.nil? - return false if @order_items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - package_reference_id == o.package_reference_id && - carrier_code == o.carrier_code && - carrier_name == o.carrier_name && - shipping_method == o.shipping_method && - tracking_number == o.tracking_number && - ship_date == o.ship_date && - ship_from_supply_source_id == o.ship_from_supply_source_id && - order_items == o.order_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [package_reference_id, carrier_code, carrier_name, shipping_method, tracking_number, ship_date, ship_from_supply_source_id, order_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/package_reference_id.rb b/vendor/orders_v0/lib/sp_orders_v0/models/package_reference_id.rb deleted file mode 100644 index 0436d77..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/package_reference_id.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A seller-supplied identifier that uniquely identifies a package within the scope of an order. Only positive numeric values are supported. - class PackageReferenceId - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PackageReferenceId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PackageReferenceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item.rb b/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item.rb deleted file mode 100644 index 769a9cd..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Information about a sub-payment method used to pay for a COD order. - class PaymentExecutionDetailItem - attr_accessor :payment - - # A sub-payment method for a COD order. **Possible values**: * `COD`: Cash on delivery * `GC`: Gift card * `PointsAccount`: Amazon Points * `Invoice`: Invoice - attr_accessor :payment_method - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment' => :'Payment', - :'payment_method' => :'PaymentMethod' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment' => :'Object', - :'payment_method' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PaymentExecutionDetailItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PaymentExecutionDetailItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment') - self.payment = attributes[:'payment'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment.nil? - invalid_properties.push('invalid value for "payment", payment cannot be nil.') - end - - if @payment_method.nil? - invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment.nil? - return false if @payment_method.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment == o.payment && - payment_method == o.payment_method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment, payment_method].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item_list.rb deleted file mode 100644 index e4160b9..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/payment_execution_detail_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of payment execution detail items. - class PaymentExecutionDetailItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PaymentExecutionDetailItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PaymentExecutionDetailItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/payment_method_detail_item_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/payment_method_detail_item_list.rb deleted file mode 100644 index 789c051..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/payment_method_detail_item_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of payment method detail items. - class PaymentMethodDetailItemList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PaymentMethodDetailItemList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PaymentMethodDetailItemList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/points_granted_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/points_granted_detail.rb deleted file mode 100644 index 4085a43..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/points_granted_detail.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The number of Amazon Points offered with the purchase of an item, and their monetary value. - class PointsGrantedDetail - # The number of Amazon Points granted with the purchase of an item. - attr_accessor :points_number - - attr_accessor :points_monetary_value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'points_number' => :'PointsNumber', - :'points_monetary_value' => :'PointsMonetaryValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'points_number' => :'Object', - :'points_monetary_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PointsGrantedDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PointsGrantedDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'points_number') - self.points_number = attributes[:'points_number'] - end - - if attributes.key?(:'points_monetary_value') - self.points_monetary_value = attributes[:'points_monetary_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - points_number == o.points_number && - points_monetary_value == o.points_monetary_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [points_number, points_monetary_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/preferred_delivery_time.rb b/vendor/orders_v0/lib/sp_orders_v0/models/preferred_delivery_time.rb deleted file mode 100644 index e2ca304..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/preferred_delivery_time.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The time window when the delivery is preferred. - class PreferredDeliveryTime - # Business hours when the business is open for deliveries. - attr_accessor :business_hours - - # Dates when the business is closed during the next 30 days. - attr_accessor :exception_dates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'business_hours' => :'BusinessHours', - :'exception_dates' => :'ExceptionDates' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'business_hours' => :'Object', - :'exception_dates' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PreferredDeliveryTime` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PreferredDeliveryTime`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'business_hours') - if (value = attributes[:'business_hours']).is_a?(Array) - self.business_hours = value - end - end - - if attributes.key?(:'exception_dates') - if (value = attributes[:'exception_dates']).is_a?(Array) - self.exception_dates = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - business_hours == o.business_hours && - exception_dates == o.exception_dates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [business_hours, exception_dates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/prescription_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/prescription_detail.rb deleted file mode 100644 index c7cd5dd..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/prescription_detail.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Information about the prescription that is used to verify a regulated product. This must be provided once per order and reflect the seller’s own records. Only approved orders can have prescriptions. - class PrescriptionDetail - # The identifier for the prescription used to verify the regulated product. - attr_accessor :prescription_id - - # The expiration date of the prescription used to verify the regulated product, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. - attr_accessor :expiration_date - - # The number of units in each fill as provided in the prescription. - attr_accessor :written_quantity - - # The total number of refills written in the original prescription used to verify the regulated product. If a prescription originally had no refills, this value must be 0. - attr_accessor :total_refills_authorized - - # The number of refills remaining for the prescription used to verify the regulated product. If a prescription originally had 10 total refills, this value must be `10` for the first order, `9` for the second order, and `0` for the eleventh order. If a prescription originally had no refills, this value must be 0. - attr_accessor :refills_remaining - - # The identifier for the clinic which provided the prescription used to verify the regulated product. - attr_accessor :clinic_id - - # The instructions for the prescription as provided by the approver of the regulated product. - attr_accessor :usage_instructions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prescription_id' => :'prescriptionId', - :'expiration_date' => :'expirationDate', - :'written_quantity' => :'writtenQuantity', - :'total_refills_authorized' => :'totalRefillsAuthorized', - :'refills_remaining' => :'refillsRemaining', - :'clinic_id' => :'clinicId', - :'usage_instructions' => :'usageInstructions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'prescription_id' => :'Object', - :'expiration_date' => :'Object', - :'written_quantity' => :'Object', - :'total_refills_authorized' => :'Object', - :'refills_remaining' => :'Object', - :'clinic_id' => :'Object', - :'usage_instructions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PrescriptionDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PrescriptionDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prescription_id') - self.prescription_id = attributes[:'prescription_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'written_quantity') - self.written_quantity = attributes[:'written_quantity'] - end - - if attributes.key?(:'total_refills_authorized') - self.total_refills_authorized = attributes[:'total_refills_authorized'] - end - - if attributes.key?(:'refills_remaining') - self.refills_remaining = attributes[:'refills_remaining'] - end - - if attributes.key?(:'clinic_id') - self.clinic_id = attributes[:'clinic_id'] - end - - if attributes.key?(:'usage_instructions') - self.usage_instructions = attributes[:'usage_instructions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @prescription_id.nil? - invalid_properties.push('invalid value for "prescription_id", prescription_id cannot be nil.') - end - - if @expiration_date.nil? - invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.') - end - - if @written_quantity.nil? - invalid_properties.push('invalid value for "written_quantity", written_quantity cannot be nil.') - end - - if @total_refills_authorized.nil? - invalid_properties.push('invalid value for "total_refills_authorized", total_refills_authorized cannot be nil.') - end - - if @refills_remaining.nil? - invalid_properties.push('invalid value for "refills_remaining", refills_remaining cannot be nil.') - end - - if @clinic_id.nil? - invalid_properties.push('invalid value for "clinic_id", clinic_id cannot be nil.') - end - - if @usage_instructions.nil? - invalid_properties.push('invalid value for "usage_instructions", usage_instructions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @prescription_id.nil? - return false if @expiration_date.nil? - return false if @written_quantity.nil? - return false if @total_refills_authorized.nil? - return false if @refills_remaining.nil? - return false if @clinic_id.nil? - return false if @usage_instructions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prescription_id == o.prescription_id && - expiration_date == o.expiration_date && - written_quantity == o.written_quantity && - total_refills_authorized == o.total_refills_authorized && - refills_remaining == o.refills_remaining && - clinic_id == o.clinic_id && - usage_instructions == o.usage_instructions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prescription_id, expiration_date, written_quantity, total_refills_authorized, refills_remaining, clinic_id, usage_instructions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/product_info_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/product_info_detail.rb deleted file mode 100644 index b3870de..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/product_info_detail.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Product information on the number of items. - class ProductInfoDetail - # The total number of items that are included in the ASIN. - attr_accessor :number_of_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number_of_items' => :'NumberOfItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'number_of_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ProductInfoDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ProductInfoDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number_of_items') - self.number_of_items = attributes[:'number_of_items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number_of_items == o.number_of_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number_of_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/promotion_id_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/promotion_id_list.rb deleted file mode 100644 index 0875538..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/promotion_id_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of promotion identifiers provided by the seller when the promotions were created. - class PromotionIdList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::PromotionIdList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::PromotionIdList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information.rb b/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information.rb deleted file mode 100644 index 87b28e5..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The regulated information collected during purchase and used to verify the order. - class RegulatedInformation - # A list of regulated information fields as collected from the regulatory form. - attr_accessor :fields - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fields' => :'Fields' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'fields' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::RegulatedInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::RegulatedInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fields') - if (value = attributes[:'fields']).is_a?(Array) - self.fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @fields.nil? - invalid_properties.push('invalid value for "fields", fields cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @fields.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fields == o.fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information_field.rb b/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information_field.rb deleted file mode 100644 index 6c3fd98..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_information_field.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A field collected from the regulatory form. - class RegulatedInformationField - # The unique identifier of the field. - attr_accessor :field_id - - # The name of the field. - attr_accessor :field_label - - # The type of field. - attr_accessor :field_type - - # The content of the field as collected in regulatory form. Note that `FileAttachment` type fields contain a URL where you can download the attachment. - attr_accessor :field_value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'field_id' => :'FieldId', - :'field_label' => :'FieldLabel', - :'field_type' => :'FieldType', - :'field_value' => :'FieldValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'field_id' => :'Object', - :'field_label' => :'Object', - :'field_type' => :'Object', - :'field_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::RegulatedInformationField` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::RegulatedInformationField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'field_id') - self.field_id = attributes[:'field_id'] - end - - if attributes.key?(:'field_label') - self.field_label = attributes[:'field_label'] - end - - if attributes.key?(:'field_type') - self.field_type = attributes[:'field_type'] - end - - if attributes.key?(:'field_value') - self.field_value = attributes[:'field_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @field_id.nil? - invalid_properties.push('invalid value for "field_id", field_id cannot be nil.') - end - - if @field_label.nil? - invalid_properties.push('invalid value for "field_label", field_label cannot be nil.') - end - - if @field_type.nil? - invalid_properties.push('invalid value for "field_type", field_type cannot be nil.') - end - - if @field_value.nil? - invalid_properties.push('invalid value for "field_value", field_value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @field_id.nil? - return false if @field_label.nil? - return false if @field_type.nil? - field_type_validator = EnumAttributeValidator.new('Object', ['Text', 'FileAttachment']) - return false unless field_type_validator.valid?(@field_type) - return false if @field_value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] field_type Object to be assigned - def field_type=(field_type) - validator = EnumAttributeValidator.new('Object', ['Text', 'FileAttachment']) - unless validator.valid?(field_type) - fail ArgumentError, "invalid value for \"field_type\", must be one of #{validator.allowable_values}." - end - @field_type = field_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - field_id == o.field_id && - field_label == o.field_label && - field_type == o.field_type && - field_value == o.field_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [field_id, field_label, field_type, field_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_order_verification_status.rb b/vendor/orders_v0/lib/sp_orders_v0/models/regulated_order_verification_status.rb deleted file mode 100644 index 84aa49b..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/regulated_order_verification_status.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The verification status of the order, along with associated approval or rejection metadata. - class RegulatedOrderVerificationStatus - attr_accessor :status - - # When true, the regulated information provided in the order requires a review by the merchant. - attr_accessor :requires_merchant_action - - # A list of valid rejection reasons that may be used to reject the order's regulated information. - attr_accessor :valid_rejection_reasons - - attr_accessor :rejection_reason - - # The date the order was reviewed. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. - attr_accessor :review_date - - # The identifier for the order's regulated information reviewer. - attr_accessor :external_reviewer_id - - # A list of valid verification details that may be provided and the criteria required for when the verification detail can be provided. - attr_accessor :valid_verification_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'Status', - :'requires_merchant_action' => :'RequiresMerchantAction', - :'valid_rejection_reasons' => :'ValidRejectionReasons', - :'rejection_reason' => :'RejectionReason', - :'review_date' => :'ReviewDate', - :'external_reviewer_id' => :'ExternalReviewerId', - :'valid_verification_details' => :'ValidVerificationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object', - :'requires_merchant_action' => :'Object', - :'valid_rejection_reasons' => :'Object', - :'rejection_reason' => :'Object', - :'review_date' => :'Object', - :'external_reviewer_id' => :'Object', - :'valid_verification_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::RegulatedOrderVerificationStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::RegulatedOrderVerificationStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'requires_merchant_action') - self.requires_merchant_action = attributes[:'requires_merchant_action'] - end - - if attributes.key?(:'valid_rejection_reasons') - if (value = attributes[:'valid_rejection_reasons']).is_a?(Array) - self.valid_rejection_reasons = value - end - end - - if attributes.key?(:'rejection_reason') - self.rejection_reason = attributes[:'rejection_reason'] - end - - if attributes.key?(:'review_date') - self.review_date = attributes[:'review_date'] - end - - if attributes.key?(:'external_reviewer_id') - self.external_reviewer_id = attributes[:'external_reviewer_id'] - end - - if attributes.key?(:'valid_verification_details') - if (value = attributes[:'valid_verification_details']).is_a?(Array) - self.valid_verification_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @requires_merchant_action.nil? - invalid_properties.push('invalid value for "requires_merchant_action", requires_merchant_action cannot be nil.') - end - - if @valid_rejection_reasons.nil? - invalid_properties.push('invalid value for "valid_rejection_reasons", valid_rejection_reasons cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @requires_merchant_action.nil? - return false if @valid_rejection_reasons.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - requires_merchant_action == o.requires_merchant_action && - valid_rejection_reasons == o.valid_rejection_reasons && - rejection_reason == o.rejection_reason && - review_date == o.review_date && - external_reviewer_id == o.external_reviewer_id && - valid_verification_details == o.valid_verification_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, requires_merchant_action, valid_rejection_reasons, rejection_reason, review_date, external_reviewer_id, valid_verification_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/rejection_reason.rb b/vendor/orders_v0/lib/sp_orders_v0/models/rejection_reason.rb deleted file mode 100644 index cd07280..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/rejection_reason.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The reason for rejecting the order's regulated information. This is only present if the order is rejected. - class RejectionReason - # The unique identifier for the rejection reason. - attr_accessor :rejection_reason_id - - # The description of this rejection reason. - attr_accessor :rejection_reason_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rejection_reason_id' => :'RejectionReasonId', - :'rejection_reason_description' => :'RejectionReasonDescription' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'rejection_reason_id' => :'Object', - :'rejection_reason_description' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::RejectionReason` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::RejectionReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rejection_reason_id') - self.rejection_reason_id = attributes[:'rejection_reason_id'] - end - - if attributes.key?(:'rejection_reason_description') - self.rejection_reason_description = attributes[:'rejection_reason_description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rejection_reason_id.nil? - invalid_properties.push('invalid value for "rejection_reason_id", rejection_reason_id cannot be nil.') - end - - if @rejection_reason_description.nil? - invalid_properties.push('invalid value for "rejection_reason_description", rejection_reason_description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rejection_reason_id.nil? - return false if @rejection_reason_description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rejection_reason_id == o.rejection_reason_id && - rejection_reason_description == o.rejection_reason_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rejection_reason_id, rejection_reason_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/shipment_status.rb b/vendor/orders_v0/lib/sp_orders_v0/models/shipment_status.rb deleted file mode 100644 index 06aedbb..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/shipment_status.rb +++ /dev/null @@ -1,31 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class ShipmentStatus - READY_FOR_PICKUP = 'ReadyForPickup'.freeze - PICKED_UP = 'PickedUp'.freeze - REFUSED_PICKUP = 'RefusedPickup'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = ShipmentStatus.constants.select { |c| ShipmentStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #ShipmentStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/shipping_constraints.rb b/vendor/orders_v0/lib/sp_orders_v0/models/shipping_constraints.rb deleted file mode 100644 index ddb5ce8..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/shipping_constraints.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Delivery constraints applicable to this order. - class ShippingConstraints - attr_accessor :pallet_delivery - - attr_accessor :signature_confirmation - - attr_accessor :recipient_identity_verification - - attr_accessor :recipient_age_verification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pallet_delivery' => :'PalletDelivery', - :'signature_confirmation' => :'SignatureConfirmation', - :'recipient_identity_verification' => :'RecipientIdentityVerification', - :'recipient_age_verification' => :'RecipientAgeVerification' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pallet_delivery' => :'Object', - :'signature_confirmation' => :'Object', - :'recipient_identity_verification' => :'Object', - :'recipient_age_verification' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ShippingConstraints` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ShippingConstraints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pallet_delivery') - self.pallet_delivery = attributes[:'pallet_delivery'] - end - - if attributes.key?(:'signature_confirmation') - self.signature_confirmation = attributes[:'signature_confirmation'] - end - - if attributes.key?(:'recipient_identity_verification') - self.recipient_identity_verification = attributes[:'recipient_identity_verification'] - end - - if attributes.key?(:'recipient_age_verification') - self.recipient_age_verification = attributes[:'recipient_age_verification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pallet_delivery == o.pallet_delivery && - signature_confirmation == o.signature_confirmation && - recipient_identity_verification == o.recipient_identity_verification && - recipient_age_verification == o.recipient_age_verification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pallet_delivery, signature_confirmation, recipient_identity_verification, recipient_age_verification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option.rb b/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option.rb deleted file mode 100644 index 6eafd43..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Substitution options for an order item. - class SubstitutionOption - # The item's Amazon Standard Identification Number (ASIN). - attr_accessor :asin - - # The number of items to be picked for this substitution option. - attr_accessor :quantity_ordered - - # The item's seller stock keeping unit (SKU). - attr_accessor :seller_sku - - # The item's title. - attr_accessor :title - - attr_accessor :measurement - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asin' => :'ASIN', - :'quantity_ordered' => :'QuantityOrdered', - :'seller_sku' => :'SellerSKU', - :'title' => :'Title', - :'measurement' => :'Measurement' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asin' => :'Object', - :'quantity_ordered' => :'Object', - :'seller_sku' => :'Object', - :'title' => :'Object', - :'measurement' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::SubstitutionOption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::SubstitutionOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asin') - self.asin = attributes[:'asin'] - end - - if attributes.key?(:'quantity_ordered') - self.quantity_ordered = attributes[:'quantity_ordered'] - end - - if attributes.key?(:'seller_sku') - self.seller_sku = attributes[:'seller_sku'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'measurement') - self.measurement = attributes[:'measurement'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asin == o.asin && - quantity_ordered == o.quantity_ordered && - seller_sku == o.seller_sku && - title == o.title && - measurement == o.measurement - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asin, quantity_ordered, seller_sku, title, measurement].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option_list.rb deleted file mode 100644 index 27026a4..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_option_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A collection of substitution options. - class SubstitutionOptionList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::SubstitutionOptionList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::SubstitutionOptionList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_preferences.rb b/vendor/orders_v0/lib/sp_orders_v0/models/substitution_preferences.rb deleted file mode 100644 index 1b29796..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/substitution_preferences.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Substitution preferences for an order item. - class SubstitutionPreferences - # The type of substitution that these preferences represent. - attr_accessor :substitution_type - - attr_accessor :substitution_options - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'substitution_type' => :'SubstitutionType', - :'substitution_options' => :'SubstitutionOptions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'substitution_type' => :'Object', - :'substitution_options' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::SubstitutionPreferences` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::SubstitutionPreferences`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'substitution_type') - self.substitution_type = attributes[:'substitution_type'] - end - - if attributes.key?(:'substitution_options') - self.substitution_options = attributes[:'substitution_options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @substitution_type.nil? - invalid_properties.push('invalid value for "substitution_type", substitution_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @substitution_type.nil? - substitution_type_validator = EnumAttributeValidator.new('Object', ['CUSTOMER_PREFERENCE', 'AMAZON_RECOMMENDED', 'DO_NOT_SUBSTITUTE']) - return false unless substitution_type_validator.valid?(@substitution_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] substitution_type Object to be assigned - def substitution_type=(substitution_type) - validator = EnumAttributeValidator.new('Object', ['CUSTOMER_PREFERENCE', 'AMAZON_RECOMMENDED', 'DO_NOT_SUBSTITUTE']) - unless validator.valid?(substitution_type) - fail ArgumentError, "invalid value for \"substitution_type\", must be one of #{validator.allowable_values}." - end - @substitution_type = substitution_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - substitution_type == o.substitution_type && - substitution_options == o.substitution_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [substitution_type, substitution_options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/tax_classification.rb b/vendor/orders_v0/lib/sp_orders_v0/models/tax_classification.rb deleted file mode 100644 index b4f765d..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/tax_classification.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The tax classification of the order. - class TaxClassification - # The type of tax. - attr_accessor :name - - # The buyer's tax identifier. - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::TaxClassification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::TaxClassification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/tax_collection.rb b/vendor/orders_v0/lib/sp_orders_v0/models/tax_collection.rb deleted file mode 100644 index a9acfb9..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/tax_collection.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Information about withheld taxes. - class TaxCollection - # The tax collection model applied to the item. - attr_accessor :model - - # The party responsible for withholding the taxes and remitting them to the taxing authority. - attr_accessor :responsible_party - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'model' => :'Model', - :'responsible_party' => :'ResponsibleParty' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'model' => :'Object', - :'responsible_party' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::TaxCollection` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::TaxCollection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'model') - self.model = attributes[:'model'] - end - - if attributes.key?(:'responsible_party') - self.responsible_party = attributes[:'responsible_party'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - model_validator = EnumAttributeValidator.new('Object', ['MarketplaceFacilitator']) - return false unless model_validator.valid?(@model) - responsible_party_validator = EnumAttributeValidator.new('Object', ['Amazon Services, Inc.']) - return false unless responsible_party_validator.valid?(@responsible_party) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] model Object to be assigned - def model=(model) - validator = EnumAttributeValidator.new('Object', ['MarketplaceFacilitator']) - unless validator.valid?(model) - fail ArgumentError, "invalid value for \"model\", must be one of #{validator.allowable_values}." - end - @model = model - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] responsible_party Object to be assigned - def responsible_party=(responsible_party) - validator = EnumAttributeValidator.new('Object', ['Amazon Services, Inc.']) - unless validator.valid?(responsible_party) - fail ArgumentError, "invalid value for \"responsible_party\", must be one of #{validator.allowable_values}." - end - @responsible_party = responsible_party - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - model == o.model && - responsible_party == o.responsible_party - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [model, responsible_party].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code.rb b/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code.rb deleted file mode 100644 index fb05226..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The transparency code associated with the item. - class TransparencyCode - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::TransparencyCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::TransparencyCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code_list.rb b/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code_list.rb deleted file mode 100644 index dcaaaf3..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/transparency_code_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # A list of order items. - class TransparencyCodeList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::TransparencyCodeList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::TransparencyCodeList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_error_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_error_response.rb deleted file mode 100644 index a246ece..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_error_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The error response schema for the `UpdateShipmentStatus` operation. - class UpdateShipmentStatusErrorResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::UpdateShipmentStatusErrorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::UpdateShipmentStatusErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_request.rb b/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_request.rb deleted file mode 100644 index 922b064..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/update_shipment_status_request.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The request body for the `updateShipmentStatus` operation. - class UpdateShipmentStatusRequest - attr_accessor :marketplace_id - - attr_accessor :shipment_status - - attr_accessor :order_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_id' => :'marketplaceId', - :'shipment_status' => :'shipmentStatus', - :'order_items' => :'orderItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_id' => :'Object', - :'shipment_status' => :'Object', - :'order_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::UpdateShipmentStatusRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::UpdateShipmentStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_id') - self.marketplace_id = attributes[:'marketplace_id'] - end - - if attributes.key?(:'shipment_status') - self.shipment_status = attributes[:'shipment_status'] - end - - if attributes.key?(:'order_items') - self.order_items = attributes[:'order_items'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @marketplace_id.nil? - invalid_properties.push('invalid value for "marketplace_id", marketplace_id cannot be nil.') - end - - if @shipment_status.nil? - invalid_properties.push('invalid value for "shipment_status", shipment_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @marketplace_id.nil? - return false if @shipment_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_id == o.marketplace_id && - shipment_status == o.shipment_status && - order_items == o.order_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_id, shipment_status, order_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_error_response.rb b/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_error_response.rb deleted file mode 100644 index c56abd0..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_error_response.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The error response schema for the `UpdateVerificationStatus` operation. - class UpdateVerificationStatusErrorResponse - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusErrorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request.rb b/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request.rb deleted file mode 100644 index aa31c1c..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The request body for the `updateVerificationStatus` operation. - class UpdateVerificationStatusRequest - attr_accessor :regulated_order_verification_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'regulated_order_verification_status' => :'regulatedOrderVerificationStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'regulated_order_verification_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'regulated_order_verification_status') - self.regulated_order_verification_status = attributes[:'regulated_order_verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @regulated_order_verification_status.nil? - invalid_properties.push('invalid value for "regulated_order_verification_status", regulated_order_verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @regulated_order_verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - regulated_order_verification_status == o.regulated_order_verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [regulated_order_verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request_body.rb b/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request_body.rb deleted file mode 100644 index d8f0027..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/update_verification_status_request_body.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The updated values of the `VerificationStatus` field. - class UpdateVerificationStatusRequestBody - attr_accessor :status - - # The identifier of the order's regulated information reviewer. - attr_accessor :external_reviewer_id - - # The unique identifier of the rejection reason used for rejecting the order's regulated information. Only required if the new status is rejected. - attr_accessor :rejection_reason_id - - attr_accessor :verification_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'external_reviewer_id' => :'externalReviewerId', - :'rejection_reason_id' => :'rejectionReasonId', - :'verification_details' => :'verificationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Object', - :'external_reviewer_id' => :'Object', - :'rejection_reason_id' => :'Object', - :'verification_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusRequestBody` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::UpdateVerificationStatusRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'external_reviewer_id') - self.external_reviewer_id = attributes[:'external_reviewer_id'] - end - - if attributes.key?(:'rejection_reason_id') - self.rejection_reason_id = attributes[:'rejection_reason_id'] - end - - if attributes.key?(:'verification_details') - self.verification_details = attributes[:'verification_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @external_reviewer_id.nil? - invalid_properties.push('invalid value for "external_reviewer_id", external_reviewer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @external_reviewer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - external_reviewer_id == o.external_reviewer_id && - rejection_reason_id == o.rejection_reason_id && - verification_details == o.verification_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, external_reviewer_id, rejection_reason_id, verification_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/valid_verification_detail.rb b/vendor/orders_v0/lib/sp_orders_v0/models/valid_verification_detail.rb deleted file mode 100644 index 6e28a76..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/valid_verification_detail.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # The types of verification details that may be provided for the order and the criteria required for when the type of verification detail can be provided. The types of verification details allowed depend on the type of regulated product and will not change order to order. - class ValidVerificationDetail - # A supported type of verification detail. The type indicates which verification detail could be shared while updating the regulated order. Valid value: `prescriptionDetail`. - attr_accessor :verification_detail_type - - # A list of valid verification statuses where the associated verification detail type may be provided. For example, if the value of this field is [\"Approved\"], calls to provide the associated verification detail will fail for orders with a `VerificationStatus` of `Pending`, `Rejected`, `Expired`, or `Cancelled`. - attr_accessor :valid_verification_statuses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verification_detail_type' => :'VerificationDetailType', - :'valid_verification_statuses' => :'ValidVerificationStatuses' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'verification_detail_type' => :'Object', - :'valid_verification_statuses' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::ValidVerificationDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::ValidVerificationDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verification_detail_type') - self.verification_detail_type = attributes[:'verification_detail_type'] - end - - if attributes.key?(:'valid_verification_statuses') - if (value = attributes[:'valid_verification_statuses']).is_a?(Array) - self.valid_verification_statuses = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @verification_detail_type.nil? - invalid_properties.push('invalid value for "verification_detail_type", verification_detail_type cannot be nil.') - end - - if @valid_verification_statuses.nil? - invalid_properties.push('invalid value for "valid_verification_statuses", valid_verification_statuses cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @verification_detail_type.nil? - return false if @valid_verification_statuses.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verification_detail_type == o.verification_detail_type && - valid_verification_statuses == o.valid_verification_statuses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verification_detail_type, valid_verification_statuses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/verification_details.rb b/vendor/orders_v0/lib/sp_orders_v0/models/verification_details.rb deleted file mode 100644 index 2c91153..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/verification_details.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - # Additional information related to the verification of a regulated order. - class VerificationDetails - attr_accessor :prescription_detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prescription_detail' => :'prescriptionDetail' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'prescription_detail' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpOrdersV0::VerificationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpOrdersV0::VerificationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prescription_detail') - self.prescription_detail = attributes[:'prescription_detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prescription_detail == o.prescription_detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prescription_detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpOrdersV0.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/models/verification_status.rb b/vendor/orders_v0/lib/sp_orders_v0/models/verification_status.rb deleted file mode 100644 index fd15364..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/models/verification_status.rb +++ /dev/null @@ -1,33 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpOrdersV0 - class VerificationStatus - PENDING = 'Pending'.freeze - APPROVED = 'Approved'.freeze - REJECTED = 'Rejected'.freeze - EXPIRED = 'Expired'.freeze - CANCELLED = 'Cancelled'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = VerificationStatus.constants.select { |c| VerificationStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #VerificationStatus" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/orders_v0/lib/sp_orders_v0/version.rb b/vendor/orders_v0/lib/sp_orders_v0/version.rb deleted file mode 100644 index fece5a2..0000000 --- a/vendor/orders_v0/lib/sp_orders_v0/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpOrdersV0 - VERSION = '1.0.0' -end diff --git a/vendor/orders_v0/sp_orders_v0.gemspec b/vendor/orders_v0/sp_orders_v0.gemspec deleted file mode 100644 index 89a1382..0000000 --- a/vendor/orders_v0/sp_orders_v0.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Orders - -#Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). - -OpenAPI spec version: v0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_orders_v0/version" - -Gem::Specification.new do |s| - s.name = "sp_orders_v0" - s.version = SpOrdersV0::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Orders Ruby Gem" - s.description = "Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response)." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/reports_2021/.gitignore b/vendor/reports_2021/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/reports_2021/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/reports_2021/.rspec b/vendor/reports_2021/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/reports_2021/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/reports_2021/.rubocop.yml b/vendor/reports_2021/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/reports_2021/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/reports_2021/.swagger-codegen-ignore b/vendor/reports_2021/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/reports_2021/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/reports_2021/.swagger-codegen/VERSION b/vendor/reports_2021/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/reports_2021/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/reports_2021/Gemfile b/vendor/reports_2021/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/reports_2021/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/reports_2021/README.md b/vendor/reports_2021/README.md deleted file mode 100644 index 68321b9..0000000 --- a/vendor/reports_2021/README.md +++ /dev/null @@ -1,198 +0,0 @@ -# sp_reports_2021 - -SpReports2021 - the Ruby gem for the Selling Partner API for Reports - -The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2021-06-30 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_reports_2021.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_reports_2021-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_reports_2021-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_reports_2021', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_reports_2021', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_reports_2021' - -api_instance = SpReports2021::ReportsApi.new -report_id = 'report_id_example' # String | The identifier for the report. This identifier is unique only in combination with a seller ID. - - -begin - api_instance.cancel_report(report_id) -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->cancel_report: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -report_schedule_id = 'report_schedule_id_example' # String | The identifier for the report schedule. This identifier is unique only in combination with a seller ID. - - -begin - api_instance.cancel_report_schedule(report_schedule_id) -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->cancel_report_schedule: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -body = SpReports2021::CreateReportSpecification.new # CreateReportSpecification | Information required to create the report. - - -begin - result = api_instance.create_report(body) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->create_report: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -body = SpReports2021::CreateReportScheduleSpecification.new # CreateReportScheduleSpecification | Information required to create the report schedule. - - -begin - result = api_instance.create_report_schedule(body) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->create_report_schedule: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -report_id = 'report_id_example' # String | The identifier for the report. This identifier is unique only in combination with a seller ID. - - -begin - result = api_instance.get_report(report_id) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->get_report: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -report_document_id = 'report_document_id_example' # String | The identifier for the report document. - - -begin - result = api_instance.get_report_document(report_document_id) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->get_report_document: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -report_schedule_id = 'report_schedule_id_example' # String | The identifier for the report schedule. This identifier is unique only in combination with a seller ID. - - -begin - result = api_instance.get_report_schedule(report_schedule_id) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->get_report_schedule: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -report_types = ['report_types_example'] # Array | A list of report types used to filter report schedules. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. - - -begin - result = api_instance.get_report_schedules(report_types) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->get_report_schedules: #{e}" -end - -api_instance = SpReports2021::ReportsApi.new -opts = { - report_types: ['report_types_example'], # Array | A list of report types used to filter reports. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required. - processing_statuses: ['processing_statuses_example'], # Array | A list of processing statuses used to filter reports. - marketplace_ids: ['marketplace_ids_example'], # Array | A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. - page_size: 10, # Integer | The maximum number of reports to return in a single call. - created_since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days. - created_until: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. - next_token: 'next_token_example' # String | A string token returned in the response to your previous request. `nextToken` is returned when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the `getReports` operation and include this token as the only parameter. Specifying `nextToken` with any other parameters will cause the request to fail. -} - -begin - result = api_instance.get_reports(opts) - p result -rescue SpReports2021::ApiError => e - puts "Exception when calling ReportsApi->get_reports: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpReports2021::ReportsApi* | [**cancel_report**](docs/ReportsApi.md#cancel_report) | **DELETE** /reports/2021-06-30/reports/{reportId} | -*SpReports2021::ReportsApi* | [**cancel_report_schedule**](docs/ReportsApi.md#cancel_report_schedule) | **DELETE** /reports/2021-06-30/schedules/{reportScheduleId} | -*SpReports2021::ReportsApi* | [**create_report**](docs/ReportsApi.md#create_report) | **POST** /reports/2021-06-30/reports | -*SpReports2021::ReportsApi* | [**create_report_schedule**](docs/ReportsApi.md#create_report_schedule) | **POST** /reports/2021-06-30/schedules | -*SpReports2021::ReportsApi* | [**get_report**](docs/ReportsApi.md#get_report) | **GET** /reports/2021-06-30/reports/{reportId} | -*SpReports2021::ReportsApi* | [**get_report_document**](docs/ReportsApi.md#get_report_document) | **GET** /reports/2021-06-30/documents/{reportDocumentId} | -*SpReports2021::ReportsApi* | [**get_report_schedule**](docs/ReportsApi.md#get_report_schedule) | **GET** /reports/2021-06-30/schedules/{reportScheduleId} | -*SpReports2021::ReportsApi* | [**get_report_schedules**](docs/ReportsApi.md#get_report_schedules) | **GET** /reports/2021-06-30/schedules | -*SpReports2021::ReportsApi* | [**get_reports**](docs/ReportsApi.md#get_reports) | **GET** /reports/2021-06-30/reports | - -## Documentation for Models - - - [SpReports2021::CreateReportResponse](docs/CreateReportResponse.md) - - [SpReports2021::CreateReportScheduleResponse](docs/CreateReportScheduleResponse.md) - - [SpReports2021::CreateReportScheduleSpecification](docs/CreateReportScheduleSpecification.md) - - [SpReports2021::CreateReportSpecification](docs/CreateReportSpecification.md) - - [SpReports2021::Error](docs/Error.md) - - [SpReports2021::ErrorList](docs/ErrorList.md) - - [SpReports2021::GetReportsResponse](docs/GetReportsResponse.md) - - [SpReports2021::Report](docs/Report.md) - - [SpReports2021::ReportDocument](docs/ReportDocument.md) - - [SpReports2021::ReportList](docs/ReportList.md) - - [SpReports2021::ReportOptions](docs/ReportOptions.md) - - [SpReports2021::ReportSchedule](docs/ReportSchedule.md) - - [SpReports2021::ReportScheduleList](docs/ReportScheduleList.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/reports_2021/Rakefile b/vendor/reports_2021/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/reports_2021/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/reports_2021/git_push.sh b/vendor/reports_2021/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/reports_2021/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/reports_2021/lib/sp_reports_2021/api_client.rb b/vendor/reports_2021/lib/sp_reports_2021/api_client.rb deleted file mode 100644 index 690b0cc..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpReports2021 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpReports2021.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/api_error.rb b/vendor/reports_2021/lib/sp_reports_2021/api_error.rb deleted file mode 100644 index 23fa1d1..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpReports2021 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/configuration.rb b/vendor/reports_2021/lib/sp_reports_2021/configuration.rb deleted file mode 100644 index 89e6167..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpReports2021 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_response.rb b/vendor/reports_2021/lib/sp_reports_2021/models/create_report_response.rb deleted file mode 100644 index 1463a92..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_response.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # The response schema. - class CreateReportResponse - # The identifier for the report. This identifier is unique only in combination with a seller ID. - attr_accessor :report_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'reportId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::CreateReportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::CreateReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_id.nil? - invalid_properties.push('invalid value for "report_id", report_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_response.rb b/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_response.rb deleted file mode 100644 index b944c0a..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_response.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Response schema. - class CreateReportScheduleResponse - # The identifier for the report schedule. This identifier is unique only in combination with a seller ID. - attr_accessor :report_schedule_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_schedule_id' => :'reportScheduleId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_schedule_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::CreateReportScheduleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::CreateReportScheduleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_schedule_id') - self.report_schedule_id = attributes[:'report_schedule_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_schedule_id.nil? - invalid_properties.push('invalid value for "report_schedule_id", report_schedule_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_schedule_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_schedule_id == o.report_schedule_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_schedule_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_specification.rb b/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_specification.rb deleted file mode 100644 index 6468d31..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_schedule_specification.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Information required to create the report schedule. - class CreateReportScheduleSpecification - # The report type. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. - attr_accessor :report_type - - # A list of marketplace identifiers for the report schedule. - attr_accessor :marketplace_ids - - attr_accessor :report_options - - # One of a set of predefined ISO 8601 periods that specifies how often a report should be created. - attr_accessor :period - - # The date and time when the schedule will create its next report, in ISO 8601 date time format. - attr_accessor :next_report_creation_time - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_type' => :'reportType', - :'marketplace_ids' => :'marketplaceIds', - :'report_options' => :'reportOptions', - :'period' => :'period', - :'next_report_creation_time' => :'nextReportCreationTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_type' => :'Object', - :'marketplace_ids' => :'Object', - :'report_options' => :'Object', - :'period' => :'Object', - :'next_report_creation_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::CreateReportScheduleSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::CreateReportScheduleSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - - if attributes.key?(:'report_options') - self.report_options = attributes[:'report_options'] - end - - if attributes.key?(:'period') - self.period = attributes[:'period'] - end - - if attributes.key?(:'next_report_creation_time') - self.next_report_creation_time = attributes[:'next_report_creation_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - if @marketplace_ids.nil? - invalid_properties.push('invalid value for "marketplace_ids", marketplace_ids cannot be nil.') - end - - if @period.nil? - invalid_properties.push('invalid value for "period", period cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_type.nil? - return false if @marketplace_ids.nil? - return false if @period.nil? - period_validator = EnumAttributeValidator.new('Object', ['PT5M', 'PT15M', 'PT30M', 'PT1H', 'PT2H', 'PT4H', 'PT8H', 'PT12H', 'P1D', 'P2D', 'P3D', 'PT84H', 'P7D', 'P14D', 'P15D', 'P18D', 'P30D', 'P1M']) - return false unless period_validator.valid?(@period) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] period Object to be assigned - def period=(period) - validator = EnumAttributeValidator.new('Object', ['PT5M', 'PT15M', 'PT30M', 'PT1H', 'PT2H', 'PT4H', 'PT8H', 'PT12H', 'P1D', 'P2D', 'P3D', 'PT84H', 'P7D', 'P14D', 'P15D', 'P18D', 'P30D', 'P1M']) - unless validator.valid?(period) - fail ArgumentError, "invalid value for \"period\", must be one of #{validator.allowable_values}." - end - @period = period - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_type == o.report_type && - marketplace_ids == o.marketplace_ids && - report_options == o.report_options && - period == o.period && - next_report_creation_time == o.next_report_creation_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_type, marketplace_ids, report_options, period, next_report_creation_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_specification.rb b/vendor/reports_2021/lib/sp_reports_2021/models/create_report_specification.rb deleted file mode 100644 index d510db9..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/create_report_specification.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Information required to create the report. - class CreateReportSpecification - attr_accessor :report_options - - # The report type. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. - attr_accessor :report_type - - # The start of a date and time range, in ISO 8601 date time format, used for selecting the data to report. The default is now. The value must be prior to or equal to the current date and time. Not all report types make use of this. - attr_accessor :data_start_time - - # The end of a date and time range, in ISO 8601 date time format, used for selecting the data to report. The default is now. The value must be prior to or equal to the current date and time. Not all report types make use of this. - attr_accessor :data_end_time - - # A list of marketplace identifiers. The report document's contents will contain data for all of the specified marketplaces, unless the report type indicates otherwise. - attr_accessor :marketplace_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_options' => :'reportOptions', - :'report_type' => :'reportType', - :'data_start_time' => :'dataStartTime', - :'data_end_time' => :'dataEndTime', - :'marketplace_ids' => :'marketplaceIds' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_options' => :'Object', - :'report_type' => :'Object', - :'data_start_time' => :'Object', - :'data_end_time' => :'Object', - :'marketplace_ids' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::CreateReportSpecification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::CreateReportSpecification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_options') - self.report_options = attributes[:'report_options'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'data_start_time') - self.data_start_time = attributes[:'data_start_time'] - end - - if attributes.key?(:'data_end_time') - self.data_end_time = attributes[:'data_end_time'] - end - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - if @marketplace_ids.nil? - invalid_properties.push('invalid value for "marketplace_ids", marketplace_ids cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_type.nil? - return false if @marketplace_ids.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_options == o.report_options && - report_type == o.report_type && - data_start_time == o.data_start_time && - data_end_time == o.data_end_time && - marketplace_ids == o.marketplace_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_options, report_type, data_start_time, data_end_time, marketplace_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/error.rb b/vendor/reports_2021/lib/sp_reports_2021/models/error.rb deleted file mode 100644 index 5c0d4d4..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/error_list.rb b/vendor/reports_2021/lib/sp_reports_2021/models/error_list.rb deleted file mode 100644 index ce79863..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/error_list.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Error response returned when the request is unsuccessful. - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @errors.nil? - invalid_properties.push('invalid value for "errors", errors cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @errors.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/get_reports_response.rb b/vendor/reports_2021/lib/sp_reports_2021/models/get_reports_response.rb deleted file mode 100644 index 4fbf1d9..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/get_reports_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # The response for the `getReports` operation. - class GetReportsResponse - attr_accessor :reports - - # Returned when the number of results exceeds `pageSize`. To get the next page of results, call `getReports` with this token as the only parameter. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reports' => :'reports', - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reports' => :'Object', - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::GetReportsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::GetReportsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reports') - self.reports = attributes[:'reports'] - end - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reports.nil? - invalid_properties.push('invalid value for "reports", reports cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reports.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reports == o.reports && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reports, next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report.rb deleted file mode 100644 index 0096584..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report.rb +++ /dev/null @@ -1,368 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Detailed information about the report. - class Report - # A list of marketplace identifiers for the report. - attr_accessor :marketplace_ids - - # The identifier for the report. This identifier is unique only in combination with a seller ID. - attr_accessor :report_id - - # The report type. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. - attr_accessor :report_type - - # The start of a date and time range used for selecting the data to report. - attr_accessor :data_start_time - - # The end of a date and time range used for selecting the data to report. - attr_accessor :data_end_time - - # The identifier of the report schedule that created this report (if any). This identifier is unique only in combination with a seller ID. - attr_accessor :report_schedule_id - - # The date and time when the report was created. - attr_accessor :created_time - - # The processing status of the report. - attr_accessor :processing_status - - # The date and time when the report processing started, in ISO 8601 date time format. - attr_accessor :processing_start_time - - # The date and time when the report processing completed, in ISO 8601 date time format. - attr_accessor :processing_end_time - - # The identifier for the report document. Pass this into the `getReportDocument` operation to get the information you will need to retrieve the report document's contents. - attr_accessor :report_document_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'marketplace_ids' => :'marketplaceIds', - :'report_id' => :'reportId', - :'report_type' => :'reportType', - :'data_start_time' => :'dataStartTime', - :'data_end_time' => :'dataEndTime', - :'report_schedule_id' => :'reportScheduleId', - :'created_time' => :'createdTime', - :'processing_status' => :'processingStatus', - :'processing_start_time' => :'processingStartTime', - :'processing_end_time' => :'processingEndTime', - :'report_document_id' => :'reportDocumentId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'marketplace_ids' => :'Object', - :'report_id' => :'Object', - :'report_type' => :'Object', - :'data_start_time' => :'Object', - :'data_end_time' => :'Object', - :'report_schedule_id' => :'Object', - :'created_time' => :'Object', - :'processing_status' => :'Object', - :'processing_start_time' => :'Object', - :'processing_end_time' => :'Object', - :'report_document_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::Report` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::Report`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'data_start_time') - self.data_start_time = attributes[:'data_start_time'] - end - - if attributes.key?(:'data_end_time') - self.data_end_time = attributes[:'data_end_time'] - end - - if attributes.key?(:'report_schedule_id') - self.report_schedule_id = attributes[:'report_schedule_id'] - end - - if attributes.key?(:'created_time') - self.created_time = attributes[:'created_time'] - end - - if attributes.key?(:'processing_status') - self.processing_status = attributes[:'processing_status'] - end - - if attributes.key?(:'processing_start_time') - self.processing_start_time = attributes[:'processing_start_time'] - end - - if attributes.key?(:'processing_end_time') - self.processing_end_time = attributes[:'processing_end_time'] - end - - if attributes.key?(:'report_document_id') - self.report_document_id = attributes[:'report_document_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_id.nil? - invalid_properties.push('invalid value for "report_id", report_id cannot be nil.') - end - - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - if @created_time.nil? - invalid_properties.push('invalid value for "created_time", created_time cannot be nil.') - end - - if @processing_status.nil? - invalid_properties.push('invalid value for "processing_status", processing_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_id.nil? - return false if @report_type.nil? - return false if @created_time.nil? - return false if @processing_status.nil? - processing_status_validator = EnumAttributeValidator.new('Object', ['CANCELLED', 'DONE', 'FATAL', 'IN_PROGRESS', 'IN_QUEUE']) - return false unless processing_status_validator.valid?(@processing_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] processing_status Object to be assigned - def processing_status=(processing_status) - validator = EnumAttributeValidator.new('Object', ['CANCELLED', 'DONE', 'FATAL', 'IN_PROGRESS', 'IN_QUEUE']) - unless validator.valid?(processing_status) - fail ArgumentError, "invalid value for \"processing_status\", must be one of #{validator.allowable_values}." - end - @processing_status = processing_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - marketplace_ids == o.marketplace_ids && - report_id == o.report_id && - report_type == o.report_type && - data_start_time == o.data_start_time && - data_end_time == o.data_end_time && - report_schedule_id == o.report_schedule_id && - created_time == o.created_time && - processing_status == o.processing_status && - processing_start_time == o.processing_start_time && - processing_end_time == o.processing_end_time && - report_document_id == o.report_document_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [marketplace_ids, report_id, report_type, data_start_time, data_end_time, report_schedule_id, created_time, processing_status, processing_start_time, processing_end_time, report_document_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report_document.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report_document.rb deleted file mode 100644 index b830839..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report_document.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Information required for the report document. - class ReportDocument - # The identifier for the report document. This identifier is unique only in combination with a seller ID. - attr_accessor :report_document_id - - # A presigned URL for the report document. If `compressionAlgorithm` is not returned, you can download the report directly from this URL. This URL expires after 5 minutes. - attr_accessor :url - - # If the report document contents have been compressed, the compression algorithm used is returned in this property and you must decompress the report when you download. Otherwise, you can download the report directly. Refer to [Step 2. Download the report](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-retrieve-a-report#step-2-download-the-report) in the use case guide, where sample code is provided. - attr_accessor :compression_algorithm - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_document_id' => :'reportDocumentId', - :'url' => :'url', - :'compression_algorithm' => :'compressionAlgorithm' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_document_id' => :'Object', - :'url' => :'Object', - :'compression_algorithm' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ReportDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ReportDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_document_id') - self.report_document_id = attributes[:'report_document_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'compression_algorithm') - self.compression_algorithm = attributes[:'compression_algorithm'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_document_id.nil? - invalid_properties.push('invalid value for "report_document_id", report_document_id cannot be nil.') - end - - if @url.nil? - invalid_properties.push('invalid value for "url", url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_document_id.nil? - return false if @url.nil? - compression_algorithm_validator = EnumAttributeValidator.new('Object', ['GZIP']) - return false unless compression_algorithm_validator.valid?(@compression_algorithm) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] compression_algorithm Object to be assigned - def compression_algorithm=(compression_algorithm) - validator = EnumAttributeValidator.new('Object', ['GZIP']) - unless validator.valid?(compression_algorithm) - fail ArgumentError, "invalid value for \"compression_algorithm\", must be one of #{validator.allowable_values}." - end - @compression_algorithm = compression_algorithm - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_document_id == o.report_document_id && - url == o.url && - compression_algorithm == o.compression_algorithm - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_document_id, url, compression_algorithm].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report_list.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report_list.rb deleted file mode 100644 index 55029a2..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # A list of reports. - class ReportList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ReportList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ReportList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report_options.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report_options.rb deleted file mode 100644 index 7cdc13c..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report_options.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Additional information passed to reports. This varies by report type. - class ReportOptions - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ReportOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ReportOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule.rb deleted file mode 100644 index 8185b98..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # Detailed information about a report schedule. - class ReportSchedule - # The identifier for the report schedule. This identifier is unique only in combination with a seller ID. - attr_accessor :report_schedule_id - - # The report type. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. - attr_accessor :report_type - - # A list of marketplace identifiers. The report document's contents will contain data for all of the specified marketplaces, unless the report type indicates otherwise. - attr_accessor :marketplace_ids - - attr_accessor :report_options - - # An ISO 8601 period value that indicates how often a report should be created. - attr_accessor :period - - # The date and time when the schedule will create its next report, in ISO 8601 date time format. - attr_accessor :next_report_creation_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_schedule_id' => :'reportScheduleId', - :'report_type' => :'reportType', - :'marketplace_ids' => :'marketplaceIds', - :'report_options' => :'reportOptions', - :'period' => :'period', - :'next_report_creation_time' => :'nextReportCreationTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_schedule_id' => :'Object', - :'report_type' => :'Object', - :'marketplace_ids' => :'Object', - :'report_options' => :'Object', - :'period' => :'Object', - :'next_report_creation_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ReportSchedule` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ReportSchedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_schedule_id') - self.report_schedule_id = attributes[:'report_schedule_id'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'marketplace_ids') - if (value = attributes[:'marketplace_ids']).is_a?(Array) - self.marketplace_ids = value - end - end - - if attributes.key?(:'report_options') - self.report_options = attributes[:'report_options'] - end - - if attributes.key?(:'period') - self.period = attributes[:'period'] - end - - if attributes.key?(:'next_report_creation_time') - self.next_report_creation_time = attributes[:'next_report_creation_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_schedule_id.nil? - invalid_properties.push('invalid value for "report_schedule_id", report_schedule_id cannot be nil.') - end - - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - if @period.nil? - invalid_properties.push('invalid value for "period", period cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_schedule_id.nil? - return false if @report_type.nil? - return false if @period.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_schedule_id == o.report_schedule_id && - report_type == o.report_type && - marketplace_ids == o.marketplace_ids && - report_options == o.report_options && - period == o.period && - next_report_creation_time == o.next_report_creation_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_schedule_id, report_type, marketplace_ids, report_options, period, next_report_creation_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule_list.rb b/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule_list.rb deleted file mode 100644 index abd9520..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/models/report_schedule_list.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpReports2021 - # A list of report schedules. - class ReportScheduleList - # Detailed information about a report schedule. - attr_accessor :report_schedules - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_schedules' => :'reportSchedules' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_schedules' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpReports2021::ReportScheduleList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpReports2021::ReportScheduleList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_schedules') - if (value = attributes[:'report_schedules']).is_a?(Array) - self.report_schedules = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_schedules.nil? - invalid_properties.push('invalid value for "report_schedules", report_schedules cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_schedules.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_schedules == o.report_schedules - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_schedules].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpReports2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/reports_2021/lib/sp_reports_2021/version.rb b/vendor/reports_2021/lib/sp_reports_2021/version.rb deleted file mode 100644 index 81fad48..0000000 --- a/vendor/reports_2021/lib/sp_reports_2021/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpReports2021 - VERSION = '1.0.0' -end diff --git a/vendor/reports_2021/sp_reports_2021.gemspec b/vendor/reports_2021/sp_reports_2021.gemspec deleted file mode 100644 index 74cf28c..0000000 --- a/vendor/reports_2021/sp_reports_2021.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Reports - -#The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. - -OpenAPI spec version: 2021-06-30 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_reports_2021/version" - -Gem::Specification.new do |s| - s.name = "sp_reports_2021" - s.version = SpReports2021::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Reports Ruby Gem" - s.description = "The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/tokens_2021/.gitignore b/vendor/tokens_2021/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/tokens_2021/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/tokens_2021/.rspec b/vendor/tokens_2021/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/tokens_2021/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/tokens_2021/.rubocop.yml b/vendor/tokens_2021/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/tokens_2021/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/tokens_2021/.swagger-codegen-ignore b/vendor/tokens_2021/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/tokens_2021/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/tokens_2021/.swagger-codegen/VERSION b/vendor/tokens_2021/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/tokens_2021/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/tokens_2021/Gemfile b/vendor/tokens_2021/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/tokens_2021/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/tokens_2021/README.md b/vendor/tokens_2021/README.md deleted file mode 100644 index 24029af..0000000 --- a/vendor/tokens_2021/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# sp_tokens_2021 - -SpTokens2021 - the Ruby gem for the Selling Partner API for Tokens - -The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 2021-03-01 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_tokens_2021.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_tokens_2021-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_tokens_2021-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_tokens_2021', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_tokens_2021', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_tokens_2021' - -api_instance = SpTokens2021::TokensApi.new -body = SpTokens2021::CreateRestrictedDataTokenRequest.new # CreateRestrictedDataTokenRequest | The restricted data token request details. - - -begin - result = api_instance.create_restricted_data_token(body) - p result -rescue SpTokens2021::ApiError => e - puts "Exception when calling TokensApi->create_restricted_data_token: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpTokens2021::TokensApi* | [**create_restricted_data_token**](docs/TokensApi.md#create_restricted_data_token) | **POST** /tokens/2021-03-01/restrictedDataToken | - -## Documentation for Models - - - [SpTokens2021::CreateRestrictedDataTokenRequest](docs/CreateRestrictedDataTokenRequest.md) - - [SpTokens2021::CreateRestrictedDataTokenResponse](docs/CreateRestrictedDataTokenResponse.md) - - [SpTokens2021::Error](docs/Error.md) - - [SpTokens2021::ErrorList](docs/ErrorList.md) - - [SpTokens2021::RestrictedResource](docs/RestrictedResource.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/tokens_2021/Rakefile b/vendor/tokens_2021/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/tokens_2021/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/tokens_2021/git_push.sh b/vendor/tokens_2021/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/tokens_2021/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/api_client.rb b/vendor/tokens_2021/lib/sp_tokens_2021/api_client.rb deleted file mode 100644 index 3534d94..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpTokens2021 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpTokens2021.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/api_error.rb b/vendor/tokens_2021/lib/sp_tokens_2021/api_error.rb deleted file mode 100644 index 1944153..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpTokens2021 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/configuration.rb b/vendor/tokens_2021/lib/sp_tokens_2021/configuration.rb deleted file mode 100644 index e75ec3b..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpTokens2021 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_request.rb b/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_request.rb deleted file mode 100644 index ef18ead..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_request.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpTokens2021 - # The request schema for the createRestrictedDataToken operation. - class CreateRestrictedDataTokenRequest - # The application ID for the target application to which access is being delegated. - attr_accessor :target_application - - # A list of restricted resources. Maximum: 50 - attr_accessor :restricted_resources - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_application' => :'targetApplication', - :'restricted_resources' => :'restrictedResources' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_application' => :'Object', - :'restricted_resources' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpTokens2021::CreateRestrictedDataTokenRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpTokens2021::CreateRestrictedDataTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_application') - self.target_application = attributes[:'target_application'] - end - - if attributes.key?(:'restricted_resources') - if (value = attributes[:'restricted_resources']).is_a?(Array) - self.restricted_resources = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @restricted_resources.nil? - invalid_properties.push('invalid value for "restricted_resources", restricted_resources cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @restricted_resources.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_application == o.target_application && - restricted_resources == o.restricted_resources - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_application, restricted_resources].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpTokens2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_response.rb b/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_response.rb deleted file mode 100644 index 650b17e..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/models/create_restricted_data_token_response.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpTokens2021 - # The response schema for the createRestrictedDataToken operation. - class CreateRestrictedDataTokenResponse - # A Restricted Data Token (RDT). This is a short-lived access token that authorizes calls to restricted operations. Pass this value with the x-amz-access-token header when making subsequent calls to these restricted resources. - attr_accessor :restricted_data_token - - # The lifetime of the Restricted Data Token, in seconds. - attr_accessor :expires_in - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'restricted_data_token' => :'restrictedDataToken', - :'expires_in' => :'expiresIn' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'restricted_data_token' => :'Object', - :'expires_in' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpTokens2021::CreateRestrictedDataTokenResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpTokens2021::CreateRestrictedDataTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'restricted_data_token') - self.restricted_data_token = attributes[:'restricted_data_token'] - end - - if attributes.key?(:'expires_in') - self.expires_in = attributes[:'expires_in'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - restricted_data_token == o.restricted_data_token && - expires_in == o.expires_in - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [restricted_data_token, expires_in].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpTokens2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/models/error.rb b/vendor/tokens_2021/lib/sp_tokens_2021/models/error.rb deleted file mode 100644 index 17e7fb8..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpTokens2021 - # An error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpTokens2021::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpTokens2021::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpTokens2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/models/error_list.rb b/vendor/tokens_2021/lib/sp_tokens_2021/models/error_list.rb deleted file mode 100644 index 4ba3ce7..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/models/error_list.rb +++ /dev/null @@ -1,213 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpTokens2021 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpTokens2021::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpTokens2021::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpTokens2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/models/restricted_resource.rb b/vendor/tokens_2021/lib/sp_tokens_2021/models/restricted_resource.rb deleted file mode 100644 index 0670f01..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/models/restricted_resource.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpTokens2021 - # Model of a restricted resource. - class RestrictedResource - # The HTTP method in the restricted resource. - attr_accessor :method - - # The path in the restricted resource. Here are some path examples: - ```/orders/v0/orders```. For getting an RDT for the getOrders operation of the Orders API. For bulk orders. - ```/orders/v0/orders/123-1234567-1234567```. For getting an RDT for the getOrder operation of the Orders API. For a specific order. - ```/orders/v0/orders/123-1234567-1234567/orderItems```. For getting an RDT for the getOrderItems operation of the Orders API. For the order items in a specific order. - ```/mfn/v0/shipments/FBA1234ABC5D```. For getting an RDT for the getShipment operation of the Shipping API. For a specific shipment. - ```/mfn/v0/shipments/{shipmentId}```. For getting an RDT for the getShipment operation of the Shipping API. For any of a selling partner's shipments that you specify when you call the getShipment operation. - attr_accessor :path - - # Indicates the type of Personally Identifiable Information requested. This parameter is required only when getting an RDT for use with the getOrder, getOrders, or getOrderItems operation of the Orders API. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). Possible values include: - **buyerInfo**. On the order level this includes general identifying information about the buyer and tax-related information. On the order item level this includes gift wrap information and custom order information, if available. - **shippingAddress**. This includes information for fulfilling orders. - **buyerTaxInformation**. This includes information for issuing tax invoices. - attr_accessor :data_elements - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'method' => :'method', - :'path' => :'path', - :'data_elements' => :'dataElements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'method' => :'Object', - :'path' => :'Object', - :'data_elements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpTokens2021::RestrictedResource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpTokens2021::RestrictedResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'path') - self.path = attributes[:'path'] - end - - if attributes.key?(:'data_elements') - if (value = attributes[:'data_elements']).is_a?(Array) - self.data_elements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @method.nil? - invalid_properties.push('invalid value for "method", method cannot be nil.') - end - - if @path.nil? - invalid_properties.push('invalid value for "path", path cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @method.nil? - method_validator = EnumAttributeValidator.new('Object', ['GET', 'PUT', 'POST', 'DELETE']) - return false unless method_validator.valid?(@method) - return false if @path.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] method Object to be assigned - def method=(method) - validator = EnumAttributeValidator.new('Object', ['GET', 'PUT', 'POST', 'DELETE']) - unless validator.valid?(method) - fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}." - end - @method = method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - method == o.method && - path == o.path && - data_elements == o.data_elements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [method, path, data_elements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpTokens2021.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/tokens_2021/lib/sp_tokens_2021/version.rb b/vendor/tokens_2021/lib/sp_tokens_2021/version.rb deleted file mode 100644 index ac02275..0000000 --- a/vendor/tokens_2021/lib/sp_tokens_2021/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpTokens2021 - VERSION = '1.0.0' -end diff --git a/vendor/tokens_2021/sp_tokens_2021.gemspec b/vendor/tokens_2021/sp_tokens_2021.gemspec deleted file mode 100644 index 6f7d70a..0000000 --- a/vendor/tokens_2021/sp_tokens_2021.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Tokens - -#The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). - -OpenAPI spec version: 2021-03-01 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_tokens_2021/version" - -Gem::Specification.new do |s| - s.name = "sp_tokens_2021" - s.version = SpTokens2021::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Tokens Ruby Gem" - s.description = "The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide)." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vdf_inventory_v1/.gitignore b/vendor/vdf_inventory_v1/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vdf_inventory_v1/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vdf_inventory_v1/.rspec b/vendor/vdf_inventory_v1/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vdf_inventory_v1/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vdf_inventory_v1/.rubocop.yml b/vendor/vdf_inventory_v1/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vdf_inventory_v1/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vdf_inventory_v1/.swagger-codegen-ignore b/vendor/vdf_inventory_v1/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vdf_inventory_v1/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vdf_inventory_v1/.swagger-codegen/VERSION b/vendor/vdf_inventory_v1/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vdf_inventory_v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vdf_inventory_v1/Gemfile b/vendor/vdf_inventory_v1/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vdf_inventory_v1/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vdf_inventory_v1/README.md b/vendor/vdf_inventory_v1/README.md deleted file mode 100644 index 89611c6..0000000 --- a/vendor/vdf_inventory_v1/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# sp_vdf_inventory_v1 - -SpVdfInventoryV1 - the Ruby gem for the Selling Partner API for Direct Fulfillment Inventory Updates - -The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vdf_inventory_v1.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vdf_inventory_v1-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vdf_inventory_v1-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vdf_inventory_v1', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vdf_inventory_v1', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vdf_inventory_v1' - -api_instance = SpVdfInventoryV1::UpdateInventoryApi.new -body = SpVdfInventoryV1::SubmitInventoryUpdateRequest.new # SubmitInventoryUpdateRequest | The request body containing the inventory update data to submit. -warehouse_id = 'warehouse_id_example' # String | Identifier for the warehouse for which to update inventory. - - -begin - result = api_instance.submit_inventory_update(body, warehouse_id) - p result -rescue SpVdfInventoryV1::ApiError => e - puts "Exception when calling UpdateInventoryApi->submit_inventory_update: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVdfInventoryV1::UpdateInventoryApi* | [**submit_inventory_update**](docs/UpdateInventoryApi.md#submit_inventory_update) | **POST** /vendor/directFulfillment/inventory/v1/warehouses/{warehouseId}/items | - -## Documentation for Models - - - [SpVdfInventoryV1::Error](docs/Error.md) - - [SpVdfInventoryV1::ErrorList](docs/ErrorList.md) - - [SpVdfInventoryV1::InventoryUpdate](docs/InventoryUpdate.md) - - [SpVdfInventoryV1::ItemDetails](docs/ItemDetails.md) - - [SpVdfInventoryV1::ItemQuantity](docs/ItemQuantity.md) - - [SpVdfInventoryV1::PartyIdentification](docs/PartyIdentification.md) - - [SpVdfInventoryV1::SubmitInventoryUpdateRequest](docs/SubmitInventoryUpdateRequest.md) - - [SpVdfInventoryV1::SubmitInventoryUpdateResponse](docs/SubmitInventoryUpdateResponse.md) - - [SpVdfInventoryV1::TransactionReference](docs/TransactionReference.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vdf_inventory_v1/Rakefile b/vendor/vdf_inventory_v1/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vdf_inventory_v1/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vdf_inventory_v1/git_push.sh b/vendor/vdf_inventory_v1/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vdf_inventory_v1/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_client.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_client.rb deleted file mode 100644 index f91dc4d..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVdfInventoryV1 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVdfInventoryV1.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_error.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_error.rb deleted file mode 100644 index 4ddb1ba..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfInventoryV1 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/configuration.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/configuration.rb deleted file mode 100644 index 83b3885..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfInventoryV1 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error.rb deleted file mode 100644 index badc97c..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error_list.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error_list.rb deleted file mode 100644 index 2096a01..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/inventory_update.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/inventory_update.rb deleted file mode 100644 index 0525e34..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/inventory_update.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Inventory details required to update some or all items for the requested warehouse. - class InventoryUpdate - attr_accessor :selling_party - - # When true, this request contains a full feed. Otherwise, this request contains a partial feed. When sending a full feed, you must send information about all items in the warehouse. Any items not in the full feed are updated as not available. When sending a partial feed, only include the items that need an update to inventory. The status of other items will remain unchanged. - attr_accessor :is_full_update - - # A list of inventory items with updated details, including quantity available. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'selling_party' => :'sellingParty', - :'is_full_update' => :'isFullUpdate', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'selling_party' => :'Object', - :'is_full_update' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::InventoryUpdate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::InventoryUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'is_full_update') - self.is_full_update = attributes[:'is_full_update'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @is_full_update.nil? - invalid_properties.push('invalid value for "is_full_update", is_full_update cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @selling_party.nil? - return false if @is_full_update.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - selling_party == o.selling_party && - is_full_update == o.is_full_update && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [selling_party, is_full_update, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_details.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_details.rb deleted file mode 100644 index 342fa42..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_details.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Updated inventory details for an item. - class ItemDetails - # The buyer selected product identification of the item. Either buyerProductIdentifier or vendorProductIdentifier should be submitted. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Either buyerProductIdentifier or vendorProductIdentifier should be submitted. - attr_accessor :vendor_product_identifier - - attr_accessor :available_quantity - - # When true, the item is permanently unavailable. - attr_accessor :is_obsolete - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'available_quantity' => :'availableQuantity', - :'is_obsolete' => :'isObsolete' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'available_quantity' => :'Object', - :'is_obsolete' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::ItemDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::ItemDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'available_quantity') - self.available_quantity = attributes[:'available_quantity'] - end - - if attributes.key?(:'is_obsolete') - self.is_obsolete = attributes[:'is_obsolete'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @available_quantity.nil? - invalid_properties.push('invalid value for "available_quantity", available_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @available_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - available_quantity == o.available_quantity && - is_obsolete == o.is_obsolete - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buyer_product_identifier, vendor_product_identifier, available_quantity, is_obsolete].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_quantity.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_quantity.rb deleted file mode 100644 index 5aef929..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/item_quantity.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Details of item quantity. - class ItemQuantity - # Quantity of units available for a specific item. - attr_accessor :amount - - # Unit of measure for the available quantity. - attr_accessor :unit_of_measure - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/party_identification.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/party_identification.rb deleted file mode 100644 index 67ac43d..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/party_identification.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Name, address and tax details of a party. - class PartyIdentification - # Assigned identification for the party. - attr_accessor :party_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_request.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_request.rb deleted file mode 100644 index ee7eac4..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_request.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # The request body for the submitInventoryUpdate operation. - class SubmitInventoryUpdateRequest - attr_accessor :inventory - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inventory' => :'inventory' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'inventory' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::SubmitInventoryUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::SubmitInventoryUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inventory') - self.inventory = attributes[:'inventory'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inventory == o.inventory - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inventory].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_response.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_response.rb deleted file mode 100644 index a2fc0ee..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/submit_inventory_update_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # The response schema for the submitInventoryUpdate operation. - class SubmitInventoryUpdateResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::SubmitInventoryUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::SubmitInventoryUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/transaction_reference.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/transaction_reference.rb deleted file mode 100644 index 76aa15c..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/models/transaction_reference.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfInventoryV1 - # Response containing the transaction ID. - class TransactionReference - # GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfInventoryV1::TransactionReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfInventoryV1::TransactionReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfInventoryV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/version.rb b/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/version.rb deleted file mode 100644 index 5ac63b7..0000000 --- a/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVdfInventoryV1 - VERSION = '1.0.0' -end diff --git a/vendor/vdf_inventory_v1/sp_vdf_inventory_v1.gemspec b/vendor/vdf_inventory_v1/sp_vdf_inventory_v1.gemspec deleted file mode 100644 index 8831b7b..0000000 --- a/vendor/vdf_inventory_v1/sp_vdf_inventory_v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Direct Fulfillment Inventory Updates - -#The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vdf_inventory_v1/version" - -Gem::Specification.new do |s| - s.name = "sp_vdf_inventory_v1" - s.version = SpVdfInventoryV1::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Direct Fulfillment Inventory Updates Ruby Gem" - s.description = "The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vdf_orders_v1/.gitignore b/vendor/vdf_orders_v1/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vdf_orders_v1/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vdf_orders_v1/.rspec b/vendor/vdf_orders_v1/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vdf_orders_v1/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vdf_orders_v1/.rubocop.yml b/vendor/vdf_orders_v1/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vdf_orders_v1/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vdf_orders_v1/.swagger-codegen-ignore b/vendor/vdf_orders_v1/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vdf_orders_v1/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vdf_orders_v1/.swagger-codegen/VERSION b/vendor/vdf_orders_v1/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vdf_orders_v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vdf_orders_v1/Gemfile b/vendor/vdf_orders_v1/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vdf_orders_v1/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vdf_orders_v1/README.md b/vendor/vdf_orders_v1/README.md deleted file mode 100644 index fde698d..0000000 --- a/vendor/vdf_orders_v1/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# sp_vdf_orders_v1 - -SpVdfOrdersV1 - the Ruby gem for the Selling Partner API for Direct Fulfillment Orders - -The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vdf_orders_v1.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vdf_orders_v1-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vdf_orders_v1-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vdf_orders_v1', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vdf_orders_v1', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vdf_orders_v1' - -api_instance = SpVdfOrdersV1::VendorOrdersApi.new -purchase_order_number = 'purchase_order_number_example' # String | The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code. - - -begin - result = api_instance.get_order(purchase_order_number) - p result -rescue SpVdfOrdersV1::ApiError => e - puts "Exception when calling VendorOrdersApi->get_order: #{e}" -end - -api_instance = SpVdfOrdersV1::VendorOrdersApi.new -created_after = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Purchase orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. -created_before = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Purchase orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. -opts = { - ship_from_party_id: 'ship_from_party_id_example', # String | The vendor warehouse identifier for the fulfillment warehouse. If not specified, the result will contain orders for all warehouses. - status: 'status_example', # String | Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status. - limit: 789, # Integer | The limit to the number of purchase orders returned. - sort_order: 'sort_order_example', # String | Sort the list in ascending or descending order by order creation date. - next_token: 'next_token_example', # String | Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call. - include_details: 'true' # String | When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned. -} - -begin - result = api_instance.get_orders(created_after, created_before, opts) - p result -rescue SpVdfOrdersV1::ApiError => e - puts "Exception when calling VendorOrdersApi->get_orders: #{e}" -end - -api_instance = SpVdfOrdersV1::VendorOrdersApi.new -body = SpVdfOrdersV1::SubmitAcknowledgementRequest.new # SubmitAcknowledgementRequest | The request body containing the acknowledgement to an order. - - -begin - result = api_instance.submit_acknowledgement(body) - p result -rescue SpVdfOrdersV1::ApiError => e - puts "Exception when calling VendorOrdersApi->submit_acknowledgement: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVdfOrdersV1::VendorOrdersApi* | [**get_order**](docs/VendorOrdersApi.md#get_order) | **GET** /vendor/directFulfillment/orders/v1/purchaseOrders/{purchaseOrderNumber} | -*SpVdfOrdersV1::VendorOrdersApi* | [**get_orders**](docs/VendorOrdersApi.md#get_orders) | **GET** /vendor/directFulfillment/orders/v1/purchaseOrders | -*SpVdfOrdersV1::VendorOrdersApi* | [**submit_acknowledgement**](docs/VendorOrdersApi.md#submit_acknowledgement) | **POST** /vendor/directFulfillment/orders/v1/acknowledgements | - -## Documentation for Models - - - [SpVdfOrdersV1::AcknowledgementStatus](docs/AcknowledgementStatus.md) - - [SpVdfOrdersV1::Address](docs/Address.md) - - [SpVdfOrdersV1::Decimal](docs/Decimal.md) - - [SpVdfOrdersV1::Error](docs/Error.md) - - [SpVdfOrdersV1::ErrorList](docs/ErrorList.md) - - [SpVdfOrdersV1::GetOrderResponse](docs/GetOrderResponse.md) - - [SpVdfOrdersV1::GetOrdersResponse](docs/GetOrdersResponse.md) - - [SpVdfOrdersV1::GiftDetails](docs/GiftDetails.md) - - [SpVdfOrdersV1::ItemQuantity](docs/ItemQuantity.md) - - [SpVdfOrdersV1::Money](docs/Money.md) - - [SpVdfOrdersV1::Order](docs/Order.md) - - [SpVdfOrdersV1::OrderAcknowledgementItem](docs/OrderAcknowledgementItem.md) - - [SpVdfOrdersV1::OrderDetails](docs/OrderDetails.md) - - [SpVdfOrdersV1::OrderDetailsTaxTotal](docs/OrderDetailsTaxTotal.md) - - [SpVdfOrdersV1::OrderItem](docs/OrderItem.md) - - [SpVdfOrdersV1::OrderItemAcknowledgement](docs/OrderItemAcknowledgement.md) - - [SpVdfOrdersV1::OrderItemTaxDetails](docs/OrderItemTaxDetails.md) - - [SpVdfOrdersV1::OrderList](docs/OrderList.md) - - [SpVdfOrdersV1::Pagination](docs/Pagination.md) - - [SpVdfOrdersV1::PartyIdentification](docs/PartyIdentification.md) - - [SpVdfOrdersV1::ScheduledDeliveryShipment](docs/ScheduledDeliveryShipment.md) - - [SpVdfOrdersV1::ShipmentDates](docs/ShipmentDates.md) - - [SpVdfOrdersV1::ShipmentDetails](docs/ShipmentDetails.md) - - [SpVdfOrdersV1::SubmitAcknowledgementRequest](docs/SubmitAcknowledgementRequest.md) - - [SpVdfOrdersV1::SubmitAcknowledgementResponse](docs/SubmitAcknowledgementResponse.md) - - [SpVdfOrdersV1::TaxDetails](docs/TaxDetails.md) - - [SpVdfOrdersV1::TaxLineItem](docs/TaxLineItem.md) - - [SpVdfOrdersV1::TaxRegistrationDetails](docs/TaxRegistrationDetails.md) - - [SpVdfOrdersV1::TransactionId](docs/TransactionId.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vdf_orders_v1/Rakefile b/vendor/vdf_orders_v1/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vdf_orders_v1/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vdf_orders_v1/git_push.sh b/vendor/vdf_orders_v1/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vdf_orders_v1/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_client.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_client.rb deleted file mode 100644 index 2b59e4e..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVdfOrdersV1 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVdfOrdersV1.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_error.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_error.rb deleted file mode 100644 index fb77b9a..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfOrdersV1 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/configuration.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/configuration.rb deleted file mode 100644 index 6174b3a..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfOrdersV1 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/acknowledgement_status.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/acknowledgement_status.rb deleted file mode 100644 index b2f091d..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/acknowledgement_status.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Status of acknowledgement. - class AcknowledgementStatus - # Acknowledgement code is a unique two digit value which indicates the status of the acknowledgement. For a list of acknowledgement codes that Amazon supports, see the Vendor Direct Fulfillment APIs Use Case Guide. - attr_accessor :code - - # Reason for the acknowledgement code. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'description' => :'description' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'description' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::AcknowledgementStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::AcknowledgementStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/address.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/address.rb deleted file mode 100644 index ceb24a6..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/address.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Address of the party. - class Address - # The name of the person, business or institution at that address. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :name - - # The attention name of the person at that address. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :attention - - # First line of the address. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :address_line1 - - # Additional address information, if required. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :address_line2 - - # Additional address information, if required. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :city - - # The county where person, business or institution is located. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :county - - # The district where person, business or institution is located. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of that address. It conatins a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. For Amazon label only vendors, this field will have the value `xxxxx` within the object `shipToParty`. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'attention' => :'attention', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'attention' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'attention') - self.attention = attributes[:'attention'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @state_or_region.nil? - invalid_properties.push('invalid value for "state_or_region", state_or_region cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @state_or_region.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - attention == o.attention && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, attention, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/decimal.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/decimal.rb deleted file mode 100644 index 1468b00..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error.rb deleted file mode 100644 index 01a5550..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error_list.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error_list.rb deleted file mode 100644 index 077dc91..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_order_response.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_order_response.rb deleted file mode 100644 index c39bccd..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_order_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The response schema for the getOrder operation. - class GetOrderResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::GetOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::GetOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_orders_response.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_orders_response.rb deleted file mode 100644 index 8c182f0..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/get_orders_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The response schema for the getOrders operation. - class GetOrdersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::GetOrdersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::GetOrdersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/gift_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/gift_details.rb deleted file mode 100644 index f2d6760..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/gift_details.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Gift details for the item. - class GiftDetails - # Gift message to be printed in shipment. - attr_accessor :gift_message - - # Gift wrap identifier for the gift wrapping, if any. - attr_accessor :gift_wrap_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'gift_message' => :'giftMessage', - :'gift_wrap_id' => :'giftWrapId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'gift_message' => :'Object', - :'gift_wrap_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::GiftDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::GiftDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'gift_message') - self.gift_message = attributes[:'gift_message'] - end - - if attributes.key?(:'gift_wrap_id') - self.gift_wrap_id = attributes[:'gift_wrap_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - gift_message == o.gift_message && - gift_wrap_id == o.gift_wrap_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [gift_message, gift_wrap_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/item_quantity.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/item_quantity.rb deleted file mode 100644 index 2687f99..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/item_quantity.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Details of quantity ordered. - class ItemQuantity - # Acknowledged quantity. This value should not be zero. - attr_accessor :amount - - # Unit of measure for the acknowledged quantity. - attr_accessor :unit_of_measure - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Each']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Each']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/money.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/money.rb deleted file mode 100644 index 640f409..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/money.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # An amount of money, including units in the form of currency. - class Money - # Three digit currency code in ISO 4217 format. String of length 3. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order.rb deleted file mode 100644 index 189c210..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Represents a purchase order. - class Order - # The purchase order number for this order. Formatting Notes: alpha-numeric code. - attr_accessor :purchase_order_number - - attr_accessor :order_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'order_details' => :'orderDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'order_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Order` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'order_details') - self.order_details = attributes[:'order_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - order_details == o.order_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, order_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_acknowledgement_item.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_acknowledgement_item.rb deleted file mode 100644 index d2c999f..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_acknowledgement_item.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Details of an individual order being acknowledged. - class OrderAcknowledgementItem - # The purchase order number for this order. Formatting Notes: alpha-numeric code. - attr_accessor :purchase_order_number - - # The vendor's order number for this order. - attr_accessor :vendor_order_number - - # The date and time when the order is acknowledged, in ISO-8601 date/time format. For example: 2018-07-16T23:00:00Z / 2018-07-16T23:00:00-05:00 / 2018-07-16T23:00:00-08:00. - attr_accessor :acknowledgement_date - - attr_accessor :acknowledgement_status - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - # Item details including acknowledged quantity. - attr_accessor :item_acknowledgements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'vendor_order_number' => :'vendorOrderNumber', - :'acknowledgement_date' => :'acknowledgementDate', - :'acknowledgement_status' => :'acknowledgementStatus', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'item_acknowledgements' => :'itemAcknowledgements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'vendor_order_number' => :'Object', - :'acknowledgement_date' => :'Object', - :'acknowledgement_status' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'item_acknowledgements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderAcknowledgementItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderAcknowledgementItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'vendor_order_number') - self.vendor_order_number = attributes[:'vendor_order_number'] - end - - if attributes.key?(:'acknowledgement_date') - self.acknowledgement_date = attributes[:'acknowledgement_date'] - end - - if attributes.key?(:'acknowledgement_status') - self.acknowledgement_status = attributes[:'acknowledgement_status'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'item_acknowledgements') - if (value = attributes[:'item_acknowledgements']).is_a?(Array) - self.item_acknowledgements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @vendor_order_number.nil? - invalid_properties.push('invalid value for "vendor_order_number", vendor_order_number cannot be nil.') - end - - if @acknowledgement_date.nil? - invalid_properties.push('invalid value for "acknowledgement_date", acknowledgement_date cannot be nil.') - end - - if @acknowledgement_status.nil? - invalid_properties.push('invalid value for "acknowledgement_status", acknowledgement_status cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @item_acknowledgements.nil? - invalid_properties.push('invalid value for "item_acknowledgements", item_acknowledgements cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @vendor_order_number.nil? - return false if @acknowledgement_date.nil? - return false if @acknowledgement_status.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @item_acknowledgements.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - vendor_order_number == o.vendor_order_number && - acknowledgement_date == o.acknowledgement_date && - acknowledgement_status == o.acknowledgement_status && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - item_acknowledgements == o.item_acknowledgements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, vendor_order_number, acknowledgement_date, acknowledgement_status, selling_party, ship_from_party, item_acknowledgements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details.rb deleted file mode 100644 index 6e08212..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details.rb +++ /dev/null @@ -1,372 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Details of an order. - class OrderDetails - # The customer order number. - attr_accessor :customer_order_number - - # The date the order was placed. This field is expected to be in ISO-8601 date/time format, for example:2018-07-16T23:00:00Z/ 2018-07-16T23:00:00-05:00 /2018-07-16T23:00:00-08:00. If no time zone is specified, UTC should be assumed. - attr_accessor :order_date - - # Current status of the order. - attr_accessor :order_status - - attr_accessor :shipment_details - - attr_accessor :tax_total - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - attr_accessor :ship_to_party - - attr_accessor :bill_to_party - - # A list of items in this purchase order. - attr_accessor :items - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'customer_order_number' => :'customerOrderNumber', - :'order_date' => :'orderDate', - :'order_status' => :'orderStatus', - :'shipment_details' => :'shipmentDetails', - :'tax_total' => :'taxTotal', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'ship_to_party' => :'shipToParty', - :'bill_to_party' => :'billToParty', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'customer_order_number' => :'Object', - :'order_date' => :'Object', - :'order_status' => :'Object', - :'shipment_details' => :'Object', - :'tax_total' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'ship_to_party' => :'Object', - :'bill_to_party' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'customer_order_number') - self.customer_order_number = attributes[:'customer_order_number'] - end - - if attributes.key?(:'order_date') - self.order_date = attributes[:'order_date'] - end - - if attributes.key?(:'order_status') - self.order_status = attributes[:'order_status'] - end - - if attributes.key?(:'shipment_details') - self.shipment_details = attributes[:'shipment_details'] - end - - if attributes.key?(:'tax_total') - self.tax_total = attributes[:'tax_total'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'bill_to_party') - self.bill_to_party = attributes[:'bill_to_party'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @customer_order_number.nil? - invalid_properties.push('invalid value for "customer_order_number", customer_order_number cannot be nil.') - end - - if @order_date.nil? - invalid_properties.push('invalid value for "order_date", order_date cannot be nil.') - end - - if @shipment_details.nil? - invalid_properties.push('invalid value for "shipment_details", shipment_details cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @ship_to_party.nil? - invalid_properties.push('invalid value for "ship_to_party", ship_to_party cannot be nil.') - end - - if @bill_to_party.nil? - invalid_properties.push('invalid value for "bill_to_party", bill_to_party cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @customer_order_number.nil? - return false if @order_date.nil? - order_status_validator = EnumAttributeValidator.new('Object', ['NEW', 'SHIPPED', 'ACCEPTED', 'CANCELLED']) - return false unless order_status_validator.valid?(@order_status) - return false if @shipment_details.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @ship_to_party.nil? - return false if @bill_to_party.nil? - return false if @items.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] order_status Object to be assigned - def order_status=(order_status) - validator = EnumAttributeValidator.new('Object', ['NEW', 'SHIPPED', 'ACCEPTED', 'CANCELLED']) - unless validator.valid?(order_status) - fail ArgumentError, "invalid value for \"order_status\", must be one of #{validator.allowable_values}." - end - @order_status = order_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - customer_order_number == o.customer_order_number && - order_date == o.order_date && - order_status == o.order_status && - shipment_details == o.shipment_details && - tax_total == o.tax_total && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - ship_to_party == o.ship_to_party && - bill_to_party == o.bill_to_party && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [customer_order_number, order_date, order_status, shipment_details, tax_total, selling_party, ship_from_party, ship_to_party, bill_to_party, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details_tax_total.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details_tax_total.rb deleted file mode 100644 index d5d108a..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_details_tax_total.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The total Tax object within shipment that relates to the order. - class OrderDetailsTaxTotal - attr_accessor :tax_line_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_line_item' => :'taxLineItem' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_line_item' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderDetailsTaxTotal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderDetailsTaxTotal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_line_item') - self.tax_line_item = attributes[:'tax_line_item'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_line_item == o.tax_line_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_line_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item.rb deleted file mode 100644 index 5c93d59..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item.rb +++ /dev/null @@ -1,311 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # An item within an order - class OrderItem - # Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on. - attr_accessor :item_sequence_number - - # Buyer's standard identification number (ASIN) of an item. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. - attr_accessor :vendor_product_identifier - - # Title for the item. - attr_accessor :title - - attr_accessor :ordered_quantity - - attr_accessor :scheduled_delivery_shipment - - attr_accessor :gift_details - - attr_accessor :net_price - - attr_accessor :tax_details - - attr_accessor :total_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'title' => :'title', - :'ordered_quantity' => :'orderedQuantity', - :'scheduled_delivery_shipment' => :'scheduledDeliveryShipment', - :'gift_details' => :'giftDetails', - :'net_price' => :'netPrice', - :'tax_details' => :'taxDetails', - :'total_price' => :'totalPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'title' => :'Object', - :'ordered_quantity' => :'Object', - :'scheduled_delivery_shipment' => :'Object', - :'gift_details' => :'Object', - :'net_price' => :'Object', - :'tax_details' => :'Object', - :'total_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'scheduled_delivery_shipment') - self.scheduled_delivery_shipment = attributes[:'scheduled_delivery_shipment'] - end - - if attributes.key?(:'gift_details') - self.gift_details = attributes[:'gift_details'] - end - - if attributes.key?(:'net_price') - self.net_price = attributes[:'net_price'] - end - - if attributes.key?(:'tax_details') - self.tax_details = attributes[:'tax_details'] - end - - if attributes.key?(:'total_price') - self.total_price = attributes[:'total_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @ordered_quantity.nil? - invalid_properties.push('invalid value for "ordered_quantity", ordered_quantity cannot be nil.') - end - - if @net_price.nil? - invalid_properties.push('invalid value for "net_price", net_price cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @ordered_quantity.nil? - return false if @net_price.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - title == o.title && - ordered_quantity == o.ordered_quantity && - scheduled_delivery_shipment == o.scheduled_delivery_shipment && - gift_details == o.gift_details && - net_price == o.net_price && - tax_details == o.tax_details && - total_price == o.total_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, title, ordered_quantity, scheduled_delivery_shipment, gift_details, net_price, tax_details, total_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_acknowledgement.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_acknowledgement.rb deleted file mode 100644 index 2a24b91..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_acknowledgement.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Details of an individual item within the order being acknowledged. - class OrderItemAcknowledgement - # Line item sequence number for the item. - attr_accessor :item_sequence_number - - # Buyer's standard identification number (ASIN) of an item. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Should be the same as was provided in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :acknowledged_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'acknowledged_quantity' => :'acknowledgedQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'acknowledged_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderItemAcknowledgement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderItemAcknowledgement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'acknowledged_quantity') - self.acknowledged_quantity = attributes[:'acknowledged_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @acknowledged_quantity.nil? - invalid_properties.push('invalid value for "acknowledged_quantity", acknowledged_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @acknowledged_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - acknowledged_quantity == o.acknowledged_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, acknowledged_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_tax_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_tax_details.rb deleted file mode 100644 index 0e0545d..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_item_tax_details.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Total tax details for the line item. - class OrderItemTaxDetails - attr_accessor :tax_line_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_line_item' => :'taxLineItem' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_line_item' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderItemTaxDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderItemTaxDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_line_item') - self.tax_line_item = attributes[:'tax_line_item'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_line_item == o.tax_line_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_line_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_list.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_list.rb deleted file mode 100644 index 6d0b399..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/order_list.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # A list of purchase orders returned as response. - class OrderList - attr_accessor :pagination - - # Represents a purchase order within the OrderList. - attr_accessor :orders - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'orders' => :'orders' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'orders' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::OrderList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::OrderList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'orders') - if (value = attributes[:'orders']).is_a?(Array) - self.orders = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - orders == o.orders - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, orders].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/pagination.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/pagination.rb deleted file mode 100644 index 87dc194..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/pagination.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The pagination elements required to retrieve the remaining data. - class Pagination - # A generated string used to pass information to your next request. If NextToken is returned, pass the value of NextToken to the next request. If NextToken is not returned, there are no more order items to return. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/party_identification.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/party_identification.rb deleted file mode 100644 index cc82aea..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/party_identification.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Name, address and tax details of a party. - class PartyIdentification - # Assigned identification for the party. For example, warehouse code or vendor code. Please refer to specific party for more details. - attr_accessor :party_id - - attr_accessor :address - - attr_accessor :tax_info - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId', - :'address' => :'address', - :'tax_info' => :'taxInfo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object', - :'address' => :'Object', - :'tax_info' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_info') - self.tax_info = attributes[:'tax_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id && - address == o.address && - tax_info == o.tax_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id, address, tax_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/scheduled_delivery_shipment.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/scheduled_delivery_shipment.rb deleted file mode 100644 index 17a9cd1..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/scheduled_delivery_shipment.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Dates for the scheduled delivery shipments. - class ScheduledDeliveryShipment - # Scheduled delivery service type. - attr_accessor :scheduled_delivery_service_type - - # Earliest nominated delivery date for the scheduled delivery. - attr_accessor :earliest_nominated_delivery_date - - # Latest nominated delivery date for the scheduled delivery. - attr_accessor :latest_nominated_delivery_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'scheduled_delivery_service_type' => :'scheduledDeliveryServiceType', - :'earliest_nominated_delivery_date' => :'earliestNominatedDeliveryDate', - :'latest_nominated_delivery_date' => :'latestNominatedDeliveryDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'scheduled_delivery_service_type' => :'Object', - :'earliest_nominated_delivery_date' => :'Object', - :'latest_nominated_delivery_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::ScheduledDeliveryShipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::ScheduledDeliveryShipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'scheduled_delivery_service_type') - self.scheduled_delivery_service_type = attributes[:'scheduled_delivery_service_type'] - end - - if attributes.key?(:'earliest_nominated_delivery_date') - self.earliest_nominated_delivery_date = attributes[:'earliest_nominated_delivery_date'] - end - - if attributes.key?(:'latest_nominated_delivery_date') - self.latest_nominated_delivery_date = attributes[:'latest_nominated_delivery_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - scheduled_delivery_service_type == o.scheduled_delivery_service_type && - earliest_nominated_delivery_date == o.earliest_nominated_delivery_date && - latest_nominated_delivery_date == o.latest_nominated_delivery_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [scheduled_delivery_service_type, earliest_nominated_delivery_date, latest_nominated_delivery_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_dates.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_dates.rb deleted file mode 100644 index fecc40b..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_dates.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Shipment dates. - class ShipmentDates - # Time by which the vendor is required to ship the order. - attr_accessor :required_ship_date - - # Delivery date promised to the Amazon customer. - attr_accessor :promised_delivery_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'required_ship_date' => :'requiredShipDate', - :'promised_delivery_date' => :'promisedDeliveryDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'required_ship_date' => :'Object', - :'promised_delivery_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::ShipmentDates` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::ShipmentDates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'required_ship_date') - self.required_ship_date = attributes[:'required_ship_date'] - end - - if attributes.key?(:'promised_delivery_date') - self.promised_delivery_date = attributes[:'promised_delivery_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @required_ship_date.nil? - invalid_properties.push('invalid value for "required_ship_date", required_ship_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @required_ship_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - required_ship_date == o.required_ship_date && - promised_delivery_date == o.promised_delivery_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [required_ship_date, promised_delivery_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_details.rb deleted file mode 100644 index f0d621e..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/shipment_details.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Shipment details required for the shipment. - class ShipmentDetails - # When true, this is a priority shipment. - attr_accessor :is_priority_shipment - - # When true, this order is part of a scheduled delivery program. - attr_accessor :is_scheduled_delivery_shipment - - # When true, a packing slip is required to be sent to the customer. - attr_accessor :is_pslip_required - - # When true, the order contain a gift. Include the gift message and gift wrap information. - attr_accessor :is_gift - - # Ship method to be used for shipping the order. Amazon defines ship method codes indicating the shipping carrier and shipment service level. To see the full list of ship methods in use, including both the code and the friendly name, search the 'Help' section on Vendor Central for 'ship methods'. - attr_accessor :ship_method - - attr_accessor :shipment_dates - - # Message to customer for order status. - attr_accessor :message_to_customer - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_priority_shipment' => :'isPriorityShipment', - :'is_scheduled_delivery_shipment' => :'isScheduledDeliveryShipment', - :'is_pslip_required' => :'isPslipRequired', - :'is_gift' => :'isGift', - :'ship_method' => :'shipMethod', - :'shipment_dates' => :'shipmentDates', - :'message_to_customer' => :'messageToCustomer' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_priority_shipment' => :'Object', - :'is_scheduled_delivery_shipment' => :'Object', - :'is_pslip_required' => :'Object', - :'is_gift' => :'Object', - :'ship_method' => :'Object', - :'shipment_dates' => :'Object', - :'message_to_customer' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::ShipmentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::ShipmentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_priority_shipment') - self.is_priority_shipment = attributes[:'is_priority_shipment'] - end - - if attributes.key?(:'is_scheduled_delivery_shipment') - self.is_scheduled_delivery_shipment = attributes[:'is_scheduled_delivery_shipment'] - end - - if attributes.key?(:'is_pslip_required') - self.is_pslip_required = attributes[:'is_pslip_required'] - end - - if attributes.key?(:'is_gift') - self.is_gift = attributes[:'is_gift'] - end - - if attributes.key?(:'ship_method') - self.ship_method = attributes[:'ship_method'] - end - - if attributes.key?(:'shipment_dates') - self.shipment_dates = attributes[:'shipment_dates'] - end - - if attributes.key?(:'message_to_customer') - self.message_to_customer = attributes[:'message_to_customer'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_priority_shipment.nil? - invalid_properties.push('invalid value for "is_priority_shipment", is_priority_shipment cannot be nil.') - end - - if @is_pslip_required.nil? - invalid_properties.push('invalid value for "is_pslip_required", is_pslip_required cannot be nil.') - end - - if @ship_method.nil? - invalid_properties.push('invalid value for "ship_method", ship_method cannot be nil.') - end - - if @shipment_dates.nil? - invalid_properties.push('invalid value for "shipment_dates", shipment_dates cannot be nil.') - end - - if @message_to_customer.nil? - invalid_properties.push('invalid value for "message_to_customer", message_to_customer cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_priority_shipment.nil? - return false if @is_pslip_required.nil? - return false if @ship_method.nil? - return false if @shipment_dates.nil? - return false if @message_to_customer.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_priority_shipment == o.is_priority_shipment && - is_scheduled_delivery_shipment == o.is_scheduled_delivery_shipment && - is_pslip_required == o.is_pslip_required && - is_gift == o.is_gift && - ship_method == o.ship_method && - shipment_dates == o.shipment_dates && - message_to_customer == o.message_to_customer - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_priority_shipment, is_scheduled_delivery_shipment, is_pslip_required, is_gift, ship_method, shipment_dates, message_to_customer].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_request.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_request.rb deleted file mode 100644 index a6e28ff..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The request schema for the submitAcknowledgement operation. - class SubmitAcknowledgementRequest - # A list of one or more purchase orders. - attr_accessor :order_acknowledgements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'order_acknowledgements' => :'orderAcknowledgements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'order_acknowledgements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::SubmitAcknowledgementRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::SubmitAcknowledgementRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'order_acknowledgements') - if (value = attributes[:'order_acknowledgements']).is_a?(Array) - self.order_acknowledgements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - order_acknowledgements == o.order_acknowledgements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [order_acknowledgements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_response.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_response.rb deleted file mode 100644 index 4050551..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/submit_acknowledgement_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The response schema for the submitAcknowledgement operation. - class SubmitAcknowledgementResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::SubmitAcknowledgementResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::SubmitAcknowledgementResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_details.rb deleted file mode 100644 index 4d584de..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_details.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # The tax details related to the order. - class TaxDetails - attr_accessor :tax_rate - - attr_accessor :tax_amount - - attr_accessor :taxable_amount - - # Tax type. - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_rate' => :'taxRate', - :'tax_amount' => :'taxAmount', - :'taxable_amount' => :'taxableAmount', - :'type' => :'type' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_rate' => :'Object', - :'tax_amount' => :'Object', - :'taxable_amount' => :'Object', - :'type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::TaxDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::TaxDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_rate') - self.tax_rate = attributes[:'tax_rate'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'taxable_amount') - self.taxable_amount = attributes[:'taxable_amount'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_amount.nil? - invalid_properties.push('invalid value for "tax_amount", tax_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_amount.nil? - type_validator = EnumAttributeValidator.new('Object', ['CONSUMPTION', 'GST', 'MwSt.', 'PST', 'TOTAL', 'TVA', 'VAT']) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['CONSUMPTION', 'GST', 'MwSt.', 'PST', 'TOTAL', 'TVA', 'VAT']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_rate == o.tax_rate && - tax_amount == o.tax_amount && - taxable_amount == o.taxable_amount && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_rate, tax_amount, taxable_amount, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_line_item.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_line_item.rb deleted file mode 100644 index 8a9b8a6..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_line_item.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # A list of tax line items. - class TaxLineItem - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::TaxLineItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::TaxLineItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_registration_details.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_registration_details.rb deleted file mode 100644 index da5ac46..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/tax_registration_details.rb +++ /dev/null @@ -1,280 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Tax registration details of the entity. - class TaxRegistrationDetails - # Tax registration type for the entity. - attr_accessor :tax_registration_type - - # Tax registration number for the party. For example, VAT ID. - attr_accessor :tax_registration_number - - attr_accessor :tax_registration_address - - # Tax registration message that can be used for additional tax related details. - attr_accessor :tax_registration_messages - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber', - :'tax_registration_address' => :'taxRegistrationAddress', - :'tax_registration_messages' => :'taxRegistrationMessages' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object', - :'tax_registration_address' => :'Object', - :'tax_registration_messages' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::TaxRegistrationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::TaxRegistrationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - - if attributes.key?(:'tax_registration_address') - self.tax_registration_address = attributes[:'tax_registration_address'] - end - - if attributes.key?(:'tax_registration_messages') - self.tax_registration_messages = attributes[:'tax_registration_messages'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number && - tax_registration_address == o.tax_registration_address && - tax_registration_messages == o.tax_registration_messages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number, tax_registration_address, tax_registration_messages].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/transaction_id.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/transaction_id.rb deleted file mode 100644 index ba4f505..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/models/transaction_id.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfOrdersV1 - # Response containing the transaction ID. - class TransactionId - # GUID assigned by Amazon to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfOrdersV1::TransactionId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfOrdersV1::TransactionId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfOrdersV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/version.rb b/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/version.rb deleted file mode 100644 index 2f4caf4..0000000 --- a/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVdfOrdersV1 - VERSION = '1.0.0' -end diff --git a/vendor/vdf_orders_v1/sp_vdf_orders_v1.gemspec b/vendor/vdf_orders_v1/sp_vdf_orders_v1.gemspec deleted file mode 100644 index beb77ac..0000000 --- a/vendor/vdf_orders_v1/sp_vdf_orders_v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Direct Fulfillment Orders - -#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vdf_orders_v1/version" - -Gem::Specification.new do |s| - s.name = "sp_vdf_orders_v1" - s.version = SpVdfOrdersV1::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Direct Fulfillment Orders Ruby Gem" - s.description = "The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vdf_shipping_v1/.gitignore b/vendor/vdf_shipping_v1/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vdf_shipping_v1/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vdf_shipping_v1/.rspec b/vendor/vdf_shipping_v1/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vdf_shipping_v1/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vdf_shipping_v1/.rubocop.yml b/vendor/vdf_shipping_v1/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vdf_shipping_v1/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vdf_shipping_v1/.swagger-codegen-ignore b/vendor/vdf_shipping_v1/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vdf_shipping_v1/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vdf_shipping_v1/.swagger-codegen/VERSION b/vendor/vdf_shipping_v1/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vdf_shipping_v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vdf_shipping_v1/Gemfile b/vendor/vdf_shipping_v1/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vdf_shipping_v1/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vdf_shipping_v1/README.md b/vendor/vdf_shipping_v1/README.md deleted file mode 100644 index 0bc64e1..0000000 --- a/vendor/vdf_shipping_v1/README.md +++ /dev/null @@ -1,237 +0,0 @@ -# sp_vdf_shipping_v1 - -SpVdfShippingV1 - the Ruby gem for the Selling Partner API for Direct Fulfillment Shipping - -The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vdf_shipping_v1.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vdf_shipping_v1-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vdf_shipping_v1-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vdf_shipping_v1', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vdf_shipping_v1', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vdf_shipping_v1' - -api_instance = SpVdfShippingV1::CustomerInvoicesApi.new -purchase_order_number = 'purchase_order_number_example' # String | Purchase order number of the shipment for which to return the invoice. - - -begin - result = api_instance.get_customer_invoice(purchase_order_number) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling CustomerInvoicesApi->get_customer_invoice: #{e}" -end - -api_instance = SpVdfShippingV1::CustomerInvoicesApi.new -created_after = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. -created_before = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. -opts = { - ship_from_party_id: 'ship_from_party_id_example', # String | The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses. - limit: 56, # Integer | The limit to the number of records returned - sort_order: 'sort_order_example', # String | Sort ASC or DESC by order creation date. - next_token: 'next_token_example' # String | Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call. -} - -begin - result = api_instance.get_customer_invoices(created_after, created_before, opts) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling CustomerInvoicesApi->get_customer_invoices: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingApi.new -purchase_order_number = 'purchase_order_number_example' # String | The purchaseOrderNumber for the packing slip you want. - - -begin - result = api_instance.get_packing_slip(purchase_order_number) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingApi->get_packing_slip: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingApi.new -created_after = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Packing slips that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. -created_before = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Packing slips that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. -opts = { - ship_from_party_id: 'ship_from_party_id_example', # String | The vendor warehouseId for order fulfillment. If not specified the result will contain orders for all warehouses. - limit: 56, # Integer | The limit to the number of records returned - sort_order: 'ASC', # String | Sort ASC or DESC by packing slip creation date. - next_token: 'next_token_example' # String | Used for pagination when there are more packing slips than the specified result size limit. The token value is returned in the previous API call. -} - -begin - result = api_instance.get_packing_slips(created_after, created_before, opts) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingApi->get_packing_slips: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingApi.new -body = SpVdfShippingV1::SubmitShipmentConfirmationsRequest.new # SubmitShipmentConfirmationsRequest | Request body containing the shipment confirmations data. - - -begin - result = api_instance.submit_shipment_confirmations(body) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingApi->submit_shipment_confirmations: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingApi.new -body = SpVdfShippingV1::SubmitShipmentStatusUpdatesRequest.new # SubmitShipmentStatusUpdatesRequest | Request body containing the shipment status update data. - - -begin - result = api_instance.submit_shipment_status_updates(body) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingApi->submit_shipment_status_updates: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingLabelsApi.new -purchase_order_number = 'purchase_order_number_example' # String | The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order. - - -begin - result = api_instance.get_shipping_label(purchase_order_number) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingLabelsApi->get_shipping_label: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingLabelsApi.new -created_after = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. -created_before = DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. -opts = { - ship_from_party_id: 'ship_from_party_id_example', # String | The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses. - limit: 56, # Integer | The limit to the number of records returned. - sort_order: 'ASC', # String | Sort ASC or DESC by order creation date. - next_token: 'next_token_example' # String | Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call. -} - -begin - result = api_instance.get_shipping_labels(created_after, created_before, opts) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingLabelsApi->get_shipping_labels: #{e}" -end - -api_instance = SpVdfShippingV1::VendorShippingLabelsApi.new -body = SpVdfShippingV1::SubmitShippingLabelsRequest.new # SubmitShippingLabelsRequest | Request body containing one or more shipping labels data. - - -begin - result = api_instance.submit_shipping_label_request(body) - p result -rescue SpVdfShippingV1::ApiError => e - puts "Exception when calling VendorShippingLabelsApi->submit_shipping_label_request: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVdfShippingV1::CustomerInvoicesApi* | [**get_customer_invoice**](docs/CustomerInvoicesApi.md#get_customer_invoice) | **GET** /vendor/directFulfillment/shipping/v1/customerInvoices/{purchaseOrderNumber} | -*SpVdfShippingV1::CustomerInvoicesApi* | [**get_customer_invoices**](docs/CustomerInvoicesApi.md#get_customer_invoices) | **GET** /vendor/directFulfillment/shipping/v1/customerInvoices | -*SpVdfShippingV1::VendorShippingApi* | [**get_packing_slip**](docs/VendorShippingApi.md#get_packing_slip) | **GET** /vendor/directFulfillment/shipping/v1/packingSlips/{purchaseOrderNumber} | -*SpVdfShippingV1::VendorShippingApi* | [**get_packing_slips**](docs/VendorShippingApi.md#get_packing_slips) | **GET** /vendor/directFulfillment/shipping/v1/packingSlips | -*SpVdfShippingV1::VendorShippingApi* | [**submit_shipment_confirmations**](docs/VendorShippingApi.md#submit_shipment_confirmations) | **POST** /vendor/directFulfillment/shipping/v1/shipmentConfirmations | -*SpVdfShippingV1::VendorShippingApi* | [**submit_shipment_status_updates**](docs/VendorShippingApi.md#submit_shipment_status_updates) | **POST** /vendor/directFulfillment/shipping/v1/shipmentStatusUpdates | -*SpVdfShippingV1::VendorShippingLabelsApi* | [**get_shipping_label**](docs/VendorShippingLabelsApi.md#get_shipping_label) | **GET** /vendor/directFulfillment/shipping/v1/shippingLabels/{purchaseOrderNumber} | -*SpVdfShippingV1::VendorShippingLabelsApi* | [**get_shipping_labels**](docs/VendorShippingLabelsApi.md#get_shipping_labels) | **GET** /vendor/directFulfillment/shipping/v1/shippingLabels | -*SpVdfShippingV1::VendorShippingLabelsApi* | [**submit_shipping_label_request**](docs/VendorShippingLabelsApi.md#submit_shipping_label_request) | **POST** /vendor/directFulfillment/shipping/v1/shippingLabels | - -## Documentation for Models - - - [SpVdfShippingV1::Address](docs/Address.md) - - [SpVdfShippingV1::Container](docs/Container.md) - - [SpVdfShippingV1::CustomerInvoice](docs/CustomerInvoice.md) - - [SpVdfShippingV1::CustomerInvoiceList](docs/CustomerInvoiceList.md) - - [SpVdfShippingV1::Decimal](docs/Decimal.md) - - [SpVdfShippingV1::Dimensions](docs/Dimensions.md) - - [SpVdfShippingV1::Error](docs/Error.md) - - [SpVdfShippingV1::ErrorList](docs/ErrorList.md) - - [SpVdfShippingV1::GetCustomerInvoiceResponse](docs/GetCustomerInvoiceResponse.md) - - [SpVdfShippingV1::GetCustomerInvoicesResponse](docs/GetCustomerInvoicesResponse.md) - - [SpVdfShippingV1::GetPackingSlipListResponse](docs/GetPackingSlipListResponse.md) - - [SpVdfShippingV1::GetPackingSlipResponse](docs/GetPackingSlipResponse.md) - - [SpVdfShippingV1::GetShippingLabelListResponse](docs/GetShippingLabelListResponse.md) - - [SpVdfShippingV1::GetShippingLabelResponse](docs/GetShippingLabelResponse.md) - - [SpVdfShippingV1::Item](docs/Item.md) - - [SpVdfShippingV1::ItemQuantity](docs/ItemQuantity.md) - - [SpVdfShippingV1::LabelData](docs/LabelData.md) - - [SpVdfShippingV1::PackedItem](docs/PackedItem.md) - - [SpVdfShippingV1::PackingSlip](docs/PackingSlip.md) - - [SpVdfShippingV1::PackingSlipList](docs/PackingSlipList.md) - - [SpVdfShippingV1::Pagination](docs/Pagination.md) - - [SpVdfShippingV1::PartyIdentification](docs/PartyIdentification.md) - - [SpVdfShippingV1::ShipmentConfirmation](docs/ShipmentConfirmation.md) - - [SpVdfShippingV1::ShipmentDetails](docs/ShipmentDetails.md) - - [SpVdfShippingV1::ShipmentStatusUpdate](docs/ShipmentStatusUpdate.md) - - [SpVdfShippingV1::ShippingLabel](docs/ShippingLabel.md) - - [SpVdfShippingV1::ShippingLabelList](docs/ShippingLabelList.md) - - [SpVdfShippingV1::ShippingLabelRequest](docs/ShippingLabelRequest.md) - - [SpVdfShippingV1::StatusUpdateDetails](docs/StatusUpdateDetails.md) - - [SpVdfShippingV1::StatusUpdateDetailsShipmentSchedule](docs/StatusUpdateDetailsShipmentSchedule.md) - - [SpVdfShippingV1::SubmitShipmentConfirmationsRequest](docs/SubmitShipmentConfirmationsRequest.md) - - [SpVdfShippingV1::SubmitShipmentConfirmationsResponse](docs/SubmitShipmentConfirmationsResponse.md) - - [SpVdfShippingV1::SubmitShipmentStatusUpdatesRequest](docs/SubmitShipmentStatusUpdatesRequest.md) - - [SpVdfShippingV1::SubmitShipmentStatusUpdatesResponse](docs/SubmitShipmentStatusUpdatesResponse.md) - - [SpVdfShippingV1::SubmitShippingLabelsRequest](docs/SubmitShippingLabelsRequest.md) - - [SpVdfShippingV1::SubmitShippingLabelsResponse](docs/SubmitShippingLabelsResponse.md) - - [SpVdfShippingV1::TaxRegistrationDetails](docs/TaxRegistrationDetails.md) - - [SpVdfShippingV1::TransactionReference](docs/TransactionReference.md) - - [SpVdfShippingV1::Weight](docs/Weight.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vdf_shipping_v1/Rakefile b/vendor/vdf_shipping_v1/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vdf_shipping_v1/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vdf_shipping_v1/git_push.sh b/vendor/vdf_shipping_v1/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vdf_shipping_v1/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_client.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_client.rb deleted file mode 100644 index 64e7c04..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVdfShippingV1 - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVdfShippingV1.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_error.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_error.rb deleted file mode 100644 index 170a62e..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfShippingV1 - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/configuration.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/configuration.rb deleted file mode 100644 index 1a7ba72..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVdfShippingV1 - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/address.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/address.rb deleted file mode 100644 index bfdab0a..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/address.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Address of the party. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of the address. - attr_accessor :address_line1 - - # Additional street address information, if required. - attr_accessor :address_line2 - - # Additional street address information, if required. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. - attr_accessor :city - - # The county where person, business or institution is located. - attr_accessor :county - - # The district where person, business or institution is located. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_code - - # The two digit country code in ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/container.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/container.rb deleted file mode 100644 index 83c6b50..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/container.rb +++ /dev/null @@ -1,376 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # A container used for shipping and packing items. - class Container - # The type of container. - attr_accessor :container_type - - # The container identifier. - attr_accessor :container_identifier - - # The tracking number. - attr_accessor :tracking_number - - # The manifest identifier. - attr_accessor :manifest_id - - # The date of the manifest. - attr_accessor :manifest_date - - # The shipment method. - attr_accessor :ship_method - - # SCAC code required for NA VOC vendors only. - attr_accessor :scac_code - - # Carrier required for EU VOC vendors only. - attr_accessor :carrier - - # An integer that must be submitted for multi-box shipments only, where one item may come in separate packages. - attr_accessor :container_sequence_number - - attr_accessor :dimensions - - attr_accessor :weight - - # A list of packed items. - attr_accessor :packed_items - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_type' => :'containerType', - :'container_identifier' => :'containerIdentifier', - :'tracking_number' => :'trackingNumber', - :'manifest_id' => :'manifestId', - :'manifest_date' => :'manifestDate', - :'ship_method' => :'shipMethod', - :'scac_code' => :'scacCode', - :'carrier' => :'carrier', - :'container_sequence_number' => :'containerSequenceNumber', - :'dimensions' => :'dimensions', - :'weight' => :'weight', - :'packed_items' => :'packedItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_type' => :'Object', - :'container_identifier' => :'Object', - :'tracking_number' => :'Object', - :'manifest_id' => :'Object', - :'manifest_date' => :'Object', - :'ship_method' => :'Object', - :'scac_code' => :'Object', - :'carrier' => :'Object', - :'container_sequence_number' => :'Object', - :'dimensions' => :'Object', - :'weight' => :'Object', - :'packed_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Container` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Container`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_type') - self.container_type = attributes[:'container_type'] - end - - if attributes.key?(:'container_identifier') - self.container_identifier = attributes[:'container_identifier'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'manifest_id') - self.manifest_id = attributes[:'manifest_id'] - end - - if attributes.key?(:'manifest_date') - self.manifest_date = attributes[:'manifest_date'] - end - - if attributes.key?(:'ship_method') - self.ship_method = attributes[:'ship_method'] - end - - if attributes.key?(:'scac_code') - self.scac_code = attributes[:'scac_code'] - end - - if attributes.key?(:'carrier') - self.carrier = attributes[:'carrier'] - end - - if attributes.key?(:'container_sequence_number') - self.container_sequence_number = attributes[:'container_sequence_number'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'packed_items') - if (value = attributes[:'packed_items']).is_a?(Array) - self.packed_items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @container_type.nil? - invalid_properties.push('invalid value for "container_type", container_type cannot be nil.') - end - - if @container_identifier.nil? - invalid_properties.push('invalid value for "container_identifier", container_identifier cannot be nil.') - end - - if @weight.nil? - invalid_properties.push('invalid value for "weight", weight cannot be nil.') - end - - if @packed_items.nil? - invalid_properties.push('invalid value for "packed_items", packed_items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @container_type.nil? - container_type_validator = EnumAttributeValidator.new('Object', ['carton', 'pallet']) - return false unless container_type_validator.valid?(@container_type) - return false if @container_identifier.nil? - return false if @weight.nil? - return false if @packed_items.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] container_type Object to be assigned - def container_type=(container_type) - validator = EnumAttributeValidator.new('Object', ['carton', 'pallet']) - unless validator.valid?(container_type) - fail ArgumentError, "invalid value for \"container_type\", must be one of #{validator.allowable_values}." - end - @container_type = container_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_type == o.container_type && - container_identifier == o.container_identifier && - tracking_number == o.tracking_number && - manifest_id == o.manifest_id && - manifest_date == o.manifest_date && - ship_method == o.ship_method && - scac_code == o.scac_code && - carrier == o.carrier && - container_sequence_number == o.container_sequence_number && - dimensions == o.dimensions && - weight == o.weight && - packed_items == o.packed_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_type, container_identifier, tracking_number, manifest_id, manifest_date, ship_method, scac_code, carrier, container_sequence_number, dimensions, weight, packed_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice.rb deleted file mode 100644 index 9faab4a..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents a customer invoice associated with a purchase order. - class CustomerInvoice - # The purchase order number for this order. - attr_accessor :purchase_order_number - - # The Base64encoded customer invoice. - attr_accessor :content - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'content' => :'content' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'content' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::CustomerInvoice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::CustomerInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'content') - self.content = attributes[:'content'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @content.nil? - invalid_properties.push('invalid value for "content", content cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @content.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - content == o.content - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, content].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice_list.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice_list.rb deleted file mode 100644 index 47340c1..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/customer_invoice_list.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents a list of customer invoices, potentially paginated. - class CustomerInvoiceList - attr_accessor :pagination - - # Represents a customer invoice within the CustomerInvoiceList. - attr_accessor :customer_invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'customer_invoices' => :'customerInvoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'customer_invoices' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::CustomerInvoiceList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::CustomerInvoiceList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'customer_invoices') - if (value = attributes[:'customer_invoices']).is_a?(Array) - self.customer_invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - customer_invoices == o.customer_invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, customer_invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/decimal.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/decimal.rb deleted file mode 100644 index 6c719a5..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
**Pattern** : `^-?(0|([1-9]\\\\d*))(\\\\.\\\\d+)?([eE][+-]?\\\\d+)?$`. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/dimensions.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/dimensions.rb deleted file mode 100644 index 93af5c9..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/dimensions.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Physical dimensional measurements of a container. - class Dimensions - attr_accessor :length - - attr_accessor :width - - attr_accessor :height - - # The unit of measure for dimensions. - attr_accessor :unit_of_measure - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'length', - :'width' => :'width', - :'height' => :'height', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Object', - :'width' => :'Object', - :'height' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Dimensions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Dimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @length.nil? - invalid_properties.push('invalid value for "length", length cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - if @height.nil? - invalid_properties.push('invalid value for "height", height cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @length.nil? - return false if @width.nil? - return false if @height.nil? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['IN', 'CM']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['IN', 'CM']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length && - width == o.width && - height == o.height && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length, width, height, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error.rb deleted file mode 100644 index c053f30..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error_list.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error_list.rb deleted file mode 100644 index a08877b..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoice_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoice_response.rb deleted file mode 100644 index 55119fd..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoice_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the getCustomerInvoice operation. - class GetCustomerInvoiceResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetCustomerInvoiceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetCustomerInvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoices_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoices_response.rb deleted file mode 100644 index 1d46f47..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_customer_invoices_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the getCustomerInvoices operation. - class GetCustomerInvoicesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetCustomerInvoicesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetCustomerInvoicesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_list_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_list_response.rb deleted file mode 100644 index 77082b5..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_list_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Response payload with the list of Packing Slips. - class GetPackingSlipListResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetPackingSlipListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetPackingSlipListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_response.rb deleted file mode 100644 index 49d04d7..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_packing_slip_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Response payload with packing slip. - class GetPackingSlipResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetPackingSlipResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetPackingSlipResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_list_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_list_response.rb deleted file mode 100644 index 73fb019..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_list_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the getShippingLabels operation. - class GetShippingLabelListResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetShippingLabelListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetShippingLabelListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_response.rb deleted file mode 100644 index 1031a88..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/get_shipping_label_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the getShippingLabel operation. - class GetShippingLabelResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::GetShippingLabelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::GetShippingLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item.rb deleted file mode 100644 index 7eb6c32..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details of the item being shipped. - class Item - # Item Sequence Number for the item. This must be the same value as sent in order for a given item. - attr_accessor :item_sequence_number - - # Buyer's Standard Identification Number (ASIN) of an item. Either buyerProductIdentifier or vendorProductIdentifier is required. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the purchase order, like SKU Number. - attr_accessor :vendor_product_identifier - - attr_accessor :shipped_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'shipped_quantity' => :'shippedQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'shipped_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'shipped_quantity') - self.shipped_quantity = attributes[:'shipped_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @shipped_quantity.nil? - invalid_properties.push('invalid value for "shipped_quantity", shipped_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @shipped_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - shipped_quantity == o.shipped_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, shipped_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item_quantity.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item_quantity.rb deleted file mode 100644 index 5bdc0e2..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/item_quantity.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details of item quantity. - class ItemQuantity - # Quantity of units shipped for a specific item at a shipment level. If the item is present only in certain packages or pallets within the shipment, please provide this at the appropriate package or pallet level. - attr_accessor :amount - - # Unit of measure for the shipped quantity. - attr_accessor :unit_of_measure - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @unit_of_measure.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/label_data.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/label_data.rb deleted file mode 100644 index 6e6b718..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/label_data.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details of the shipment label. - class LabelData - # Identifier for the package. The first package will be 001, the second 002, and so on. This number is used as a reference to refer to this package from the pallet level. - attr_accessor :package_identifier - - # Package tracking identifier from the shipping carrier. - attr_accessor :tracking_number - - # Ship method to be used for shipping the order. Amazon defines Ship Method Codes indicating shipping carrier and shipment service level. Ship Method Codes are case and format sensitive. The same ship method code should returned on the shipment confirmation. Note that the Ship Method Codes are vendor specific and will be provided to each vendor during the implementation. - attr_accessor :ship_method - - # Shipping method name for internal reference. - attr_accessor :ship_method_name - - # This field will contain the Base64encoded string of the shipment label content. - attr_accessor :content - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'package_identifier' => :'packageIdentifier', - :'tracking_number' => :'trackingNumber', - :'ship_method' => :'shipMethod', - :'ship_method_name' => :'shipMethodName', - :'content' => :'content' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'package_identifier' => :'Object', - :'tracking_number' => :'Object', - :'ship_method' => :'Object', - :'ship_method_name' => :'Object', - :'content' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::LabelData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::LabelData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'package_identifier') - self.package_identifier = attributes[:'package_identifier'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'ship_method') - self.ship_method = attributes[:'ship_method'] - end - - if attributes.key?(:'ship_method_name') - self.ship_method_name = attributes[:'ship_method_name'] - end - - if attributes.key?(:'content') - self.content = attributes[:'content'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @content.nil? - invalid_properties.push('invalid value for "content", content cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @content.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - package_identifier == o.package_identifier && - tracking_number == o.tracking_number && - ship_method == o.ship_method && - ship_method_name == o.ship_method_name && - content == o.content - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [package_identifier, tracking_number, ship_method, ship_method_name, content].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packed_item.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packed_item.rb deleted file mode 100644 index 32853f1..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packed_item.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents an item that has been packed into a container for shipping. - class PackedItem - # Item Sequence Number for the item. This must be the same value as sent in the order for a given item. - attr_accessor :item_sequence_number - - # Buyer's Standard Identification Number (ASIN) of an item. Either buyerProductIdentifier or vendorProductIdentifier is required. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the Purchase Order, like SKU Number. - attr_accessor :vendor_product_identifier - - attr_accessor :packed_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'packed_quantity' => :'packedQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'packed_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::PackedItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::PackedItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'packed_quantity') - self.packed_quantity = attributes[:'packed_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @packed_quantity.nil? - invalid_properties.push('invalid value for "packed_quantity", packed_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @packed_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - packed_quantity == o.packed_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, packed_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip.rb deleted file mode 100644 index 0da850d..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Packing slip information. - class PackingSlip - # Purchase order number of the shipment that corresponds to the packing slip. - attr_accessor :purchase_order_number - - # A Base64encoded string of the packing slip PDF. - attr_accessor :content - - # The format of the file such as PDF, JPEG etc. - attr_accessor :content_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'content' => :'content', - :'content_type' => :'contentType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'content' => :'Object', - :'content_type' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::PackingSlip` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::PackingSlip`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'content') - self.content = attributes[:'content'] - end - - if attributes.key?(:'content_type') - self.content_type = attributes[:'content_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @content.nil? - invalid_properties.push('invalid value for "content", content cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @content.nil? - content_type_validator = EnumAttributeValidator.new('Object', ['application/pdf']) - return false unless content_type_validator.valid?(@content_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] content_type Object to be assigned - def content_type=(content_type) - validator = EnumAttributeValidator.new('Object', ['application/pdf']) - unless validator.valid?(content_type) - fail ArgumentError, "invalid value for \"content_type\", must be one of #{validator.allowable_values}." - end - @content_type = content_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - content == o.content && - content_type == o.content_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, content, content_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip_list.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip_list.rb deleted file mode 100644 index 8430262..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/packing_slip_list.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # A list of packing slips. - class PackingSlipList - attr_accessor :pagination - - # An array of packing slip objects. - attr_accessor :packing_slips - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'packing_slips' => :'packingSlips' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'packing_slips' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::PackingSlipList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::PackingSlipList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'packing_slips') - if (value = attributes[:'packing_slips']).is_a?(Array) - self.packing_slips = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - packing_slips == o.packing_slips - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, packing_slips].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/pagination.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/pagination.rb deleted file mode 100644 index f72752c..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/pagination.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The pagination elements required to retrieve the remaining data. - class Pagination - # A generated string used to pass information to your next request. If NextToken is returned, pass the value of NextToken to the next request. If NextToken is not returned, there are no more order items to return. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/party_identification.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/party_identification.rb deleted file mode 100644 index 2c7616a..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/party_identification.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Name, address and tax details of a party. - class PartyIdentification - # Assigned Identification for the party. - attr_accessor :party_id - - attr_accessor :address - - # Tax registration details of the entity. - attr_accessor :tax_registration_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId', - :'address' => :'address', - :'tax_registration_details' => :'taxRegistrationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object', - :'address' => :'Object', - :'tax_registration_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_registration_details') - if (value = attributes[:'tax_registration_details']).is_a?(Array) - self.tax_registration_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id && - address == o.address && - tax_registration_details == o.tax_registration_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id, address, tax_registration_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_confirmation.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_confirmation.rb deleted file mode 100644 index 032c7c6..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_confirmation.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents the confirmation details of a shipment, including the purchase order number and other shipment details. - class ShipmentConfirmation - # Purchase order number corresponding to the shipment. - attr_accessor :purchase_order_number - - attr_accessor :shipment_details - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - # Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package. - attr_accessor :items - - # Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package. - attr_accessor :containers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'shipment_details' => :'shipmentDetails', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'items' => :'items', - :'containers' => :'containers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'shipment_details' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'items' => :'Object', - :'containers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShipmentConfirmation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShipmentConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'shipment_details') - self.shipment_details = attributes[:'shipment_details'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'containers') - if (value = attributes[:'containers']).is_a?(Array) - self.containers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @shipment_details.nil? - invalid_properties.push('invalid value for "shipment_details", shipment_details cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @shipment_details.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - shipment_details == o.shipment_details && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - items == o.items && - containers == o.containers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, shipment_details, selling_party, ship_from_party, items, containers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_details.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_details.rb deleted file mode 100644 index d0f086c..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_details.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details about a shipment. - class ShipmentDetails - # This field indicates the date of the departure of the shipment from vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the Amazon destination warehouse, whichever is sooner. Shipped date mentioned in the Shipment Confirmation should not be in the future. - attr_accessor :shipped_date - - # Indicate the shipment status. - attr_accessor :shipment_status - - # Provide the priority of the shipment. - attr_accessor :is_priority_shipment - - # The vendor order number is a unique identifier generated by a vendor for their reference. - attr_accessor :vendor_order_number - - # Date on which the shipment is expected to reach the buyer's warehouse. It needs to be an estimate based on the average transit time between the ship-from location and the destination. The exact appointment time will be provided by buyer and is potentially not known when creating the shipment confirmation. - attr_accessor :estimated_delivery_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipped_date' => :'shippedDate', - :'shipment_status' => :'shipmentStatus', - :'is_priority_shipment' => :'isPriorityShipment', - :'vendor_order_number' => :'vendorOrderNumber', - :'estimated_delivery_date' => :'estimatedDeliveryDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipped_date' => :'Object', - :'shipment_status' => :'Object', - :'is_priority_shipment' => :'Object', - :'vendor_order_number' => :'Object', - :'estimated_delivery_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShipmentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShipmentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipped_date') - self.shipped_date = attributes[:'shipped_date'] - end - - if attributes.key?(:'shipment_status') - self.shipment_status = attributes[:'shipment_status'] - end - - if attributes.key?(:'is_priority_shipment') - self.is_priority_shipment = attributes[:'is_priority_shipment'] - end - - if attributes.key?(:'vendor_order_number') - self.vendor_order_number = attributes[:'vendor_order_number'] - end - - if attributes.key?(:'estimated_delivery_date') - self.estimated_delivery_date = attributes[:'estimated_delivery_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipped_date.nil? - invalid_properties.push('invalid value for "shipped_date", shipped_date cannot be nil.') - end - - if @shipment_status.nil? - invalid_properties.push('invalid value for "shipment_status", shipment_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipped_date.nil? - return false if @shipment_status.nil? - shipment_status_validator = EnumAttributeValidator.new('Object', ['SHIPPED', 'FLOOR_DENIAL']) - return false unless shipment_status_validator.valid?(@shipment_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_status Object to be assigned - def shipment_status=(shipment_status) - validator = EnumAttributeValidator.new('Object', ['SHIPPED', 'FLOOR_DENIAL']) - unless validator.valid?(shipment_status) - fail ArgumentError, "invalid value for \"shipment_status\", must be one of #{validator.allowable_values}." - end - @shipment_status = shipment_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipped_date == o.shipped_date && - shipment_status == o.shipment_status && - is_priority_shipment == o.is_priority_shipment && - vendor_order_number == o.vendor_order_number && - estimated_delivery_date == o.estimated_delivery_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipped_date, shipment_status, is_priority_shipment, vendor_order_number, estimated_delivery_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_status_update.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_status_update.rb deleted file mode 100644 index 800f622..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipment_status_update.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents an update to the status of a shipment. - class ShipmentStatusUpdate - # Purchase order number of the shipment for which to update the shipment status. - attr_accessor :purchase_order_number - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - attr_accessor :status_update_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'status_update_details' => :'statusUpdateDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'status_update_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShipmentStatusUpdate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShipmentStatusUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'status_update_details') - self.status_update_details = attributes[:'status_update_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @status_update_details.nil? - invalid_properties.push('invalid value for "status_update_details", status_update_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @status_update_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - status_update_details == o.status_update_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, selling_party, ship_from_party, status_update_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label.rb deleted file mode 100644 index e0ced37..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label.rb +++ /dev/null @@ -1,311 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Shipping label information for an order, including the purchase order number, selling party, ship from party, label format, and package details. - class ShippingLabel - # This field will contain the Purchase Order Number for this order. - attr_accessor :purchase_order_number - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - # Format of the label. - attr_accessor :label_format - - # Provides the details of the packages in this shipment. - attr_accessor :label_data - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'label_format' => :'labelFormat', - :'label_data' => :'labelData' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'label_format' => :'Object', - :'label_data' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShippingLabel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShippingLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - - if attributes.key?(:'label_data') - if (value = attributes[:'label_data']).is_a?(Array) - self.label_data = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @label_format.nil? - invalid_properties.push('invalid value for "label_format", label_format cannot be nil.') - end - - if @label_data.nil? - invalid_properties.push('invalid value for "label_data", label_data cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @label_format.nil? - label_format_validator = EnumAttributeValidator.new('Object', ['PNG', 'ZPL']) - return false unless label_format_validator.valid?(@label_format) - return false if @label_data.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] label_format Object to be assigned - def label_format=(label_format) - validator = EnumAttributeValidator.new('Object', ['PNG', 'ZPL']) - unless validator.valid?(label_format) - fail ArgumentError, "invalid value for \"label_format\", must be one of #{validator.allowable_values}." - end - @label_format = label_format - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - label_format == o.label_format && - label_data == o.label_data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, selling_party, ship_from_party, label_format, label_data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_list.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_list.rb deleted file mode 100644 index 53f81bf..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_list.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Response payload with the list of shipping labels - class ShippingLabelList - attr_accessor :pagination - - # An array containing the details of the generated shipping labels. - attr_accessor :shipping_labels - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'shipping_labels' => :'shippingLabels' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'shipping_labels' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShippingLabelList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShippingLabelList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'shipping_labels') - if (value = attributes[:'shipping_labels']).is_a?(Array) - self.shipping_labels = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - shipping_labels == o.shipping_labels - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, shipping_labels].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_request.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_request.rb deleted file mode 100644 index 43ffa95..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/shipping_label_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents the request payload for creating a shipping label, containing the purchase order number, selling party, ship from party, and a list of containers or packages in the shipment. - class ShippingLabelRequest - # Purchase order number of the order for which to create a shipping label. - attr_accessor :purchase_order_number - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - # A list of the packages in this shipment. - attr_accessor :containers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'containers' => :'containers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'containers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::ShippingLabelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::ShippingLabelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'containers') - if (value = attributes[:'containers']).is_a?(Array) - self.containers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - containers == o.containers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, selling_party, ship_from_party, containers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details.rb deleted file mode 100644 index 5e9de69..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details for the shipment status update given by the vendor for the specific package. - class StatusUpdateDetails - # This is required to be provided for every package and should match with the trackingNumber sent for the shipment confirmation. - attr_accessor :tracking_number - - # Indicates the shipment status code of the package that provides transportation information for Amazon tracking systems and ultimately for the final customer. For more information, refer to the [Additional Fields Explanation](https://developer-docs.amazon.com/sp-api/docs/vendor-direct-fulfillment-shipping-api-use-case-guide#additional-fields-explanation). - attr_accessor :status_code - - # Provides a reason code for the status of the package that will provide additional information about the transportation status. For more information, refer to the [Additional Fields Explanation](https://developer-docs.amazon.com/sp-api/docs/vendor-direct-fulfillment-shipping-api-use-case-guide#additional-fields-explanation). - attr_accessor :reason_code - - # The date and time when the shipment status was updated. This field is expected to be in ISO-8601 date/time format, with UTC time zone or UTC offset. For example, 2020-07-16T23:00:00Z or 2020-07-16T23:00:00+01:00. - attr_accessor :status_date_time - - attr_accessor :status_location_address - - attr_accessor :shipment_schedule - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_number' => :'trackingNumber', - :'status_code' => :'statusCode', - :'reason_code' => :'reasonCode', - :'status_date_time' => :'statusDateTime', - :'status_location_address' => :'statusLocationAddress', - :'shipment_schedule' => :'shipmentSchedule' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_number' => :'Object', - :'status_code' => :'Object', - :'reason_code' => :'Object', - :'status_date_time' => :'Object', - :'status_location_address' => :'Object', - :'shipment_schedule' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::StatusUpdateDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::StatusUpdateDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'status_code') - self.status_code = attributes[:'status_code'] - end - - if attributes.key?(:'reason_code') - self.reason_code = attributes[:'reason_code'] - end - - if attributes.key?(:'status_date_time') - self.status_date_time = attributes[:'status_date_time'] - end - - if attributes.key?(:'status_location_address') - self.status_location_address = attributes[:'status_location_address'] - end - - if attributes.key?(:'shipment_schedule') - self.shipment_schedule = attributes[:'shipment_schedule'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tracking_number.nil? - invalid_properties.push('invalid value for "tracking_number", tracking_number cannot be nil.') - end - - if @status_code.nil? - invalid_properties.push('invalid value for "status_code", status_code cannot be nil.') - end - - if @reason_code.nil? - invalid_properties.push('invalid value for "reason_code", reason_code cannot be nil.') - end - - if @status_date_time.nil? - invalid_properties.push('invalid value for "status_date_time", status_date_time cannot be nil.') - end - - if @status_location_address.nil? - invalid_properties.push('invalid value for "status_location_address", status_location_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tracking_number.nil? - return false if @status_code.nil? - return false if @reason_code.nil? - return false if @status_date_time.nil? - return false if @status_location_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_number == o.tracking_number && - status_code == o.status_code && - reason_code == o.reason_code && - status_date_time == o.status_date_time && - status_location_address == o.status_location_address && - shipment_schedule == o.shipment_schedule - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_number, status_code, reason_code, status_date_time, status_location_address, shipment_schedule].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details_shipment_schedule.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details_shipment_schedule.rb deleted file mode 100644 index 13ef06c..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/status_update_details_shipment_schedule.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Details for the scheduled delivery timeline for a shipment, including the estimated delivery date and time, as well as the start and end times of the appointment window for delivery. - class StatusUpdateDetailsShipmentSchedule - # Date on which the shipment is expected to reach the customer delivery location. This field is expected to be in ISO-8601 date/time format, with UTC time zone or UTC offset. For example, 2020-07-16T23:00:00Z or 2020-07-16T23:00:00+01:00. - attr_accessor :estimated_delivery_date_time - - # This field indicates the date and time at the start of the appointment window scheduled to deliver the shipment. This field is expected to be in ISO-8601 date/time format, with UTC time zone or UTC offset. For example, 2020-07-16T23:00:00Z or 2020-07-16T23:00:00+01:00. - attr_accessor :appt_window_start_date_time - - # This field indicates the date and time at the end of the appointment window scheduled to deliver the shipment. This field is expected to be in ISO-8601 date/time format, with UTC time zone or UTC offset. For example, 2020-07-16T23:00:00Z or 2020-07-16T23:00:00+01:00. - attr_accessor :appt_window_end_date_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'estimated_delivery_date_time' => :'estimatedDeliveryDateTime', - :'appt_window_start_date_time' => :'apptWindowStartDateTime', - :'appt_window_end_date_time' => :'apptWindowEndDateTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'estimated_delivery_date_time' => :'Object', - :'appt_window_start_date_time' => :'Object', - :'appt_window_end_date_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::StatusUpdateDetailsShipmentSchedule` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::StatusUpdateDetailsShipmentSchedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'estimated_delivery_date_time') - self.estimated_delivery_date_time = attributes[:'estimated_delivery_date_time'] - end - - if attributes.key?(:'appt_window_start_date_time') - self.appt_window_start_date_time = attributes[:'appt_window_start_date_time'] - end - - if attributes.key?(:'appt_window_end_date_time') - self.appt_window_end_date_time = attributes[:'appt_window_end_date_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - estimated_delivery_date_time == o.estimated_delivery_date_time && - appt_window_start_date_time == o.appt_window_start_date_time && - appt_window_end_date_time == o.appt_window_end_date_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [estimated_delivery_date_time, appt_window_start_date_time, appt_window_end_date_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_request.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_request.rb deleted file mode 100644 index dcf01b3..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The request schema for the submitShipmentConfirmations operation. - class SubmitShipmentConfirmationsRequest - # Array of ShipmentConfirmation objects, each representing confirmation details for a specific shipment. - attr_accessor :shipment_confirmations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_confirmations' => :'shipmentConfirmations' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_confirmations' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentConfirmationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentConfirmationsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_confirmations') - if (value = attributes[:'shipment_confirmations']).is_a?(Array) - self.shipment_confirmations = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_confirmations == o.shipment_confirmations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_confirmations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_response.rb deleted file mode 100644 index 4490321..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_confirmations_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the submitShipmentConfirmations operation. - class SubmitShipmentConfirmationsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentConfirmationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentConfirmationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_request.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_request.rb deleted file mode 100644 index 0b8b0a5..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Represents the request payload for submitting updates to the status of shipments, containing an array of one or more ShipmentStatusUpdate objects. - class SubmitShipmentStatusUpdatesRequest - # Contains a list of one or more ShipmentStatusUpdate objects, each representing an update to the status of a specific shipment. - attr_accessor :shipment_status_updates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_status_updates' => :'shipmentStatusUpdates' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_status_updates' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentStatusUpdatesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentStatusUpdatesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_status_updates') - if (value = attributes[:'shipment_status_updates']).is_a?(Array) - self.shipment_status_updates = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_status_updates == o.shipment_status_updates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_status_updates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_response.rb deleted file mode 100644 index 191dfd5..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipment_status_updates_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the submitShipmentStatusUpdates operation. - class SubmitShipmentStatusUpdatesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentStatusUpdatesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShipmentStatusUpdatesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_request.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_request.rb deleted file mode 100644 index 905eb39..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The request schema for the submitShippingLabelRequest operation. - class SubmitShippingLabelsRequest - # An array of shipping label requests to be processed. - attr_accessor :shipping_label_requests - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipping_label_requests' => :'shippingLabelRequests' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipping_label_requests' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShippingLabelsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShippingLabelsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipping_label_requests') - if (value = attributes[:'shipping_label_requests']).is_a?(Array) - self.shipping_label_requests = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipping_label_requests == o.shipping_label_requests - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipping_label_requests].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_response.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_response.rb deleted file mode 100644 index 159e9c6..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/submit_shipping_labels_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The response schema for the submitShippingLabelRequest operation. - class SubmitShippingLabelsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::SubmitShippingLabelsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::SubmitShippingLabelsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/tax_registration_details.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/tax_registration_details.rb deleted file mode 100644 index 88a024b..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/tax_registration_details.rb +++ /dev/null @@ -1,280 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Tax registration details of the entity. - class TaxRegistrationDetails - # Tax registration type for the entity. - attr_accessor :tax_registration_type - - # Tax registration number for the party. For example, VAT ID. - attr_accessor :tax_registration_number - - attr_accessor :tax_registration_address - - # Tax registration message that can be used for additional tax related details. - attr_accessor :tax_registration_messages - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber', - :'tax_registration_address' => :'taxRegistrationAddress', - :'tax_registration_messages' => :'taxRegistrationMessages' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object', - :'tax_registration_address' => :'Object', - :'tax_registration_messages' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::TaxRegistrationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::TaxRegistrationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - - if attributes.key?(:'tax_registration_address') - self.tax_registration_address = attributes[:'tax_registration_address'] - end - - if attributes.key?(:'tax_registration_messages') - self.tax_registration_messages = attributes[:'tax_registration_messages'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number && - tax_registration_address == o.tax_registration_address && - tax_registration_messages == o.tax_registration_messages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number, tax_registration_address, tax_registration_messages].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/transaction_reference.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/transaction_reference.rb deleted file mode 100644 index a8bf19d..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/transaction_reference.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # Response containing the transaction ID. - class TransactionReference - # GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::TransactionReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::TransactionReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/weight.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/weight.rb deleted file mode 100644 index 619d897..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/models/weight.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVdfShippingV1 - # The weight. - class Weight - # The unit of measurement. - attr_accessor :unit_of_measure - - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVdfShippingV1::Weight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVdfShippingV1::Weight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['KG', 'LB']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['KG', 'LB']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVdfShippingV1.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/version.rb b/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/version.rb deleted file mode 100644 index 51059bd..0000000 --- a/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVdfShippingV1 - VERSION = '1.0.0' -end diff --git a/vendor/vdf_shipping_v1/sp_vdf_shipping_v1.gemspec b/vendor/vdf_shipping_v1/sp_vdf_shipping_v1.gemspec deleted file mode 100644 index 8faba35..0000000 --- a/vendor/vdf_shipping_v1/sp_vdf_shipping_v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Direct Fulfillment Shipping - -#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vdf_shipping_v1/version" - -Gem::Specification.new do |s| - s.name = "sp_vdf_shipping_v1" - s.version = SpVdfShippingV1::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Direct Fulfillment Shipping Ruby Gem" - s.description = "The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vendor_invoices/.gitignore b/vendor/vendor_invoices/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vendor_invoices/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vendor_invoices/.rspec b/vendor/vendor_invoices/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vendor_invoices/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vendor_invoices/.rubocop.yml b/vendor/vendor_invoices/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vendor_invoices/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vendor_invoices/.swagger-codegen-ignore b/vendor/vendor_invoices/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vendor_invoices/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vendor_invoices/.swagger-codegen/VERSION b/vendor/vendor_invoices/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vendor_invoices/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vendor_invoices/Gemfile b/vendor/vendor_invoices/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vendor_invoices/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vendor_invoices/README.md b/vendor/vendor_invoices/README.md deleted file mode 100644 index 18e37c0..0000000 --- a/vendor/vendor_invoices/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# sp_vendor_invoices - -SpVendorInvoices - the Ruby gem for the Selling Partner API for Retail Procurement Payments - -The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vendor_invoices.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vendor_invoices-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vendor_invoices-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vendor_invoices', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vendor_invoices', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vendor_invoices' - -api_instance = SpVendorInvoices::VendorPaymentsApi.new -body = SpVendorInvoices::SubmitInvoicesRequest.new # SubmitInvoicesRequest | The request body containing the invoice data to submit. - - -begin - result = api_instance.submit_invoices(body) - p result -rescue SpVendorInvoices::ApiError => e - puts "Exception when calling VendorPaymentsApi->submit_invoices: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVendorInvoices::VendorPaymentsApi* | [**submit_invoices**](docs/VendorPaymentsApi.md#submit_invoices) | **POST** /vendor/payments/v1/invoices | - -## Documentation for Models - - - [SpVendorInvoices::AdditionalDetails](docs/AdditionalDetails.md) - - [SpVendorInvoices::Address](docs/Address.md) - - [SpVendorInvoices::AllowanceDetails](docs/AllowanceDetails.md) - - [SpVendorInvoices::ChargeDetails](docs/ChargeDetails.md) - - [SpVendorInvoices::CreditNoteDetails](docs/CreditNoteDetails.md) - - [SpVendorInvoices::DateTime](docs/DateTime.md) - - [SpVendorInvoices::Decimal](docs/Decimal.md) - - [SpVendorInvoices::Error](docs/Error.md) - - [SpVendorInvoices::ErrorList](docs/ErrorList.md) - - [SpVendorInvoices::Invoice](docs/Invoice.md) - - [SpVendorInvoices::InvoiceItem](docs/InvoiceItem.md) - - [SpVendorInvoices::ItemQuantity](docs/ItemQuantity.md) - - [SpVendorInvoices::Money](docs/Money.md) - - [SpVendorInvoices::NetCostUnitOfMeasure](docs/NetCostUnitOfMeasure.md) - - [SpVendorInvoices::PartyIdentification](docs/PartyIdentification.md) - - [SpVendorInvoices::PaymentTerms](docs/PaymentTerms.md) - - [SpVendorInvoices::SubmitInvoicesRequest](docs/SubmitInvoicesRequest.md) - - [SpVendorInvoices::SubmitInvoicesResponse](docs/SubmitInvoicesResponse.md) - - [SpVendorInvoices::TaxDetails](docs/TaxDetails.md) - - [SpVendorInvoices::TaxRegistrationDetails](docs/TaxRegistrationDetails.md) - - [SpVendorInvoices::TotalWeight](docs/TotalWeight.md) - - [SpVendorInvoices::TransactionId](docs/TransactionId.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vendor_invoices/Rakefile b/vendor/vendor_invoices/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vendor_invoices/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vendor_invoices/git_push.sh b/vendor/vendor_invoices/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vendor_invoices/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/api_client.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/api_client.rb deleted file mode 100644 index 4c2b2a8..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVendorInvoices - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVendorInvoices.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/api_error.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/api_error.rb deleted file mode 100644 index 6ebdf11..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorInvoices - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/configuration.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/configuration.rb deleted file mode 100644 index 25af8d2..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorInvoices - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/additional_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/additional_details.rb deleted file mode 100644 index f3aa480..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/additional_details.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Additional information provided by the selling party for tax-related or any other purpose. - class AdditionalDetails - # The type of the additional information provided by the selling party. - attr_accessor :type - - # The detail of the additional information provided by the selling party. - attr_accessor :detail - - # The language code of the additional information detail. - attr_accessor :language_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'detail' => :'detail', - :'language_code' => :'languageCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'detail' => :'Object', - :'language_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::AdditionalDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::AdditionalDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - - if attributes.key?(:'language_code') - self.language_code = attributes[:'language_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @detail.nil? - invalid_properties.push('invalid value for "detail", detail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['SUR', 'OCR', 'CartonCount']) - return false unless type_validator.valid?(@type) - return false if @detail.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['SUR', 'OCR', 'CartonCount']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - detail == o.detail && - language_code == o.language_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, detail, language_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/address.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/address.rb deleted file mode 100644 index 885bd74..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/address.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # A physical address. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of street address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. - attr_accessor :city - - # The county where person, business or institution is located. - attr_accessor :county - - # The district where person, business or institution is located. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal or zip code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_or_zip_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_or_zip_code' => :'postalOrZipCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_or_zip_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_or_zip_code') - self.postal_or_zip_code = attributes[:'postal_or_zip_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_or_zip_code == o.postal_or_zip_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_or_zip_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/allowance_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/allowance_details.rb deleted file mode 100644 index 47eece2..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/allowance_details.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Monetary and tax details of the allowance. - class AllowanceDetails - # Type of the allowance applied. - attr_accessor :type - - # Description of the allowance. - attr_accessor :description - - attr_accessor :allowance_amount - - # Tax amount details applied on this allowance. - attr_accessor :tax_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'description' => :'description', - :'allowance_amount' => :'allowanceAmount', - :'tax_details' => :'taxDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'description' => :'Object', - :'allowance_amount' => :'Object', - :'tax_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::AllowanceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::AllowanceDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'allowance_amount') - self.allowance_amount = attributes[:'allowance_amount'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @allowance_amount.nil? - invalid_properties.push('invalid value for "allowance_amount", allowance_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['Discount', 'DiscountIncentive', 'Defective', 'Promotional', 'UnsaleableMerchandise', 'Special']) - return false unless type_validator.valid?(@type) - return false if @allowance_amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['Discount', 'DiscountIncentive', 'Defective', 'Promotional', 'UnsaleableMerchandise', 'Special']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - description == o.description && - allowance_amount == o.allowance_amount && - tax_details == o.tax_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, description, allowance_amount, tax_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/charge_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/charge_details.rb deleted file mode 100644 index b8818f9..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/charge_details.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Monetary and tax details of the charge. - class ChargeDetails - # Type of the charge applied. - attr_accessor :type - - # Description of the charge. - attr_accessor :description - - attr_accessor :charge_amount - - # Tax amount details applied on this charge. - attr_accessor :tax_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'description' => :'description', - :'charge_amount' => :'chargeAmount', - :'tax_details' => :'taxDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'description' => :'Object', - :'charge_amount' => :'Object', - :'tax_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::ChargeDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::ChargeDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'charge_amount') - self.charge_amount = attributes[:'charge_amount'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @charge_amount.nil? - invalid_properties.push('invalid value for "charge_amount", charge_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('Object', ['Freight', 'Packing', 'Duty', 'Service', 'SmallOrder', 'InsurancePlacementCost', 'InsuranceFee', 'SpecialHandlingService', 'CollectionAndRecyclingService', 'EnvironmentalProtectionService', 'TaxCollectedAtSource']) - return false unless type_validator.valid?(@type) - return false if @charge_amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['Freight', 'Packing', 'Duty', 'Service', 'SmallOrder', 'InsurancePlacementCost', 'InsuranceFee', 'SpecialHandlingService', 'CollectionAndRecyclingService', 'EnvironmentalProtectionService', 'TaxCollectedAtSource']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - description == o.description && - charge_amount == o.charge_amount && - tax_details == o.tax_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, description, charge_amount, tax_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/credit_note_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/credit_note_details.rb deleted file mode 100644 index 52a2633..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/credit_note_details.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # References required in order to process a credit note. This information is required only if InvoiceType is CreditNote. - class CreditNoteDetails - # Original Invoice Number when sending a credit note relating to an existing invoice. One Invoice only to be processed per Credit Note. This is mandatory for AP Credit Notes. - attr_accessor :reference_invoice_number - - # Debit Note Number as generated by Amazon. Recommended for Returns and COOP Credit Notes. - attr_accessor :debit_note_number - - # Identifies the Returns Notice Number. Mandatory for all Returns Credit Notes. - attr_accessor :returns_reference_number - - attr_accessor :goods_return_date - - # Identifies the Returned Merchandise Authorization ID, if generated. - attr_accessor :rma_id - - # Identifies the COOP reference used for COOP agreement. Failure to provide the COOP reference number or the Debit Note number may lead to a rejection of the Credit Note. - attr_accessor :coop_reference_number - - # Identifies the consignor reference number (VRET number), if generated by Amazon. - attr_accessor :consignors_reference_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reference_invoice_number' => :'referenceInvoiceNumber', - :'debit_note_number' => :'debitNoteNumber', - :'returns_reference_number' => :'returnsReferenceNumber', - :'goods_return_date' => :'goodsReturnDate', - :'rma_id' => :'rmaId', - :'coop_reference_number' => :'coopReferenceNumber', - :'consignors_reference_number' => :'consignorsReferenceNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reference_invoice_number' => :'Object', - :'debit_note_number' => :'Object', - :'returns_reference_number' => :'Object', - :'goods_return_date' => :'Object', - :'rma_id' => :'Object', - :'coop_reference_number' => :'Object', - :'consignors_reference_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::CreditNoteDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::CreditNoteDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reference_invoice_number') - self.reference_invoice_number = attributes[:'reference_invoice_number'] - end - - if attributes.key?(:'debit_note_number') - self.debit_note_number = attributes[:'debit_note_number'] - end - - if attributes.key?(:'returns_reference_number') - self.returns_reference_number = attributes[:'returns_reference_number'] - end - - if attributes.key?(:'goods_return_date') - self.goods_return_date = attributes[:'goods_return_date'] - end - - if attributes.key?(:'rma_id') - self.rma_id = attributes[:'rma_id'] - end - - if attributes.key?(:'coop_reference_number') - self.coop_reference_number = attributes[:'coop_reference_number'] - end - - if attributes.key?(:'consignors_reference_number') - self.consignors_reference_number = attributes[:'consignors_reference_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reference_invoice_number == o.reference_invoice_number && - debit_note_number == o.debit_note_number && - returns_reference_number == o.returns_reference_number && - goods_return_date == o.goods_return_date && - rma_id == o.rma_id && - coop_reference_number == o.coop_reference_number && - consignors_reference_number == o.consignors_reference_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reference_invoice_number, debit_note_number, returns_reference_number, goods_return_date, rma_id, coop_reference_number, consignors_reference_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/date_time.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/date_time.rb deleted file mode 100644 index 2bd289b..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/date_time.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Defines a date and time according to ISO8601. - class DateTime - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::DateTime` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::DateTime`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/decimal.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/decimal.rb deleted file mode 100644 index c2fc1bc..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error.rb deleted file mode 100644 index dc2f366..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error_list.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error_list.rb deleted file mode 100644 index 60fac9c..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice.rb deleted file mode 100644 index dc420e0..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice.rb +++ /dev/null @@ -1,414 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Represents an invoice or credit note document with details about the transaction, parties involved, and line items. - class Invoice - # Identifies the type of invoice. - attr_accessor :invoice_type - - # Unique number relating to the charges defined in this document. This will be invoice number if the document type is Invoice or CreditNote number if the document type is Credit Note. Failure to provide this reference will result in a rejection. - attr_accessor :id - - # An additional unique reference number used for regulatory or other purposes. - attr_accessor :reference_number - - attr_accessor :date - - attr_accessor :remit_to_party - - attr_accessor :ship_to_party - - attr_accessor :ship_from_party - - attr_accessor :bill_to_party - - attr_accessor :payment_terms - - attr_accessor :invoice_total - - # Total tax amount details for all line items. - attr_accessor :tax_details - - # Additional details provided by the selling party, for tax related or other purposes. - attr_accessor :additional_details - - # Total charge amount details for all line items. - attr_accessor :charge_details - - # Total allowance amount details for all line items. - attr_accessor :allowance_details - - # The list of invoice items. - attr_accessor :items - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoice_type' => :'invoiceType', - :'id' => :'id', - :'reference_number' => :'referenceNumber', - :'date' => :'date', - :'remit_to_party' => :'remitToParty', - :'ship_to_party' => :'shipToParty', - :'ship_from_party' => :'shipFromParty', - :'bill_to_party' => :'billToParty', - :'payment_terms' => :'paymentTerms', - :'invoice_total' => :'invoiceTotal', - :'tax_details' => :'taxDetails', - :'additional_details' => :'additionalDetails', - :'charge_details' => :'chargeDetails', - :'allowance_details' => :'allowanceDetails', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoice_type' => :'Object', - :'id' => :'Object', - :'reference_number' => :'Object', - :'date' => :'Object', - :'remit_to_party' => :'Object', - :'ship_to_party' => :'Object', - :'ship_from_party' => :'Object', - :'bill_to_party' => :'Object', - :'payment_terms' => :'Object', - :'invoice_total' => :'Object', - :'tax_details' => :'Object', - :'additional_details' => :'Object', - :'charge_details' => :'Object', - :'allowance_details' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::Invoice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoice_type') - self.invoice_type = attributes[:'invoice_type'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'reference_number') - self.reference_number = attributes[:'reference_number'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'remit_to_party') - self.remit_to_party = attributes[:'remit_to_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'bill_to_party') - self.bill_to_party = attributes[:'bill_to_party'] - end - - if attributes.key?(:'payment_terms') - self.payment_terms = attributes[:'payment_terms'] - end - - if attributes.key?(:'invoice_total') - self.invoice_total = attributes[:'invoice_total'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - - if attributes.key?(:'additional_details') - if (value = attributes[:'additional_details']).is_a?(Array) - self.additional_details = value - end - end - - if attributes.key?(:'charge_details') - if (value = attributes[:'charge_details']).is_a?(Array) - self.charge_details = value - end - end - - if attributes.key?(:'allowance_details') - if (value = attributes[:'allowance_details']).is_a?(Array) - self.allowance_details = value - end - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @invoice_type.nil? - invalid_properties.push('invalid value for "invoice_type", invoice_type cannot be nil.') - end - - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @remit_to_party.nil? - invalid_properties.push('invalid value for "remit_to_party", remit_to_party cannot be nil.') - end - - if @invoice_total.nil? - invalid_properties.push('invalid value for "invoice_total", invoice_total cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @invoice_type.nil? - invoice_type_validator = EnumAttributeValidator.new('Object', ['Invoice', 'CreditNote']) - return false unless invoice_type_validator.valid?(@invoice_type) - return false if @id.nil? - return false if @date.nil? - return false if @remit_to_party.nil? - return false if @invoice_total.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] invoice_type Object to be assigned - def invoice_type=(invoice_type) - validator = EnumAttributeValidator.new('Object', ['Invoice', 'CreditNote']) - unless validator.valid?(invoice_type) - fail ArgumentError, "invalid value for \"invoice_type\", must be one of #{validator.allowable_values}." - end - @invoice_type = invoice_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoice_type == o.invoice_type && - id == o.id && - reference_number == o.reference_number && - date == o.date && - remit_to_party == o.remit_to_party && - ship_to_party == o.ship_to_party && - ship_from_party == o.ship_from_party && - bill_to_party == o.bill_to_party && - payment_terms == o.payment_terms && - invoice_total == o.invoice_total && - tax_details == o.tax_details && - additional_details == o.additional_details && - charge_details == o.charge_details && - allowance_details == o.allowance_details && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoice_type, id, reference_number, date, remit_to_party, ship_to_party, ship_from_party, bill_to_party, payment_terms, invoice_total, tax_details, additional_details, charge_details, allowance_details, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice_item.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice_item.rb deleted file mode 100644 index c613137..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/invoice_item.rb +++ /dev/null @@ -1,339 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Details of the item being invoiced. - class InvoiceItem - # Unique number related to this line item. - attr_accessor :item_sequence_number - - # Amazon Standard Identification Number (ASIN) of an item. - attr_accessor :amazon_product_identifier - - # The vendor selected product identifier of the item. Should be the same as was provided in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :invoiced_quantity - - attr_accessor :net_cost - - attr_accessor :net_cost_unit_of_measure - - # The Amazon purchase order number for this invoiced line item. Formatting Notes: 8-character alpha-numeric code. This value is mandatory only when invoiceType is Invoice, and is not required when invoiceType is CreditNote. - attr_accessor :purchase_order_number - - # HSN Tax code. The HSN number cannot contain alphabets. - attr_accessor :hsn_code - - attr_accessor :credit_note_details - - # Individual tax details per line item. - attr_accessor :tax_details - - # Individual charge details per line item. - attr_accessor :charge_details - - # Individual allowance details per line item. - attr_accessor :allowance_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'amazon_product_identifier' => :'amazonProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'invoiced_quantity' => :'invoicedQuantity', - :'net_cost' => :'netCost', - :'net_cost_unit_of_measure' => :'netCostUnitOfMeasure', - :'purchase_order_number' => :'purchaseOrderNumber', - :'hsn_code' => :'hsnCode', - :'credit_note_details' => :'creditNoteDetails', - :'tax_details' => :'taxDetails', - :'charge_details' => :'chargeDetails', - :'allowance_details' => :'allowanceDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'amazon_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'invoiced_quantity' => :'Object', - :'net_cost' => :'Object', - :'net_cost_unit_of_measure' => :'Object', - :'purchase_order_number' => :'Object', - :'hsn_code' => :'Object', - :'credit_note_details' => :'Object', - :'tax_details' => :'Object', - :'charge_details' => :'Object', - :'allowance_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::InvoiceItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::InvoiceItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'amazon_product_identifier') - self.amazon_product_identifier = attributes[:'amazon_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'invoiced_quantity') - self.invoiced_quantity = attributes[:'invoiced_quantity'] - end - - if attributes.key?(:'net_cost') - self.net_cost = attributes[:'net_cost'] - end - - if attributes.key?(:'net_cost_unit_of_measure') - self.net_cost_unit_of_measure = attributes[:'net_cost_unit_of_measure'] - end - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'hsn_code') - self.hsn_code = attributes[:'hsn_code'] - end - - if attributes.key?(:'credit_note_details') - self.credit_note_details = attributes[:'credit_note_details'] - end - - if attributes.key?(:'tax_details') - if (value = attributes[:'tax_details']).is_a?(Array) - self.tax_details = value - end - end - - if attributes.key?(:'charge_details') - if (value = attributes[:'charge_details']).is_a?(Array) - self.charge_details = value - end - end - - if attributes.key?(:'allowance_details') - if (value = attributes[:'allowance_details']).is_a?(Array) - self.allowance_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @invoiced_quantity.nil? - invalid_properties.push('invalid value for "invoiced_quantity", invoiced_quantity cannot be nil.') - end - - if @net_cost.nil? - invalid_properties.push('invalid value for "net_cost", net_cost cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @invoiced_quantity.nil? - return false if @net_cost.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - amazon_product_identifier == o.amazon_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - invoiced_quantity == o.invoiced_quantity && - net_cost == o.net_cost && - net_cost_unit_of_measure == o.net_cost_unit_of_measure && - purchase_order_number == o.purchase_order_number && - hsn_code == o.hsn_code && - credit_note_details == o.credit_note_details && - tax_details == o.tax_details && - charge_details == o.charge_details && - allowance_details == o.allowance_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, amazon_product_identifier, vendor_product_identifier, invoiced_quantity, net_cost, net_cost_unit_of_measure, purchase_order_number, hsn_code, credit_note_details, tax_details, charge_details, allowance_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/item_quantity.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/item_quantity.rb deleted file mode 100644 index 1f239ec..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/item_quantity.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Details of quantity. - class ItemQuantity - # Quantity of an item. This value should not be zero. - attr_accessor :amount - - # Unit of measure for the quantity. - attr_accessor :unit_of_measure - - # The case size, if the unit of measure value is Cases. - attr_accessor :unit_size - - attr_accessor :total_weight - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure', - :'unit_size' => :'unitSize', - :'total_weight' => :'totalWeight' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object', - :'unit_size' => :'Object', - :'total_weight' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'unit_size') - self.unit_size = attributes[:'unit_size'] - end - - if attributes.key?(:'total_weight') - self.total_weight = attributes[:'total_weight'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure && - unit_size == o.unit_size && - total_weight == o.total_weight - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure, unit_size, total_weight].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/money.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/money.rb deleted file mode 100644 index a853785..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/money.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # An amount of money, including units in the form of currency. - class Money - # Three-digit currency code in ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/net_cost_unit_of_measure.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/net_cost_unit_of_measure.rb deleted file mode 100644 index f5146b8..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/net_cost_unit_of_measure.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - class NetCostUnitOfMeasure - POUNDS = 'POUNDS'.freeze - OUNCES = 'OUNCES'.freeze - GRAMS = 'GRAMS'.freeze - KILOGRAMS = 'KILOGRAMS'.freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = NetCostUnitOfMeasure.constants.select { |c| NetCostUnitOfMeasure::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #NetCostUnitOfMeasure" if constantValues.empty? - value - end - end - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/party_identification.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/party_identification.rb deleted file mode 100644 index 0b235de..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/party_identification.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Name, address and tax details of a party. - class PartyIdentification - # Assigned identification for the party. - attr_accessor :party_id - - attr_accessor :address - - # Tax registration details of the party. - attr_accessor :tax_registration_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId', - :'address' => :'address', - :'tax_registration_details' => :'taxRegistrationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object', - :'address' => :'Object', - :'tax_registration_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_registration_details') - if (value = attributes[:'tax_registration_details']).is_a?(Array) - self.tax_registration_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id && - address == o.address && - tax_registration_details == o.tax_registration_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id, address, tax_registration_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/payment_terms.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/payment_terms.rb deleted file mode 100644 index 1b62cff..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/payment_terms.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Terms of the payment for the invoice. The basis of the payment terms is the invoice date. - class PaymentTerms - # The payment term type for the invoice. - attr_accessor :type - - attr_accessor :discount_percent - - # The number of calendar days from the Base date (Invoice date) until the discount is no longer valid. - attr_accessor :discount_due_days - - # The number of calendar days from the base date (invoice date) until the total amount on the invoice is due. - attr_accessor :net_due_days - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'discount_percent' => :'discountPercent', - :'discount_due_days' => :'discountDueDays', - :'net_due_days' => :'netDueDays' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'discount_percent' => :'Object', - :'discount_due_days' => :'Object', - :'net_due_days' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::PaymentTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::PaymentTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'discount_percent') - self.discount_percent = attributes[:'discount_percent'] - end - - if attributes.key?(:'discount_due_days') - self.discount_due_days = attributes[:'discount_due_days'] - end - - if attributes.key?(:'net_due_days') - self.net_due_days = attributes[:'net_due_days'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('Object', ['Basic', 'EndOfMonth', 'FixedDate', 'Proximo', 'PaymentDueUponReceiptOfInvoice', 'LetterofCredit']) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('Object', ['Basic', 'EndOfMonth', 'FixedDate', 'Proximo', 'PaymentDueUponReceiptOfInvoice', 'LetterofCredit']) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - discount_percent == o.discount_percent && - discount_due_days == o.discount_due_days && - net_due_days == o.net_due_days - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, discount_percent, discount_due_days, net_due_days].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_request.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_request.rb deleted file mode 100644 index f1ee5f3..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # The request schema for the submitInvoices operation. - class SubmitInvoicesRequest - # An array of Invoice objects representing the invoices or credit notes to be submitted. - attr_accessor :invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoices' => :'invoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoices' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::SubmitInvoicesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::SubmitInvoicesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoices') - if (value = attributes[:'invoices']).is_a?(Array) - self.invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoices == o.invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_response.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_response.rb deleted file mode 100644 index 1d3824e..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/submit_invoices_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # The response schema for the submitInvoices operation. - class SubmitInvoicesResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::SubmitInvoicesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::SubmitInvoicesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_details.rb deleted file mode 100644 index 526dd6e..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_details.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Details of tax amount applied. - class TaxDetails - # Type of the tax applied. - attr_accessor :tax_type - - attr_accessor :tax_rate - - attr_accessor :tax_amount - - attr_accessor :taxable_amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_type' => :'taxType', - :'tax_rate' => :'taxRate', - :'tax_amount' => :'taxAmount', - :'taxable_amount' => :'taxableAmount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_type' => :'Object', - :'tax_rate' => :'Object', - :'tax_amount' => :'Object', - :'taxable_amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::TaxDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::TaxDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tax_rate') - self.tax_rate = attributes[:'tax_rate'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'taxable_amount') - self.taxable_amount = attributes[:'taxable_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_type.nil? - invalid_properties.push('invalid value for "tax_type", tax_type cannot be nil.') - end - - if @tax_amount.nil? - invalid_properties.push('invalid value for "tax_amount", tax_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_type.nil? - tax_type_validator = EnumAttributeValidator.new('Object', ['CGST', 'SGST', 'CESS', 'UTGST', 'IGST', 'MwSt.', 'PST', 'TVA', 'VAT', 'GST', 'ST', 'Consumption', 'MutuallyDefined', 'DomesticVAT']) - return false unless tax_type_validator.valid?(@tax_type) - return false if @tax_amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_type Object to be assigned - def tax_type=(tax_type) - validator = EnumAttributeValidator.new('Object', ['CGST', 'SGST', 'CESS', 'UTGST', 'IGST', 'MwSt.', 'PST', 'TVA', 'VAT', 'GST', 'ST', 'Consumption', 'MutuallyDefined', 'DomesticVAT']) - unless validator.valid?(tax_type) - fail ArgumentError, "invalid value for \"tax_type\", must be one of #{validator.allowable_values}." - end - @tax_type = tax_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_type == o.tax_type && - tax_rate == o.tax_rate && - tax_amount == o.tax_amount && - taxable_amount == o.taxable_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_type, tax_rate, tax_amount, taxable_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_registration_details.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_registration_details.rb deleted file mode 100644 index 4581bf9..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/tax_registration_details.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Tax registration details of the entity. - class TaxRegistrationDetails - # The tax registration type for the entity. - attr_accessor :tax_registration_type - - # The tax registration number for the entity. For example, VAT ID, Consumption Tax ID. - attr_accessor :tax_registration_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::TaxRegistrationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::TaxRegistrationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_type.nil? - invalid_properties.push('invalid value for "tax_registration_type", tax_registration_type cannot be nil.') - end - - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_registration_type.nil? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/total_weight.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/total_weight.rb deleted file mode 100644 index d7de5bf..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/total_weight.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # The aggregate weight of this item being invoiced. This information will be available for items sold by weight. - class TotalWeight - # The unit of measure for items sold by weight. - attr_accessor :unit_of_measure - - attr_accessor :amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::TotalWeight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::TotalWeight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/transaction_id.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/models/transaction_id.rb deleted file mode 100644 index 1abf302..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/models/transaction_id.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorInvoices - # Response containing the transaction ID. - class TransactionId - # GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorInvoices::TransactionId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorInvoices::TransactionId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorInvoices.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_invoices/lib/sp_vendor_invoices/version.rb b/vendor/vendor_invoices/lib/sp_vendor_invoices/version.rb deleted file mode 100644 index c30fdb4..0000000 --- a/vendor/vendor_invoices/lib/sp_vendor_invoices/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVendorInvoices - VERSION = '1.0.0' -end diff --git a/vendor/vendor_invoices/sp_vendor_invoices.gemspec b/vendor/vendor_invoices/sp_vendor_invoices.gemspec deleted file mode 100644 index b878dde..0000000 --- a/vendor/vendor_invoices/sp_vendor_invoices.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Retail Procurement Payments - -#The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vendor_invoices/version" - -Gem::Specification.new do |s| - s.name = "sp_vendor_invoices" - s.version = SpVendorInvoices::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Retail Procurement Payments Ruby Gem" - s.description = "The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vendor_orders/.gitignore b/vendor/vendor_orders/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vendor_orders/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vendor_orders/.rspec b/vendor/vendor_orders/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vendor_orders/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vendor_orders/.rubocop.yml b/vendor/vendor_orders/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vendor_orders/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vendor_orders/.swagger-codegen-ignore b/vendor/vendor_orders/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vendor_orders/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vendor_orders/.swagger-codegen/VERSION b/vendor/vendor_orders/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vendor_orders/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vendor_orders/Gemfile b/vendor/vendor_orders/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vendor_orders/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vendor_orders/README.md b/vendor/vendor_orders/README.md deleted file mode 100644 index ecdc856..0000000 --- a/vendor/vendor_orders/README.md +++ /dev/null @@ -1,178 +0,0 @@ -# sp_vendor_orders - -SpVendorOrders - the Ruby gem for the Selling Partner API for Retail Procurement Orders - -The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vendor_orders.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vendor_orders-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vendor_orders-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vendor_orders', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vendor_orders', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vendor_orders' - -api_instance = SpVendorOrders::VendorOrdersApi.new -purchase_order_number = 'purchase_order_number_example' # String | The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code. - - -begin - result = api_instance.get_purchase_order(purchase_order_number) - p result -rescue SpVendorOrders::ApiError => e - puts "Exception when calling VendorOrdersApi->get_purchase_order: #{e}" -end - -api_instance = SpVendorOrders::VendorOrdersApi.new -opts = { - limit: 789, # Integer | The limit to the number of records returned. Default value is 100 records. - created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format. - created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format. - sort_order: 'sort_order_example', # String | Sort in ascending or descending order by purchase order creation date. - next_token: 'next_token_example', # String | Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call - include_details: 'include_details_example', # String | When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true. - changed_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format. - changed_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format. - po_item_state: 'po_item_state_example', # String | Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero. - is_po_changed: 'is_po_changed_example', # String | When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false. - purchase_order_state: 'purchase_order_state_example', # String | Filters purchase orders based on the purchase order state. - ordering_vendor_code: 'ordering_vendor_code_example' # String | Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned. -} - -begin - result = api_instance.get_purchase_orders(opts) - p result -rescue SpVendorOrders::ApiError => e - puts "Exception when calling VendorOrdersApi->get_purchase_orders: #{e}" -end - -api_instance = SpVendorOrders::VendorOrdersApi.new -opts = { - limit: 789, # Integer | The limit to the number of records returned. Default value is 100 records. - sort_order: 'sort_order_example', # String | Sort in ascending or descending order by purchase order creation date. - next_token: 'next_token_example', # String | Used for pagination when there are more purchase orders than the specified result size limit. - created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format. - created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format. - updated_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format. - updated_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format. - purchase_order_number: 'purchase_order_number_example', # String | Provides purchase order status for the specified purchase order number. - purchase_order_status: 'purchase_order_status_example', # String | Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses. - item_confirmation_status: 'item_confirmation_status_example', # String | Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included. - item_receive_status: 'item_receive_status_example', # String | Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included. - ordering_vendor_code: 'ordering_vendor_code_example', # String | Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned. - ship_to_party_id: 'ship_to_party_id_example' # String | Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders. -} - -begin - result = api_instance.get_purchase_orders_status(opts) - p result -rescue SpVendorOrders::ApiError => e - puts "Exception when calling VendorOrdersApi->get_purchase_orders_status: #{e}" -end - -api_instance = SpVendorOrders::VendorOrdersApi.new -body = SpVendorOrders::SubmitAcknowledgementRequest.new # SubmitAcknowledgementRequest | Submits acknowledgements for one or more purchase orders from a vendor. - - -begin - result = api_instance.submit_acknowledgement(body) - p result -rescue SpVendorOrders::ApiError => e - puts "Exception when calling VendorOrdersApi->submit_acknowledgement: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVendorOrders::VendorOrdersApi* | [**get_purchase_order**](docs/VendorOrdersApi.md#get_purchase_order) | **GET** /vendor/orders/v1/purchaseOrders/{purchaseOrderNumber} | -*SpVendorOrders::VendorOrdersApi* | [**get_purchase_orders**](docs/VendorOrdersApi.md#get_purchase_orders) | **GET** /vendor/orders/v1/purchaseOrders | -*SpVendorOrders::VendorOrdersApi* | [**get_purchase_orders_status**](docs/VendorOrdersApi.md#get_purchase_orders_status) | **GET** /vendor/orders/v1/purchaseOrdersStatus | -*SpVendorOrders::VendorOrdersApi* | [**submit_acknowledgement**](docs/VendorOrdersApi.md#submit_acknowledgement) | **POST** /vendor/orders/v1/acknowledgements | - -## Documentation for Models - - - [SpVendorOrders::AcknowledgementStatusDetails](docs/AcknowledgementStatusDetails.md) - - [SpVendorOrders::Address](docs/Address.md) - - [SpVendorOrders::DateTimeInterval](docs/DateTimeInterval.md) - - [SpVendorOrders::Decimal](docs/Decimal.md) - - [SpVendorOrders::Error](docs/Error.md) - - [SpVendorOrders::ErrorList](docs/ErrorList.md) - - [SpVendorOrders::GetPurchaseOrderResponse](docs/GetPurchaseOrderResponse.md) - - [SpVendorOrders::GetPurchaseOrdersResponse](docs/GetPurchaseOrdersResponse.md) - - [SpVendorOrders::GetPurchaseOrdersStatusResponse](docs/GetPurchaseOrdersStatusResponse.md) - - [SpVendorOrders::ImportDetails](docs/ImportDetails.md) - - [SpVendorOrders::ItemQuantity](docs/ItemQuantity.md) - - [SpVendorOrders::ItemStatus](docs/ItemStatus.md) - - [SpVendorOrders::Money](docs/Money.md) - - [SpVendorOrders::Order](docs/Order.md) - - [SpVendorOrders::OrderAcknowledgement](docs/OrderAcknowledgement.md) - - [SpVendorOrders::OrderAcknowledgementItem](docs/OrderAcknowledgementItem.md) - - [SpVendorOrders::OrderDetails](docs/OrderDetails.md) - - [SpVendorOrders::OrderItem](docs/OrderItem.md) - - [SpVendorOrders::OrderItemAcknowledgement](docs/OrderItemAcknowledgement.md) - - [SpVendorOrders::OrderItemStatus](docs/OrderItemStatus.md) - - [SpVendorOrders::OrderItemStatusAcknowledgementStatus](docs/OrderItemStatusAcknowledgementStatus.md) - - [SpVendorOrders::OrderItemStatusOrderedQuantity](docs/OrderItemStatusOrderedQuantity.md) - - [SpVendorOrders::OrderItemStatusReceivingStatus](docs/OrderItemStatusReceivingStatus.md) - - [SpVendorOrders::OrderList](docs/OrderList.md) - - [SpVendorOrders::OrderListStatus](docs/OrderListStatus.md) - - [SpVendorOrders::OrderStatus](docs/OrderStatus.md) - - [SpVendorOrders::OrderedQuantityDetails](docs/OrderedQuantityDetails.md) - - [SpVendorOrders::Pagination](docs/Pagination.md) - - [SpVendorOrders::PartyIdentification](docs/PartyIdentification.md) - - [SpVendorOrders::SubmitAcknowledgementRequest](docs/SubmitAcknowledgementRequest.md) - - [SpVendorOrders::SubmitAcknowledgementResponse](docs/SubmitAcknowledgementResponse.md) - - [SpVendorOrders::TaxRegistrationDetails](docs/TaxRegistrationDetails.md) - - [SpVendorOrders::TransactionId](docs/TransactionId.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vendor_orders/Rakefile b/vendor/vendor_orders/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vendor_orders/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vendor_orders/git_push.sh b/vendor/vendor_orders/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vendor_orders/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/api_client.rb b/vendor/vendor_orders/lib/sp_vendor_orders/api_client.rb deleted file mode 100644 index 6b3e8f7..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVendorOrders - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVendorOrders.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/api_error.rb b/vendor/vendor_orders/lib/sp_vendor_orders/api_error.rb deleted file mode 100644 index 463d583..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorOrders - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/configuration.rb b/vendor/vendor_orders/lib/sp_vendor_orders/configuration.rb deleted file mode 100644 index d7d021d..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorOrders - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/acknowledgement_status_details.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/acknowledgement_status_details.rb deleted file mode 100644 index d7b12c2..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/acknowledgement_status_details.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Details of item quantity ordered - class AcknowledgementStatusDetails - # The date when the line item was confirmed by vendor. Must be in ISO-8601 date/time format. - attr_accessor :acknowledgement_date - - attr_accessor :accepted_quantity - - attr_accessor :rejected_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'acknowledgement_date' => :'acknowledgementDate', - :'accepted_quantity' => :'acceptedQuantity', - :'rejected_quantity' => :'rejectedQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'acknowledgement_date' => :'Object', - :'accepted_quantity' => :'Object', - :'rejected_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::AcknowledgementStatusDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::AcknowledgementStatusDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'acknowledgement_date') - self.acknowledgement_date = attributes[:'acknowledgement_date'] - end - - if attributes.key?(:'accepted_quantity') - self.accepted_quantity = attributes[:'accepted_quantity'] - end - - if attributes.key?(:'rejected_quantity') - self.rejected_quantity = attributes[:'rejected_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - acknowledgement_date == o.acknowledgement_date && - accepted_quantity == o.accepted_quantity && - rejected_quantity == o.rejected_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [acknowledgement_date, accepted_quantity, rejected_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/address.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/address.rb deleted file mode 100644 index 94bb198..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/address.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Address of the party. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of the address. - attr_accessor :address_line1 - - # Additional address information, if required. - attr_accessor :address_line2 - - # Additional address information, if required. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. - attr_accessor :city - - # The county where person, business or institution is located. - attr_accessor :county - - # The district where person, business or institution is located. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of that address. It conatins a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/date_time_interval.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/date_time_interval.rb deleted file mode 100644 index 3adda14..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/date_time_interval.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Defines a date time interval according to ISO8601. Interval is separated by double hyphen (--). - class DateTimeInterval - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::DateTimeInterval` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::DateTimeInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/decimal.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/decimal.rb deleted file mode 100644 index 68d6d0f..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/error.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/error.rb deleted file mode 100644 index 2ef6b1e..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/error_list.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/error_list.rb deleted file mode 100644 index 3ccc349..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_order_response.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_order_response.rb deleted file mode 100644 index 48c1019..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_order_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The response schema for the getPurchaseOrder operation. - class GetPurchaseOrderResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::GetPurchaseOrderResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::GetPurchaseOrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_response.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_response.rb deleted file mode 100644 index 31a67c9..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The response schema for the getPurchaseOrders operation. - class GetPurchaseOrdersResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::GetPurchaseOrdersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::GetPurchaseOrdersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_status_response.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_status_response.rb deleted file mode 100644 index 6374d7b..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/get_purchase_orders_status_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The response schema for the getPurchaseOrdersStatus operation. - class GetPurchaseOrdersStatusResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::GetPurchaseOrdersStatusResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::GetPurchaseOrdersStatusResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/import_details.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/import_details.rb deleted file mode 100644 index fc5bece..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/import_details.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Import details for an import order. - class ImportDetails - # If the recipient requests, contains the shipment method of payment. This is for import PO's only. - attr_accessor :method_of_payment - - # Incoterms (International Commercial Terms) are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices. This is for import purchase orders only. - attr_accessor :international_commercial_terms - - # The port where goods on an import purchase order must be delivered by the vendor. This should only be specified when the internationalCommercialTerms is FOB. - attr_accessor :port_of_delivery - - # Types and numbers of container(s) for import purchase orders. Can be a comma-separated list if the shipment has multiple containers. HC signifies a high-capacity container. Free-text field, limited to 64 characters. The format will be a comma-delimited list containing values of the type: $NUMBER_OF_CONTAINERS_OF_THIS_TYPE-$CONTAINER_TYPE. The list of values for the container type is: 40'(40-foot container), 40'HC (40-foot high-capacity container), 45', 45'HC, 30', 30'HC, 20', 20'HC. - attr_accessor :import_containers - - # Special instructions regarding the shipment. This field is for import purchase orders. - attr_accessor :shipping_instructions - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'method_of_payment' => :'methodOfPayment', - :'international_commercial_terms' => :'internationalCommercialTerms', - :'port_of_delivery' => :'portOfDelivery', - :'import_containers' => :'importContainers', - :'shipping_instructions' => :'shippingInstructions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'method_of_payment' => :'Object', - :'international_commercial_terms' => :'Object', - :'port_of_delivery' => :'Object', - :'import_containers' => :'Object', - :'shipping_instructions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::ImportDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::ImportDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'method_of_payment') - self.method_of_payment = attributes[:'method_of_payment'] - end - - if attributes.key?(:'international_commercial_terms') - self.international_commercial_terms = attributes[:'international_commercial_terms'] - end - - if attributes.key?(:'port_of_delivery') - self.port_of_delivery = attributes[:'port_of_delivery'] - end - - if attributes.key?(:'import_containers') - self.import_containers = attributes[:'import_containers'] - end - - if attributes.key?(:'shipping_instructions') - self.shipping_instructions = attributes[:'shipping_instructions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - method_of_payment_validator = EnumAttributeValidator.new('Object', ['PaidByBuyer', 'CollectOnDelivery', 'DefinedByBuyerAndSeller', 'FOBPortOfCall', 'PrepaidBySeller', 'PaidBySeller']) - return false unless method_of_payment_validator.valid?(@method_of_payment) - international_commercial_terms_validator = EnumAttributeValidator.new('Object', ['ExWorks', 'FreeCarrier', 'FreeOnBoard', 'FreeAlongSideShip', 'CarriagePaidTo', 'CostAndFreight', 'CarriageAndInsurancePaidTo', 'CostInsuranceAndFreight', 'DeliveredAtTerminal', 'DeliveredAtPlace', 'DeliverDutyPaid']) - return false unless international_commercial_terms_validator.valid?(@international_commercial_terms) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] method_of_payment Object to be assigned - def method_of_payment=(method_of_payment) - validator = EnumAttributeValidator.new('Object', ['PaidByBuyer', 'CollectOnDelivery', 'DefinedByBuyerAndSeller', 'FOBPortOfCall', 'PrepaidBySeller', 'PaidBySeller']) - unless validator.valid?(method_of_payment) - fail ArgumentError, "invalid value for \"method_of_payment\", must be one of #{validator.allowable_values}." - end - @method_of_payment = method_of_payment - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] international_commercial_terms Object to be assigned - def international_commercial_terms=(international_commercial_terms) - validator = EnumAttributeValidator.new('Object', ['ExWorks', 'FreeCarrier', 'FreeOnBoard', 'FreeAlongSideShip', 'CarriagePaidTo', 'CostAndFreight', 'CarriageAndInsurancePaidTo', 'CostInsuranceAndFreight', 'DeliveredAtTerminal', 'DeliveredAtPlace', 'DeliverDutyPaid']) - unless validator.valid?(international_commercial_terms) - fail ArgumentError, "invalid value for \"international_commercial_terms\", must be one of #{validator.allowable_values}." - end - @international_commercial_terms = international_commercial_terms - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - method_of_payment == o.method_of_payment && - international_commercial_terms == o.international_commercial_terms && - port_of_delivery == o.port_of_delivery && - import_containers == o.import_containers && - shipping_instructions == o.shipping_instructions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [method_of_payment, international_commercial_terms, port_of_delivery, import_containers, shipping_instructions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/item_quantity.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/item_quantity.rb deleted file mode 100644 index 26d19fe..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/item_quantity.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Details of quantity ordered. - class ItemQuantity - # Acknowledged quantity. This value should not be zero. - attr_accessor :amount - - # Unit of measure for the acknowledged quantity. - attr_accessor :unit_of_measure - - # The case size, in the event that we ordered using cases. - attr_accessor :unit_size - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure', - :'unit_size' => :'unitSize' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object', - :'unit_size' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'unit_size') - self.unit_size = attributes[:'unit_size'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure && - unit_size == o.unit_size - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure, unit_size].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/item_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/item_status.rb deleted file mode 100644 index 41c986d..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/item_status.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Detailed description of items order status. - class ItemStatus - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::ItemStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::ItemStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/money.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/money.rb deleted file mode 100644 index 5298767..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/money.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # An amount of money. Includes the currency code and an optional unit of measure for items priced by weight. - class Money - # Three digit currency code in ISO 4217 format. String of length 3. - attr_accessor :currency_code - - attr_accessor :amount - - # The unit of measure for prices of items sold by weight. If this field is absent, the item is sold by eaches. - attr_accessor :unit_of_measure - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order.rb deleted file mode 100644 index 7575d52..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Represents an order placed by Amazon, including the purchase order number, current state, and order details. - class Order - # The purchase order number for this order. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - # This field will contain the current state of the purchase order. - attr_accessor :purchase_order_state - - attr_accessor :order_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'purchase_order_state' => :'purchaseOrderState', - :'order_details' => :'orderDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'purchase_order_state' => :'Object', - :'order_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Order` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'purchase_order_state') - self.purchase_order_state = attributes[:'purchase_order_state'] - end - - if attributes.key?(:'order_details') - self.order_details = attributes[:'order_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @purchase_order_state.nil? - invalid_properties.push('invalid value for "purchase_order_state", purchase_order_state cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @purchase_order_state.nil? - purchase_order_state_validator = EnumAttributeValidator.new('Object', ['New', 'Acknowledged', 'Closed']) - return false unless purchase_order_state_validator.valid?(@purchase_order_state) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] purchase_order_state Object to be assigned - def purchase_order_state=(purchase_order_state) - validator = EnumAttributeValidator.new('Object', ['New', 'Acknowledged', 'Closed']) - unless validator.valid?(purchase_order_state) - fail ArgumentError, "invalid value for \"purchase_order_state\", must be one of #{validator.allowable_values}." - end - @purchase_order_state = purchase_order_state - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - purchase_order_state == o.purchase_order_state && - order_details == o.order_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, purchase_order_state, order_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement.rb deleted file mode 100644 index 7993916..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Represents an acknowledgement for an order, including the purchase order number, selling party details, acknowledgement date, and a list of acknowledged items. - class OrderAcknowledgement - # The purchase order number. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - attr_accessor :selling_party - - # The date and time when the purchase order is acknowledged, in ISO-8601 date/time format. - attr_accessor :acknowledgement_date - - # A list of the items being acknowledged with associated details. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'selling_party' => :'sellingParty', - :'acknowledgement_date' => :'acknowledgementDate', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'selling_party' => :'Object', - :'acknowledgement_date' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderAcknowledgement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderAcknowledgement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'acknowledgement_date') - self.acknowledgement_date = attributes[:'acknowledgement_date'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @acknowledgement_date.nil? - invalid_properties.push('invalid value for "acknowledgement_date", acknowledgement_date cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @selling_party.nil? - return false if @acknowledgement_date.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - selling_party == o.selling_party && - acknowledgement_date == o.acknowledgement_date && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, selling_party, acknowledgement_date, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement_item.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement_item.rb deleted file mode 100644 index 1984ebc..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_acknowledgement_item.rb +++ /dev/null @@ -1,291 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Details of the item being acknowledged. - class OrderAcknowledgementItem - # Line item sequence number for the item. - attr_accessor :item_sequence_number - - # Amazon Standard Identification Number (ASIN) of an item. - attr_accessor :amazon_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :ordered_quantity - - attr_accessor :net_cost - - attr_accessor :list_price - - # The discount multiplier that should be applied to the price if a vendor sells books with a list price. This is a multiplier factor to arrive at a final discounted price. A multiplier of .90 would be the factor if a 10% discount is given. - attr_accessor :discount_multiplier - - # This is used to indicate acknowledged quantity. - attr_accessor :item_acknowledgements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'amazon_product_identifier' => :'amazonProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'ordered_quantity' => :'orderedQuantity', - :'net_cost' => :'netCost', - :'list_price' => :'listPrice', - :'discount_multiplier' => :'discountMultiplier', - :'item_acknowledgements' => :'itemAcknowledgements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'amazon_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'ordered_quantity' => :'Object', - :'net_cost' => :'Object', - :'list_price' => :'Object', - :'discount_multiplier' => :'Object', - :'item_acknowledgements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderAcknowledgementItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderAcknowledgementItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'amazon_product_identifier') - self.amazon_product_identifier = attributes[:'amazon_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'net_cost') - self.net_cost = attributes[:'net_cost'] - end - - if attributes.key?(:'list_price') - self.list_price = attributes[:'list_price'] - end - - if attributes.key?(:'discount_multiplier') - self.discount_multiplier = attributes[:'discount_multiplier'] - end - - if attributes.key?(:'item_acknowledgements') - if (value = attributes[:'item_acknowledgements']).is_a?(Array) - self.item_acknowledgements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @ordered_quantity.nil? - invalid_properties.push('invalid value for "ordered_quantity", ordered_quantity cannot be nil.') - end - - if @item_acknowledgements.nil? - invalid_properties.push('invalid value for "item_acknowledgements", item_acknowledgements cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @ordered_quantity.nil? - return false if @item_acknowledgements.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - amazon_product_identifier == o.amazon_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - ordered_quantity == o.ordered_quantity && - net_cost == o.net_cost && - list_price == o.list_price && - discount_multiplier == o.discount_multiplier && - item_acknowledgements == o.item_acknowledgements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, amazon_product_identifier, vendor_product_identifier, ordered_quantity, net_cost, list_price, discount_multiplier, item_acknowledgements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_details.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_details.rb deleted file mode 100644 index da19506..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_details.rb +++ /dev/null @@ -1,398 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Details of an order. - class OrderDetails - # The date the purchase order was placed. Must be in ISO-8601 date/time format. - attr_accessor :purchase_order_date - - # The date when purchase order was last changed by Amazon after the order was placed. This date will be greater than 'purchaseOrderDate'. This means the PO data was changed on that date and vendors are required to fulfill the updated PO. The PO changes can be related to Item Quantity, Ship to Location, Ship Window etc. This field will not be present in orders that have not changed after creation. Must be in ISO-8601 date/time format. - attr_accessor :purchase_order_changed_date - - # The date when current purchase order state was changed. Current purchase order state is available in the field 'purchaseOrderState'. Must be in ISO-8601 date/time format. - attr_accessor :purchase_order_state_changed_date - - # Type of purchase order. - attr_accessor :purchase_order_type - - attr_accessor :import_details - - # If requested by the recipient, this field will contain a promotional/deal number. The discount code line is optional. It is used to obtain a price discount on items on the order. - attr_accessor :deal_code - - # Payment method used. - attr_accessor :payment_method - - attr_accessor :buying_party - - attr_accessor :selling_party - - attr_accessor :ship_to_party - - attr_accessor :bill_to_party - - attr_accessor :ship_window - - attr_accessor :delivery_window - - # A list of items in this purchase order. - attr_accessor :items - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_date' => :'purchaseOrderDate', - :'purchase_order_changed_date' => :'purchaseOrderChangedDate', - :'purchase_order_state_changed_date' => :'purchaseOrderStateChangedDate', - :'purchase_order_type' => :'purchaseOrderType', - :'import_details' => :'importDetails', - :'deal_code' => :'dealCode', - :'payment_method' => :'paymentMethod', - :'buying_party' => :'buyingParty', - :'selling_party' => :'sellingParty', - :'ship_to_party' => :'shipToParty', - :'bill_to_party' => :'billToParty', - :'ship_window' => :'shipWindow', - :'delivery_window' => :'deliveryWindow', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_date' => :'Object', - :'purchase_order_changed_date' => :'Object', - :'purchase_order_state_changed_date' => :'Object', - :'purchase_order_type' => :'Object', - :'import_details' => :'Object', - :'deal_code' => :'Object', - :'payment_method' => :'Object', - :'buying_party' => :'Object', - :'selling_party' => :'Object', - :'ship_to_party' => :'Object', - :'bill_to_party' => :'Object', - :'ship_window' => :'Object', - :'delivery_window' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_date') - self.purchase_order_date = attributes[:'purchase_order_date'] - end - - if attributes.key?(:'purchase_order_changed_date') - self.purchase_order_changed_date = attributes[:'purchase_order_changed_date'] - end - - if attributes.key?(:'purchase_order_state_changed_date') - self.purchase_order_state_changed_date = attributes[:'purchase_order_state_changed_date'] - end - - if attributes.key?(:'purchase_order_type') - self.purchase_order_type = attributes[:'purchase_order_type'] - end - - if attributes.key?(:'import_details') - self.import_details = attributes[:'import_details'] - end - - if attributes.key?(:'deal_code') - self.deal_code = attributes[:'deal_code'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - - if attributes.key?(:'buying_party') - self.buying_party = attributes[:'buying_party'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'bill_to_party') - self.bill_to_party = attributes[:'bill_to_party'] - end - - if attributes.key?(:'ship_window') - self.ship_window = attributes[:'ship_window'] - end - - if attributes.key?(:'delivery_window') - self.delivery_window = attributes[:'delivery_window'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_date.nil? - invalid_properties.push('invalid value for "purchase_order_date", purchase_order_date cannot be nil.') - end - - if @purchase_order_state_changed_date.nil? - invalid_properties.push('invalid value for "purchase_order_state_changed_date", purchase_order_state_changed_date cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_date.nil? - return false if @purchase_order_state_changed_date.nil? - purchase_order_type_validator = EnumAttributeValidator.new('Object', ['RegularOrder', 'ConsignedOrder', 'NewProductIntroduction', 'RushOrder']) - return false unless purchase_order_type_validator.valid?(@purchase_order_type) - payment_method_validator = EnumAttributeValidator.new('Object', ['Invoice', 'Consignment', 'CreditCard', 'Prepaid']) - return false unless payment_method_validator.valid?(@payment_method) - return false if @items.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] purchase_order_type Object to be assigned - def purchase_order_type=(purchase_order_type) - validator = EnumAttributeValidator.new('Object', ['RegularOrder', 'ConsignedOrder', 'NewProductIntroduction', 'RushOrder']) - unless validator.valid?(purchase_order_type) - fail ArgumentError, "invalid value for \"purchase_order_type\", must be one of #{validator.allowable_values}." - end - @purchase_order_type = purchase_order_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] payment_method Object to be assigned - def payment_method=(payment_method) - validator = EnumAttributeValidator.new('Object', ['Invoice', 'Consignment', 'CreditCard', 'Prepaid']) - unless validator.valid?(payment_method) - fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." - end - @payment_method = payment_method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_date == o.purchase_order_date && - purchase_order_changed_date == o.purchase_order_changed_date && - purchase_order_state_changed_date == o.purchase_order_state_changed_date && - purchase_order_type == o.purchase_order_type && - import_details == o.import_details && - deal_code == o.deal_code && - payment_method == o.payment_method && - buying_party == o.buying_party && - selling_party == o.selling_party && - ship_to_party == o.ship_to_party && - bill_to_party == o.bill_to_party && - ship_window == o.ship_window && - delivery_window == o.delivery_window && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_date, purchase_order_changed_date, purchase_order_state_changed_date, purchase_order_type, import_details, deal_code, payment_method, buying_party, selling_party, ship_to_party, bill_to_party, ship_window, delivery_window, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item.rb deleted file mode 100644 index 231edfd..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Represents an individual item in an order, including item details, quantities, pricing, and backorder information. - class OrderItem - # Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on. - attr_accessor :item_sequence_number - - # Amazon Standard Identification Number (ASIN) of an item. - attr_accessor :amazon_product_identifier - - # The vendor selected product identification of the item. - attr_accessor :vendor_product_identifier - - attr_accessor :ordered_quantity - - # When true, we will accept backorder confirmations for this item. - attr_accessor :is_back_order_allowed - - attr_accessor :net_cost - - attr_accessor :list_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'amazon_product_identifier' => :'amazonProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'ordered_quantity' => :'orderedQuantity', - :'is_back_order_allowed' => :'isBackOrderAllowed', - :'net_cost' => :'netCost', - :'list_price' => :'listPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'amazon_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'ordered_quantity' => :'Object', - :'is_back_order_allowed' => :'Object', - :'net_cost' => :'Object', - :'list_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'amazon_product_identifier') - self.amazon_product_identifier = attributes[:'amazon_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'is_back_order_allowed') - self.is_back_order_allowed = attributes[:'is_back_order_allowed'] - end - - if attributes.key?(:'net_cost') - self.net_cost = attributes[:'net_cost'] - end - - if attributes.key?(:'list_price') - self.list_price = attributes[:'list_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @ordered_quantity.nil? - invalid_properties.push('invalid value for "ordered_quantity", ordered_quantity cannot be nil.') - end - - if @is_back_order_allowed.nil? - invalid_properties.push('invalid value for "is_back_order_allowed", is_back_order_allowed cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @ordered_quantity.nil? - return false if @is_back_order_allowed.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - amazon_product_identifier == o.amazon_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - ordered_quantity == o.ordered_quantity && - is_back_order_allowed == o.is_back_order_allowed && - net_cost == o.net_cost && - list_price == o.list_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, amazon_product_identifier, vendor_product_identifier, ordered_quantity, is_back_order_allowed, net_cost, list_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_acknowledgement.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_acknowledgement.rb deleted file mode 100644 index d6bbf38..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_acknowledgement.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Represents the acknowledgement details for an individual order item, including the acknowledgement code, acknowledged quantity, scheduled ship and delivery dates, and rejection reason (if applicable). - class OrderItemAcknowledgement - # This indicates the acknowledgement code. - attr_accessor :acknowledgement_code - - attr_accessor :acknowledged_quantity - - # Estimated ship date per line item. Must be in ISO-8601 date/time format. - attr_accessor :scheduled_ship_date - - # Estimated delivery date per line item. Must be in ISO-8601 date/time format. - attr_accessor :scheduled_delivery_date - - # Indicates the reason for rejection. - attr_accessor :rejection_reason - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'acknowledgement_code' => :'acknowledgementCode', - :'acknowledged_quantity' => :'acknowledgedQuantity', - :'scheduled_ship_date' => :'scheduledShipDate', - :'scheduled_delivery_date' => :'scheduledDeliveryDate', - :'rejection_reason' => :'rejectionReason' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'acknowledgement_code' => :'Object', - :'acknowledged_quantity' => :'Object', - :'scheduled_ship_date' => :'Object', - :'scheduled_delivery_date' => :'Object', - :'rejection_reason' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItemAcknowledgement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItemAcknowledgement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'acknowledgement_code') - self.acknowledgement_code = attributes[:'acknowledgement_code'] - end - - if attributes.key?(:'acknowledged_quantity') - self.acknowledged_quantity = attributes[:'acknowledged_quantity'] - end - - if attributes.key?(:'scheduled_ship_date') - self.scheduled_ship_date = attributes[:'scheduled_ship_date'] - end - - if attributes.key?(:'scheduled_delivery_date') - self.scheduled_delivery_date = attributes[:'scheduled_delivery_date'] - end - - if attributes.key?(:'rejection_reason') - self.rejection_reason = attributes[:'rejection_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @acknowledgement_code.nil? - invalid_properties.push('invalid value for "acknowledgement_code", acknowledgement_code cannot be nil.') - end - - if @acknowledged_quantity.nil? - invalid_properties.push('invalid value for "acknowledged_quantity", acknowledged_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @acknowledgement_code.nil? - acknowledgement_code_validator = EnumAttributeValidator.new('Object', ['Accepted', 'Backordered', 'Rejected']) - return false unless acknowledgement_code_validator.valid?(@acknowledgement_code) - return false if @acknowledged_quantity.nil? - rejection_reason_validator = EnumAttributeValidator.new('Object', ['TemporarilyUnavailable', 'InvalidProductIdentifier', 'ObsoleteProduct']) - return false unless rejection_reason_validator.valid?(@rejection_reason) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] acknowledgement_code Object to be assigned - def acknowledgement_code=(acknowledgement_code) - validator = EnumAttributeValidator.new('Object', ['Accepted', 'Backordered', 'Rejected']) - unless validator.valid?(acknowledgement_code) - fail ArgumentError, "invalid value for \"acknowledgement_code\", must be one of #{validator.allowable_values}." - end - @acknowledgement_code = acknowledgement_code - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] rejection_reason Object to be assigned - def rejection_reason=(rejection_reason) - validator = EnumAttributeValidator.new('Object', ['TemporarilyUnavailable', 'InvalidProductIdentifier', 'ObsoleteProduct']) - unless validator.valid?(rejection_reason) - fail ArgumentError, "invalid value for \"rejection_reason\", must be one of #{validator.allowable_values}." - end - @rejection_reason = rejection_reason - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - acknowledgement_code == o.acknowledgement_code && - acknowledged_quantity == o.acknowledged_quantity && - scheduled_ship_date == o.scheduled_ship_date && - scheduled_delivery_date == o.scheduled_delivery_date && - rejection_reason == o.rejection_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [acknowledgement_code, acknowledged_quantity, scheduled_ship_date, scheduled_delivery_date, rejection_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status.rb deleted file mode 100644 index 28fcab8..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Represents the current status of an order item, including acknowledgement and receiving details. - class OrderItemStatus - # Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on. - attr_accessor :item_sequence_number - - # Buyer's Standard Identification Number (ASIN) of an item. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. - attr_accessor :vendor_product_identifier - - attr_accessor :net_cost - - attr_accessor :list_price - - attr_accessor :ordered_quantity - - attr_accessor :acknowledgement_status - - attr_accessor :receiving_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'net_cost' => :'netCost', - :'list_price' => :'listPrice', - :'ordered_quantity' => :'orderedQuantity', - :'acknowledgement_status' => :'acknowledgementStatus', - :'receiving_status' => :'receivingStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'net_cost' => :'Object', - :'list_price' => :'Object', - :'ordered_quantity' => :'Object', - :'acknowledgement_status' => :'Object', - :'receiving_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItemStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItemStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'net_cost') - self.net_cost = attributes[:'net_cost'] - end - - if attributes.key?(:'list_price') - self.list_price = attributes[:'list_price'] - end - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'acknowledgement_status') - self.acknowledgement_status = attributes[:'acknowledgement_status'] - end - - if attributes.key?(:'receiving_status') - self.receiving_status = attributes[:'receiving_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - net_cost == o.net_cost && - list_price == o.list_price && - ordered_quantity == o.ordered_quantity && - acknowledgement_status == o.acknowledgement_status && - receiving_status == o.receiving_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, net_cost, list_price, ordered_quantity, acknowledgement_status, receiving_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_acknowledgement_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_acknowledgement_status.rb deleted file mode 100644 index 140a8a9..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_acknowledgement_status.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Acknowledgement status information. - class OrderItemStatusAcknowledgementStatus - # Confirmation status of line item. - attr_accessor :confirmation_status - - attr_accessor :accepted_quantity - - attr_accessor :rejected_quantity - - # Details of item quantity confirmed. - attr_accessor :acknowledgement_status_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'confirmation_status' => :'confirmationStatus', - :'accepted_quantity' => :'acceptedQuantity', - :'rejected_quantity' => :'rejectedQuantity', - :'acknowledgement_status_details' => :'acknowledgementStatusDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'confirmation_status' => :'Object', - :'accepted_quantity' => :'Object', - :'rejected_quantity' => :'Object', - :'acknowledgement_status_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItemStatusAcknowledgementStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItemStatusAcknowledgementStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'confirmation_status') - self.confirmation_status = attributes[:'confirmation_status'] - end - - if attributes.key?(:'accepted_quantity') - self.accepted_quantity = attributes[:'accepted_quantity'] - end - - if attributes.key?(:'rejected_quantity') - self.rejected_quantity = attributes[:'rejected_quantity'] - end - - if attributes.key?(:'acknowledgement_status_details') - if (value = attributes[:'acknowledgement_status_details']).is_a?(Array) - self.acknowledgement_status_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - confirmation_status_validator = EnumAttributeValidator.new('Object', ['ACCEPTED', 'PARTIALLY_ACCEPTED', 'REJECTED', 'UNCONFIRMED']) - return false unless confirmation_status_validator.valid?(@confirmation_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] confirmation_status Object to be assigned - def confirmation_status=(confirmation_status) - validator = EnumAttributeValidator.new('Object', ['ACCEPTED', 'PARTIALLY_ACCEPTED', 'REJECTED', 'UNCONFIRMED']) - unless validator.valid?(confirmation_status) - fail ArgumentError, "invalid value for \"confirmation_status\", must be one of #{validator.allowable_values}." - end - @confirmation_status = confirmation_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - confirmation_status == o.confirmation_status && - accepted_quantity == o.accepted_quantity && - rejected_quantity == o.rejected_quantity && - acknowledgement_status_details == o.acknowledgement_status_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [confirmation_status, accepted_quantity, rejected_quantity, acknowledgement_status_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_ordered_quantity.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_ordered_quantity.rb deleted file mode 100644 index c132e5a..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_ordered_quantity.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Ordered quantity information. - class OrderItemStatusOrderedQuantity - attr_accessor :ordered_quantity - - # Details of item quantity ordered. - attr_accessor :ordered_quantity_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ordered_quantity' => :'orderedQuantity', - :'ordered_quantity_details' => :'orderedQuantityDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'ordered_quantity' => :'Object', - :'ordered_quantity_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItemStatusOrderedQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItemStatusOrderedQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'ordered_quantity_details') - if (value = attributes[:'ordered_quantity_details']).is_a?(Array) - self.ordered_quantity_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ordered_quantity == o.ordered_quantity && - ordered_quantity_details == o.ordered_quantity_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ordered_quantity, ordered_quantity_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_receiving_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_receiving_status.rb deleted file mode 100644 index 57f194f..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_item_status_receiving_status.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Item receive status at the buyer's warehouse. - class OrderItemStatusReceivingStatus - # Receive status of the line item. - attr_accessor :receive_status - - attr_accessor :received_quantity - - # The date when the most recent item was received at the buyer's warehouse. Must be in ISO-8601 date/time format. - attr_accessor :last_receive_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'receive_status' => :'receiveStatus', - :'received_quantity' => :'receivedQuantity', - :'last_receive_date' => :'lastReceiveDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'receive_status' => :'Object', - :'received_quantity' => :'Object', - :'last_receive_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderItemStatusReceivingStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderItemStatusReceivingStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'receive_status') - self.receive_status = attributes[:'receive_status'] - end - - if attributes.key?(:'received_quantity') - self.received_quantity = attributes[:'received_quantity'] - end - - if attributes.key?(:'last_receive_date') - self.last_receive_date = attributes[:'last_receive_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - receive_status_validator = EnumAttributeValidator.new('Object', ['NOT_RECEIVED', 'PARTIALLY_RECEIVED', 'RECEIVED']) - return false unless receive_status_validator.valid?(@receive_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] receive_status Object to be assigned - def receive_status=(receive_status) - validator = EnumAttributeValidator.new('Object', ['NOT_RECEIVED', 'PARTIALLY_RECEIVED', 'RECEIVED']) - unless validator.valid?(receive_status) - fail ArgumentError, "invalid value for \"receive_status\", must be one of #{validator.allowable_values}." - end - @receive_status = receive_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - receive_status == o.receive_status && - received_quantity == o.received_quantity && - last_receive_date == o.last_receive_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [receive_status, received_quantity, last_receive_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list.rb deleted file mode 100644 index a373af4..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # A list of orders returned as response. - class OrderList - attr_accessor :pagination - - # Represents an individual order within the OrderList. - attr_accessor :orders - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'orders' => :'orders' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'orders' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'orders') - if (value = attributes[:'orders']).is_a?(Array) - self.orders = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - orders == o.orders - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, orders].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list_status.rb deleted file mode 100644 index 2a84b25..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_list_status.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # A list of order statuses. - class OrderListStatus - attr_accessor :pagination - - # Represents an order status within the OrderListStatus. - attr_accessor :orders_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'orders_status' => :'ordersStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'orders_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderListStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderListStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'orders_status') - if (value = attributes[:'orders_status']).is_a?(Array) - self.orders_status = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - orders_status == o.orders_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, orders_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_status.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/order_status.rb deleted file mode 100644 index d9e6f50..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/order_status.rb +++ /dev/null @@ -1,333 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Current status of a purchase order. - class OrderStatus - # The buyer's purchase order number for this order. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - # The status of the buyer's purchase order for this order. - attr_accessor :purchase_order_status - - # The date the purchase order was placed. Must be in ISO-8601 date/time format. - attr_accessor :purchase_order_date - - # The date when the purchase order was last updated. Must be in ISO-8601 date/time format. - attr_accessor :last_updated_date - - attr_accessor :selling_party - - attr_accessor :ship_to_party - - attr_accessor :item_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'purchase_order_status' => :'purchaseOrderStatus', - :'purchase_order_date' => :'purchaseOrderDate', - :'last_updated_date' => :'lastUpdatedDate', - :'selling_party' => :'sellingParty', - :'ship_to_party' => :'shipToParty', - :'item_status' => :'itemStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'purchase_order_status' => :'Object', - :'purchase_order_date' => :'Object', - :'last_updated_date' => :'Object', - :'selling_party' => :'Object', - :'ship_to_party' => :'Object', - :'item_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'purchase_order_status') - self.purchase_order_status = attributes[:'purchase_order_status'] - end - - if attributes.key?(:'purchase_order_date') - self.purchase_order_date = attributes[:'purchase_order_date'] - end - - if attributes.key?(:'last_updated_date') - self.last_updated_date = attributes[:'last_updated_date'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'item_status') - self.item_status = attributes[:'item_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @purchase_order_number.nil? - invalid_properties.push('invalid value for "purchase_order_number", purchase_order_number cannot be nil.') - end - - if @purchase_order_status.nil? - invalid_properties.push('invalid value for "purchase_order_status", purchase_order_status cannot be nil.') - end - - if @purchase_order_date.nil? - invalid_properties.push('invalid value for "purchase_order_date", purchase_order_date cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_to_party.nil? - invalid_properties.push('invalid value for "ship_to_party", ship_to_party cannot be nil.') - end - - if @item_status.nil? - invalid_properties.push('invalid value for "item_status", item_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @purchase_order_number.nil? - return false if @purchase_order_status.nil? - purchase_order_status_validator = EnumAttributeValidator.new('Object', ['OPEN', 'CLOSED']) - return false unless purchase_order_status_validator.valid?(@purchase_order_status) - return false if @purchase_order_date.nil? - return false if @selling_party.nil? - return false if @ship_to_party.nil? - return false if @item_status.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] purchase_order_status Object to be assigned - def purchase_order_status=(purchase_order_status) - validator = EnumAttributeValidator.new('Object', ['OPEN', 'CLOSED']) - unless validator.valid?(purchase_order_status) - fail ArgumentError, "invalid value for \"purchase_order_status\", must be one of #{validator.allowable_values}." - end - @purchase_order_status = purchase_order_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - purchase_order_status == o.purchase_order_status && - purchase_order_date == o.purchase_order_date && - last_updated_date == o.last_updated_date && - selling_party == o.selling_party && - ship_to_party == o.ship_to_party && - item_status == o.item_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, purchase_order_status, purchase_order_date, last_updated_date, selling_party, ship_to_party, item_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/ordered_quantity_details.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/ordered_quantity_details.rb deleted file mode 100644 index e5f4d3c..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/ordered_quantity_details.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Details of item quantity ordered. - class OrderedQuantityDetails - # The date when the line item quantity was updated by buyer. Must be in ISO-8601 date/time format. - attr_accessor :updated_date - - attr_accessor :ordered_quantity - - attr_accessor :cancelled_quantity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'updated_date' => :'updatedDate', - :'ordered_quantity' => :'orderedQuantity', - :'cancelled_quantity' => :'cancelledQuantity' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'updated_date' => :'Object', - :'ordered_quantity' => :'Object', - :'cancelled_quantity' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::OrderedQuantityDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::OrderedQuantityDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'updated_date') - self.updated_date = attributes[:'updated_date'] - end - - if attributes.key?(:'ordered_quantity') - self.ordered_quantity = attributes[:'ordered_quantity'] - end - - if attributes.key?(:'cancelled_quantity') - self.cancelled_quantity = attributes[:'cancelled_quantity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - updated_date == o.updated_date && - ordered_quantity == o.ordered_quantity && - cancelled_quantity == o.cancelled_quantity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [updated_date, ordered_quantity, cancelled_quantity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/pagination.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/pagination.rb deleted file mode 100644 index a3f0585..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/pagination.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The pagination elements required to retrieve the remaining data. - class Pagination - # A generated string used to pass information to your next request. If NextToken is returned, pass the value of NextToken to the next request. If NextToken is not returned, there are no more purchase order items to return. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/party_identification.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/party_identification.rb deleted file mode 100644 index 20ef6d7..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/party_identification.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Name, address and tax details of a party. - class PartyIdentification - # Assigned identification for the party. For example, warehouse code or vendor code. Please refer to specific party for more details. - attr_accessor :party_id - - attr_accessor :address - - attr_accessor :tax_info - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_id' => :'partyId', - :'address' => :'address', - :'tax_info' => :'taxInfo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_id' => :'Object', - :'address' => :'Object', - :'tax_info' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_info') - self.tax_info = attributes[:'tax_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_id == o.party_id && - address == o.address && - tax_info == o.tax_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_id, address, tax_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_request.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_request.rb deleted file mode 100644 index 502191d..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The request schema for the submitAcknowledgment operation. - class SubmitAcknowledgementRequest - # An array of order acknowledgements to be submitted. - attr_accessor :acknowledgements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'acknowledgements' => :'acknowledgements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'acknowledgements' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::SubmitAcknowledgementRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::SubmitAcknowledgementRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'acknowledgements') - if (value = attributes[:'acknowledgements']).is_a?(Array) - self.acknowledgements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - acknowledgements == o.acknowledgements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [acknowledgements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_response.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_response.rb deleted file mode 100644 index fb10ca8..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/submit_acknowledgement_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # The response schema for the submitAcknowledgement operation - class SubmitAcknowledgementResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::SubmitAcknowledgementResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::SubmitAcknowledgementResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/tax_registration_details.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/tax_registration_details.rb deleted file mode 100644 index 6be520a..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/tax_registration_details.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Tax registration details of the entity. - class TaxRegistrationDetails - # Tax registration type for the entity. - attr_accessor :tax_registration_type - - # Tax registration number for the entity. For example, VAT ID. - attr_accessor :tax_registration_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::TaxRegistrationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::TaxRegistrationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_type.nil? - invalid_properties.push('invalid value for "tax_registration_type", tax_registration_type cannot be nil.') - end - - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_registration_type.nil? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/models/transaction_id.rb b/vendor/vendor_orders/lib/sp_vendor_orders/models/transaction_id.rb deleted file mode 100644 index 8fd4c51..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/models/transaction_id.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorOrders - # Response containing the transaction ID. - class TransactionId - # GUID assigned by Amazon to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorOrders::TransactionId` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorOrders::TransactionId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorOrders.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/version.rb b/vendor/vendor_orders/lib/sp_vendor_orders/version.rb deleted file mode 100644 index 2000d03..0000000 --- a/vendor/vendor_orders/lib/sp_vendor_orders/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVendorOrders - VERSION = '1.0.0' -end diff --git a/vendor/vendor_orders/sp_vendor_orders.gemspec b/vendor/vendor_orders/sp_vendor_orders.gemspec deleted file mode 100644 index 08e355e..0000000 --- a/vendor/vendor_orders/sp_vendor_orders.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Retail Procurement Orders - -#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vendor_orders/version" - -Gem::Specification.new do |s| - s.name = "sp_vendor_orders" - s.version = SpVendorOrders::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Retail Procurement Orders Ruby Gem" - s.description = "The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vendor_transaction_status/.gitignore b/vendor/vendor_transaction_status/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vendor_transaction_status/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vendor_transaction_status/.rspec b/vendor/vendor_transaction_status/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vendor_transaction_status/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vendor_transaction_status/.rubocop.yml b/vendor/vendor_transaction_status/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vendor_transaction_status/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vendor_transaction_status/.swagger-codegen-ignore b/vendor/vendor_transaction_status/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vendor_transaction_status/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vendor_transaction_status/.swagger-codegen/VERSION b/vendor/vendor_transaction_status/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vendor_transaction_status/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vendor_transaction_status/Gemfile b/vendor/vendor_transaction_status/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vendor_transaction_status/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vendor_transaction_status/README.md b/vendor/vendor_transaction_status/README.md deleted file mode 100644 index 4687204..0000000 --- a/vendor/vendor_transaction_status/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# sp_vendor_transaction_status - -SpVendorTransactionStatus - the Ruby gem for the Selling Partner API for Retail Procurement Transaction Status - -The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vendor_transaction_status.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vendor_transaction_status-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vendor_transaction_status-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vendor_transaction_status', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vendor_transaction_status', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vendor_transaction_status' - -api_instance = SpVendorTransactionStatus::VendorTransactionApi.new -transaction_id = 'transaction_id_example' # String | The GUID provided by Amazon in the 'transactionId' field in response to the post request of a specific transaction. - - -begin - result = api_instance.get_transaction(transaction_id) - p result -rescue SpVendorTransactionStatus::ApiError => e - puts "Exception when calling VendorTransactionApi->get_transaction: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVendorTransactionStatus::VendorTransactionApi* | [**get_transaction**](docs/VendorTransactionApi.md#get_transaction) | **GET** /vendor/transactions/v1/transactions/{transactionId} | - -## Documentation for Models - - - [SpVendorTransactionStatus::Error](docs/Error.md) - - [SpVendorTransactionStatus::ErrorList](docs/ErrorList.md) - - [SpVendorTransactionStatus::GetTransactionResponse](docs/GetTransactionResponse.md) - - [SpVendorTransactionStatus::Transaction](docs/Transaction.md) - - [SpVendorTransactionStatus::TransactionStatus](docs/TransactionStatus.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vendor_transaction_status/Rakefile b/vendor/vendor_transaction_status/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vendor_transaction_status/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vendor_transaction_status/git_push.sh b/vendor/vendor_transaction_status/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vendor_transaction_status/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_client.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_client.rb deleted file mode 100644 index 89f556f..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVendorTransactionStatus - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVendorTransactionStatus.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_error.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_error.rb deleted file mode 100644 index cfa981d..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorTransactionStatus - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/configuration.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/configuration.rb deleted file mode 100644 index 9e8f28a..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorTransactionStatus - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error.rb deleted file mode 100644 index a6967a5..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorTransactionStatus - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorTransactionStatus::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorTransactionStatus::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorTransactionStatus.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error_list.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error_list.rb deleted file mode 100644 index 4c69254..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorTransactionStatus - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorTransactionStatus::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorTransactionStatus::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorTransactionStatus.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/get_transaction_response.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/get_transaction_response.rb deleted file mode 100644 index 13c5376..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/get_transaction_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorTransactionStatus - # The response schema for the getTransaction operation. - class GetTransactionResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorTransactionStatus::GetTransactionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorTransactionStatus::GetTransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorTransactionStatus.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction.rb deleted file mode 100644 index 4a32f6b..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorTransactionStatus - # The transaction status. - class Transaction - # The unique identifier returned in the 'transactionId' field in response to the post request of a specific transaction. - attr_accessor :transaction_id - - # Current processing status of the transaction. - attr_accessor :status - - attr_accessor :errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId', - :'status' => :'status', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object', - :'status' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorTransactionStatus::Transaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorTransactionStatus::Transaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @status.nil? - status_validator = EnumAttributeValidator.new('Object', ['Failure', 'Processing', 'Success']) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('Object', ['Failure', 'Processing', 'Success']) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id && - status == o.status && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id, status, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorTransactionStatus.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction_status.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction_status.rb deleted file mode 100644 index b668833..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/models/transaction_status.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorTransactionStatus - # Represents the status of a transaction. - class TransactionStatus - attr_accessor :transaction_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_status' => :'transactionStatus' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_status' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorTransactionStatus::TransactionStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorTransactionStatus::TransactionStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_status') - self.transaction_status = attributes[:'transaction_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_status == o.transaction_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorTransactionStatus.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/version.rb b/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/version.rb deleted file mode 100644 index d30ac47..0000000 --- a/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVendorTransactionStatus - VERSION = '1.0.0' -end diff --git a/vendor/vendor_transaction_status/sp_vendor_transaction_status.gemspec b/vendor/vendor_transaction_status/sp_vendor_transaction_status.gemspec deleted file mode 100644 index 15e96fb..0000000 --- a/vendor/vendor_transaction_status/sp_vendor_transaction_status.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Retail Procurement Transaction Status - -#The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vendor_transaction_status/version" - -Gem::Specification.new do |s| - s.name = "sp_vendor_transaction_status" - s.version = SpVendorTransactionStatus::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Retail Procurement Transaction Status Ruby Gem" - s.description = "The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/vendor/vendors_shipments/.gitignore b/vendor/vendors_shipments/.gitignore deleted file mode 100644 index c021594..0000000 --- a/vendor/vendors_shipments/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/vendor/vendors_shipments/.rspec b/vendor/vendors_shipments/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/vendor/vendors_shipments/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/vendor/vendors_shipments/.rubocop.yml b/vendor/vendors_shipments/.rubocop.yml deleted file mode 100644 index 19a777e..0000000 --- a/vendor/vendors_shipments/.rubocop.yml +++ /dev/null @@ -1,154 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstParameterIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: rails - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/UnneededPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Lint/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/vendor/vendors_shipments/.swagger-codegen-ignore b/vendor/vendors_shipments/.swagger-codegen-ignore deleted file mode 100644 index c5fa491..0000000 --- a/vendor/vendors_shipments/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/vendor/vendors_shipments/.swagger-codegen/VERSION b/vendor/vendors_shipments/.swagger-codegen/VERSION deleted file mode 100644 index f1eb5bc..0000000 --- a/vendor/vendors_shipments/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.68 \ No newline at end of file diff --git a/vendor/vendors_shipments/Gemfile b/vendor/vendors_shipments/Gemfile deleted file mode 100644 index c2e3127..0000000 --- a/vendor/vendors_shipments/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gemspec - -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' -end diff --git a/vendor/vendors_shipments/README.md b/vendor/vendors_shipments/README.md deleted file mode 100644 index 310092d..0000000 --- a/vendor/vendors_shipments/README.md +++ /dev/null @@ -1,211 +0,0 @@ -# sp_vendors_shipments - -SpVendorsShipments - the Ruby gem for the Selling Partner API for Retail Procurement Shipments - -The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: v1 -- Package version: 1.0.0 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen -For more information, please visit [https://sellercentral.amazon.com/gp/mws/contactus.html](https://sellercentral.amazon.com/gp/mws/contactus.html) - -## Installation - -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build sp_vendors_shipments.gemspec -``` - -Then either install the gem locally: - -```shell -gem install ./sp_vendors_shipments-1.0.0.gem -``` -(for development, run `gem install --dev ./sp_vendors_shipments-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'sp_vendors_shipments', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'sp_vendors_shipments', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: -```ruby -# Load the gem -require 'sp_vendors_shipments' - -api_instance = SpVendorsShipments::VendorShippingApi.new -opts = { - limit: 789, # Integer | The limit to the number of records returned. Default value is 50 records. - sort_order: 'sort_order_example', # String | Sort in ascending or descending order by purchase order creation date. - next_token: 'next_token_example', # String | Used for pagination when there are more shipments than the specified result size limit. - created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details that became available after this timestamp will be included in the result. Must be in ISO 8601 format. - created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details that became available before this timestamp will be included in the result. Must be in ISO 8601 format. - shipment_confirmed_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipment confirmed create Date Before. Must be in ISO 8601 format. - shipment_confirmed_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipment confirmed create Date After. Must be in ISO 8601 format. - package_label_created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Package label create Date by buyer. Must be in ISO 8601 format. - package_label_created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Package label create Date After by buyer. Must be in ISO 8601 format. - shipped_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipped Date Before. Must be in ISO 8601 format. - shipped_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipped Date After. Must be in ISO 8601 format. - estimated_delivery_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. - estimated_delivery_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. - shipment_delivery_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipment Delivery Date Before. Must be in ISO 8601 format. - shipment_delivery_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Shipment Delivery Date After. Must be in ISO 8601 format. - requested_pick_up_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Before Requested pickup date. Must be in ISO 8601 format. - requested_pick_up_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing After Requested pickup date. Must be in ISO 8601 format. - scheduled_pick_up_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing Before scheduled pickup date. Must be in ISO 8601 format. - scheduled_pick_up_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Get Shipment Details by passing After Scheduled pickup date. Must be in ISO 8601 format. - current_shipment_status: 'current_shipment_status_example', # String | Get Shipment Details by passing Current shipment status. - vendor_shipment_identifier: 'vendor_shipment_identifier_example', # String | Get Shipment Details by passing Vendor Shipment ID - buyer_reference_number: 'buyer_reference_number_example', # String | Get Shipment Details by passing buyer Reference ID - buyer_warehouse_code: 'buyer_warehouse_code_example', # String | Get Shipping Details based on buyer warehouse code. This value should be same as 'shipToParty.partyId' in the Shipment. - seller_warehouse_code: 'seller_warehouse_code_example' # String | Get Shipping Details based on vendor warehouse code. This value should be same as 'sellingParty.partyId' in the Shipment. -} - -begin - #GetShipmentDetails - result = api_instance.get_shipment_details(opts) - p result -rescue SpVendorsShipments::ApiError => e - puts "Exception when calling VendorShippingApi->get_shipment_details: #{e}" -end - -api_instance = SpVendorsShipments::VendorShippingApi.new -opts = { - limit: 789, # Integer | The limit to the number of records returned. Default value is 50 records. - sort_order: 'sort_order_example', # String | Sort the list by shipment label creation date in ascending or descending order. - next_token: 'next_token_example', # String | A token that is used to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. - label_created_after: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Shipment labels created after this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. - label_created_before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Shipment labels created before this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. - buyer_reference_number: 'buyer_reference_number_example', # String | Get Shipment labels by passing buyer reference number. - vendor_shipment_identifier: 'vendor_shipment_identifier_example', # String | Get Shipment labels by passing vendor shipment identifier. - seller_warehouse_code: 'seller_warehouse_code_example' # String | Get Shipping labels based on vendor warehouse code. This value must be same as the `sellingParty.partyId` in the shipment. -} - -begin - result = api_instance.get_shipment_labels(opts) - p result -rescue SpVendorsShipments::ApiError => e - puts "Exception when calling VendorShippingApi->get_shipment_labels: #{e}" -end - -api_instance = SpVendorsShipments::VendorShippingApi.new -body = SpVendorsShipments::SubmitShipmentConfirmationsRequest.new # SubmitShipmentConfirmationsRequest | A request to submit shipment confirmation. - - -begin - #SubmitShipmentConfirmations - result = api_instance.submit_shipment_confirmations(body) - p result -rescue SpVendorsShipments::ApiError => e - puts "Exception when calling VendorShippingApi->submit_shipment_confirmations: #{e}" -end - -api_instance = SpVendorsShipments::VendorShippingApi.new -body = SpVendorsShipments::SubmitShipments.new # SubmitShipments | A request to submit shipment request. - - -begin - #SubmitShipments - result = api_instance.submit_shipments(body) - p result -rescue SpVendorsShipments::ApiError => e - puts "Exception when calling VendorShippingApi->submit_shipments: #{e}" -end -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://sellingpartnerapi-na.amazon.com/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SpVendorsShipments::VendorShippingApi* | [**get_shipment_details**](docs/VendorShippingApi.md#get_shipment_details) | **GET** /vendor/shipping/v1/shipments | GetShipmentDetails -*SpVendorsShipments::VendorShippingApi* | [**get_shipment_labels**](docs/VendorShippingApi.md#get_shipment_labels) | **GET** /vendor/shipping/v1/transportLabels | -*SpVendorsShipments::VendorShippingApi* | [**submit_shipment_confirmations**](docs/VendorShippingApi.md#submit_shipment_confirmations) | **POST** /vendor/shipping/v1/shipmentConfirmations | SubmitShipmentConfirmations -*SpVendorsShipments::VendorShippingApi* | [**submit_shipments**](docs/VendorShippingApi.md#submit_shipments) | **POST** /vendor/shipping/v1/shipments | SubmitShipments - -## Documentation for Models - - - [SpVendorsShipments::Address](docs/Address.md) - - [SpVendorsShipments::CarrierDetails](docs/CarrierDetails.md) - - [SpVendorsShipments::Carton](docs/Carton.md) - - [SpVendorsShipments::CartonReferenceDetails](docs/CartonReferenceDetails.md) - - [SpVendorsShipments::CollectFreightPickupDetails](docs/CollectFreightPickupDetails.md) - - [SpVendorsShipments::ContainerIdentification](docs/ContainerIdentification.md) - - [SpVendorsShipments::ContainerItem](docs/ContainerItem.md) - - [SpVendorsShipments::ContainerSequenceNumbers](docs/ContainerSequenceNumbers.md) - - [SpVendorsShipments::Containers](docs/Containers.md) - - [SpVendorsShipments::Decimal](docs/Decimal.md) - - [SpVendorsShipments::Dimensions](docs/Dimensions.md) - - [SpVendorsShipments::Duration](docs/Duration.md) - - [SpVendorsShipments::Error](docs/Error.md) - - [SpVendorsShipments::ErrorList](docs/ErrorList.md) - - [SpVendorsShipments::Expiry](docs/Expiry.md) - - [SpVendorsShipments::GetShipmentDetailsResponse](docs/GetShipmentDetailsResponse.md) - - [SpVendorsShipments::GetShipmentLabels](docs/GetShipmentLabels.md) - - [SpVendorsShipments::ImportDetails](docs/ImportDetails.md) - - [SpVendorsShipments::InnerContainersDetails](docs/InnerContainersDetails.md) - - [SpVendorsShipments::Item](docs/Item.md) - - [SpVendorsShipments::ItemDetails](docs/ItemDetails.md) - - [SpVendorsShipments::ItemQuantity](docs/ItemQuantity.md) - - [SpVendorsShipments::LabelData](docs/LabelData.md) - - [SpVendorsShipments::Location](docs/Location.md) - - [SpVendorsShipments::Money](docs/Money.md) - - [SpVendorsShipments::PackageItemDetails](docs/PackageItemDetails.md) - - [SpVendorsShipments::PackedItems](docs/PackedItems.md) - - [SpVendorsShipments::PackedQuantity](docs/PackedQuantity.md) - - [SpVendorsShipments::Pagination](docs/Pagination.md) - - [SpVendorsShipments::Pallet](docs/Pallet.md) - - [SpVendorsShipments::PartyIdentification](docs/PartyIdentification.md) - - [SpVendorsShipments::PurchaseOrderItemDetails](docs/PurchaseOrderItemDetails.md) - - [SpVendorsShipments::PurchaseOrderItems](docs/PurchaseOrderItems.md) - - [SpVendorsShipments::PurchaseOrders](docs/PurchaseOrders.md) - - [SpVendorsShipments::Route](docs/Route.md) - - [SpVendorsShipments::Shipment](docs/Shipment.md) - - [SpVendorsShipments::ShipmentConfirmation](docs/ShipmentConfirmation.md) - - [SpVendorsShipments::ShipmentDetails](docs/ShipmentDetails.md) - - [SpVendorsShipments::ShipmentInformation](docs/ShipmentInformation.md) - - [SpVendorsShipments::ShipmentMeasurements](docs/ShipmentMeasurements.md) - - [SpVendorsShipments::ShipmentStatusDetails](docs/ShipmentStatusDetails.md) - - [SpVendorsShipments::Stop](docs/Stop.md) - - [SpVendorsShipments::SubmitShipmentConfirmationsRequest](docs/SubmitShipmentConfirmationsRequest.md) - - [SpVendorsShipments::SubmitShipmentConfirmationsResponse](docs/SubmitShipmentConfirmationsResponse.md) - - [SpVendorsShipments::SubmitShipments](docs/SubmitShipments.md) - - [SpVendorsShipments::TaxRegistrationDetails](docs/TaxRegistrationDetails.md) - - [SpVendorsShipments::TotalWeight](docs/TotalWeight.md) - - [SpVendorsShipments::TransactionReference](docs/TransactionReference.md) - - [SpVendorsShipments::TransportLabel](docs/TransportLabel.md) - - [SpVendorsShipments::TransportShipmentMeasurements](docs/TransportShipmentMeasurements.md) - - [SpVendorsShipments::TransportationDetails](docs/TransportationDetails.md) - - [SpVendorsShipments::TransportationDetailsForShipmentConfirmation](docs/TransportationDetailsForShipmentConfirmation.md) - - [SpVendorsShipments::TransportationLabels](docs/TransportationLabels.md) - - [SpVendorsShipments::VendorDetails](docs/VendorDetails.md) - - [SpVendorsShipments::Volume](docs/Volume.md) - - [SpVendorsShipments::Weight](docs/Weight.md) - -## Documentation for Authorization - - All endpoints do not require authorization. - diff --git a/vendor/vendors_shipments/Rakefile b/vendor/vendors_shipments/Rakefile deleted file mode 100644 index d52c3e3..0000000 --- a/vendor/vendors_shipments/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end diff --git a/vendor/vendors_shipments/git_push.sh b/vendor/vendors_shipments/git_push.sh deleted file mode 100644 index 89eb49e..0000000 --- a/vendor/vendors_shipments/git_push.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/api_client.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/api_client.rb deleted file mode 100644 index 80af86f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/api_client.rb +++ /dev/null @@ -1,389 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'typhoeus' -require 'uri' - -module AmazonSpClients - module SpVendorsShipments - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - SpVendorsShipments.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/api_error.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/api_error.rb deleted file mode 100644 index ae60002..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/api_error.rb +++ /dev/null @@ -1,59 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorsShipments - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - - end - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/configuration.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/configuration.rb deleted file mode 100644 index eaef27b..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/configuration.rb +++ /dev/null @@ -1,200 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module AmazonSpClients - module SpVendorsShipments - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'sellingpartnerapi-na.amazon.com' - @base_path = 'https://sellingpartnerapi-na.amazon.com/' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - } - end - end - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/address.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/address.rb deleted file mode 100644 index d70001f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/address.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Address of the party. - class Address - # The name of the person, business or institution at that address. - attr_accessor :name - - # First line of the address. - attr_accessor :address_line1 - - # Additional street address information, if required. - attr_accessor :address_line2 - - # Additional street address information, if required. - attr_accessor :address_line3 - - # The city where the person, business or institution is located. - attr_accessor :city - - # The county where person, business or institution is located. - attr_accessor :county - - # The district where person, business or institution is located. - attr_accessor :district - - # The state or region where person, business or institution is located. - attr_accessor :state_or_region - - # The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation. - attr_accessor :postal_code - - # The two digit country code in ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # The phone number of the person, business or institution located at that address. - attr_accessor :phone - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address_line1' => :'addressLine1', - :'address_line2' => :'addressLine2', - :'address_line3' => :'addressLine3', - :'city' => :'city', - :'county' => :'county', - :'district' => :'district', - :'state_or_region' => :'stateOrRegion', - :'postal_code' => :'postalCode', - :'country_code' => :'countryCode', - :'phone' => :'phone' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'address_line1' => :'Object', - :'address_line2' => :'Object', - :'address_line3' => :'Object', - :'city' => :'Object', - :'county' => :'Object', - :'district' => :'Object', - :'state_or_region' => :'Object', - :'postal_code' => :'Object', - :'country_code' => :'Object', - :'phone' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'county') - self.county = attributes[:'county'] - end - - if attributes.key?(:'district') - self.district = attributes[:'district'] - end - - if attributes.key?(:'state_or_region') - self.state_or_region = attributes[:'state_or_region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address_line1.nil? - invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @address_line1.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - city == o.city && - county == o.county && - district == o.district && - state_or_region == o.state_or_region && - postal_code == o.postal_code && - country_code == o.country_code && - phone == o.phone - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address_line1, address_line2, address_line3, city, county, district, state_or_region, postal_code, country_code, phone].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carrier_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carrier_details.rb deleted file mode 100644 index 83dfcb5..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carrier_details.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Indicates the carrier details and their contact informations - class CarrierDetails - # The field is used to represent the carrier used for performing the shipment. - attr_accessor :name - - # Code that identifies the carrier for the shipment. The Standard Carrier Alpha Code (SCAC) is a unique two to four letter code used to identify a carrier. Carrier SCAC codes are assigned and maintained by the NMFTA (National Motor Freight Association). - attr_accessor :code - - # The field is used to represent the Carrier contact number. - attr_accessor :phone - - # The field is used to represent the carrier Email id. - attr_accessor :email - - # The field is also known as PRO number is a unique number assigned by the carrier. It is used to identify and track the shipment that goes out for delivery. This field is mandatory for US, CA, MX shipment confirmations. - attr_accessor :shipment_reference_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'code' => :'code', - :'phone' => :'phone', - :'email' => :'email', - :'shipment_reference_number' => :'shipmentReferenceNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'Object', - :'code' => :'Object', - :'phone' => :'Object', - :'email' => :'Object', - :'shipment_reference_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::CarrierDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::CarrierDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'shipment_reference_number') - self.shipment_reference_number = attributes[:'shipment_reference_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - code == o.code && - phone == o.phone && - email == o.email && - shipment_reference_number == o.shipment_reference_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, code, phone, email, shipment_reference_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton.rb deleted file mode 100644 index 46213e8..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the carton/package being shipped. - class Carton - # A list of carton identifiers. - attr_accessor :carton_identifiers - - # Carton sequence number for the carton. The first carton will be 001, the second 002, and so on. This number is used as a reference to refer to this carton from the pallet level. - attr_accessor :carton_sequence_number - - attr_accessor :dimensions - - attr_accessor :weight - - # This is required to be provided for every carton in the small parcel shipments. - attr_accessor :tracking_number - - # A list of container item details. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carton_identifiers' => :'cartonIdentifiers', - :'carton_sequence_number' => :'cartonSequenceNumber', - :'dimensions' => :'dimensions', - :'weight' => :'weight', - :'tracking_number' => :'trackingNumber', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carton_identifiers' => :'Object', - :'carton_sequence_number' => :'Object', - :'dimensions' => :'Object', - :'weight' => :'Object', - :'tracking_number' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Carton` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Carton`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carton_identifiers') - if (value = attributes[:'carton_identifiers']).is_a?(Array) - self.carton_identifiers = value - end - end - - if attributes.key?(:'carton_sequence_number') - self.carton_sequence_number = attributes[:'carton_sequence_number'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carton_sequence_number.nil? - invalid_properties.push('invalid value for "carton_sequence_number", carton_sequence_number cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carton_sequence_number.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carton_identifiers == o.carton_identifiers && - carton_sequence_number == o.carton_sequence_number && - dimensions == o.dimensions && - weight == o.weight && - tracking_number == o.tracking_number && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carton_identifiers, carton_sequence_number, dimensions, weight, tracking_number, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton_reference_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton_reference_details.rb deleted file mode 100644 index 06a84ad..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/carton_reference_details.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Carton reference details. - class CartonReferenceDetails - # Pallet level carton count is mandatory for single item pallet and optional for mixed item pallet. - attr_accessor :carton_count - - # Array of reference numbers for the carton that are part of this pallet/shipment. Please provide the cartonSequenceNumber from the 'cartons' segment to refer to that carton's details here. - attr_accessor :carton_reference_numbers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carton_count' => :'cartonCount', - :'carton_reference_numbers' => :'cartonReferenceNumbers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carton_count' => :'Object', - :'carton_reference_numbers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::CartonReferenceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::CartonReferenceDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carton_count') - self.carton_count = attributes[:'carton_count'] - end - - if attributes.key?(:'carton_reference_numbers') - if (value = attributes[:'carton_reference_numbers']).is_a?(Array) - self.carton_reference_numbers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @carton_reference_numbers.nil? - invalid_properties.push('invalid value for "carton_reference_numbers", carton_reference_numbers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @carton_reference_numbers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carton_count == o.carton_count && - carton_reference_numbers == o.carton_reference_numbers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carton_count, carton_reference_numbers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/collect_freight_pickup_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/collect_freight_pickup_details.rb deleted file mode 100644 index 63e9bad..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/collect_freight_pickup_details.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Transport Request pickup date from Vendor Warehouse by Buyer - class CollectFreightPickupDetails - # Date on which the items can be picked up from vendor warehouse by Buyer used for WePay/Collect vendors. - attr_accessor :requested_pick_up - - # Date on which the items are scheduled to be picked from vendor warehouse by Buyer used for WePay/Collect vendors. - attr_accessor :scheduled_pick_up - - # Date on which the carrier is being scheduled to pickup items from vendor warehouse by Byer used for WePay/Collect vendors. - attr_accessor :carrier_assignment_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'requested_pick_up' => :'requestedPickUp', - :'scheduled_pick_up' => :'scheduledPickUp', - :'carrier_assignment_date' => :'carrierAssignmentDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'requested_pick_up' => :'Object', - :'scheduled_pick_up' => :'Object', - :'carrier_assignment_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::CollectFreightPickupDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::CollectFreightPickupDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'requested_pick_up') - self.requested_pick_up = attributes[:'requested_pick_up'] - end - - if attributes.key?(:'scheduled_pick_up') - self.scheduled_pick_up = attributes[:'scheduled_pick_up'] - end - - if attributes.key?(:'carrier_assignment_date') - self.carrier_assignment_date = attributes[:'carrier_assignment_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - requested_pick_up == o.requested_pick_up && - scheduled_pick_up == o.scheduled_pick_up && - carrier_assignment_date == o.carrier_assignment_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [requested_pick_up, scheduled_pick_up, carrier_assignment_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_identification.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_identification.rb deleted file mode 100644 index 01d6a32..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_identification.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of carton identifiers. - class ContainerIdentification - # The container identification type. - attr_accessor :container_identification_type - - # Container identification number that adheres to the definition of the container identification type. - attr_accessor :container_identification_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_identification_type' => :'containerIdentificationType', - :'container_identification_number' => :'containerIdentificationNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_identification_type' => :'Object', - :'container_identification_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ContainerIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ContainerIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_identification_type') - self.container_identification_type = attributes[:'container_identification_type'] - end - - if attributes.key?(:'container_identification_number') - self.container_identification_number = attributes[:'container_identification_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @container_identification_type.nil? - invalid_properties.push('invalid value for "container_identification_type", container_identification_type cannot be nil.') - end - - if @container_identification_number.nil? - invalid_properties.push('invalid value for "container_identification_number", container_identification_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @container_identification_type.nil? - container_identification_type_validator = EnumAttributeValidator.new('Object', ['SSCC', 'AMZNCC', 'GTIN', 'BPS', 'CID']) - return false unless container_identification_type_validator.valid?(@container_identification_type) - return false if @container_identification_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] container_identification_type Object to be assigned - def container_identification_type=(container_identification_type) - validator = EnumAttributeValidator.new('Object', ['SSCC', 'AMZNCC', 'GTIN', 'BPS', 'CID']) - unless validator.valid?(container_identification_type) - fail ArgumentError, "invalid value for \"container_identification_type\", must be one of #{validator.allowable_values}." - end - @container_identification_type = container_identification_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_identification_type == o.container_identification_type && - container_identification_number == o.container_identification_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_identification_type, container_identification_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_item.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_item.rb deleted file mode 100644 index da285ad..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_item.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Carton/Pallet level details for the item. - class ContainerItem - # The reference number for the item. Please provide the itemSequenceNumber from the 'items' segment to refer to that item's details here. - attr_accessor :item_reference - - attr_accessor :shipped_quantity - - attr_accessor :item_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_reference' => :'itemReference', - :'shipped_quantity' => :'shippedQuantity', - :'item_details' => :'itemDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_reference' => :'Object', - :'shipped_quantity' => :'Object', - :'item_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ContainerItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ContainerItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_reference') - self.item_reference = attributes[:'item_reference'] - end - - if attributes.key?(:'shipped_quantity') - self.shipped_quantity = attributes[:'shipped_quantity'] - end - - if attributes.key?(:'item_details') - self.item_details = attributes[:'item_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_reference.nil? - invalid_properties.push('invalid value for "item_reference", item_reference cannot be nil.') - end - - if @shipped_quantity.nil? - invalid_properties.push('invalid value for "shipped_quantity", shipped_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_reference.nil? - return false if @shipped_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_reference == o.item_reference && - shipped_quantity == o.shipped_quantity && - item_details == o.item_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_reference, shipped_quantity, item_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_sequence_numbers.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_sequence_numbers.rb deleted file mode 100644 index 9290221..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/container_sequence_numbers.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Container sequence numbers that are involved in this shipment. - class ContainerSequenceNumbers - # A list of containers shipped - attr_accessor :container_sequence_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_sequence_number' => :'containerSequenceNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_sequence_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ContainerSequenceNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ContainerSequenceNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_sequence_number') - self.container_sequence_number = attributes[:'container_sequence_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_sequence_number == o.container_sequence_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_sequence_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/containers.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/containers.rb deleted file mode 100644 index 8ed050f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/containers.rb +++ /dev/null @@ -1,347 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of the items in this transportation and their associated inner container details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level. - class Containers - # The type of container. - attr_accessor :container_type - - # An integer that must be submitted for multi-box shipments only, where one item may come in separate packages. - attr_accessor :container_sequence_number - - # A list of carton identifiers. - attr_accessor :container_identifiers - - # The tracking number used for identifying the shipment. - attr_accessor :tracking_number - - attr_accessor :dimensions - - attr_accessor :weight - - # Number of layers per pallet. - attr_accessor :tier - - # Number of cartons per layer on the pallet. - attr_accessor :block - - attr_accessor :inner_containers_details - - # A list of packed items. - attr_accessor :packed_items - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_type' => :'containerType', - :'container_sequence_number' => :'containerSequenceNumber', - :'container_identifiers' => :'containerIdentifiers', - :'tracking_number' => :'trackingNumber', - :'dimensions' => :'dimensions', - :'weight' => :'weight', - :'tier' => :'tier', - :'block' => :'block', - :'inner_containers_details' => :'innerContainersDetails', - :'packed_items' => :'packedItems' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_type' => :'Object', - :'container_sequence_number' => :'Object', - :'container_identifiers' => :'Object', - :'tracking_number' => :'Object', - :'dimensions' => :'Object', - :'weight' => :'Object', - :'tier' => :'Object', - :'block' => :'Object', - :'inner_containers_details' => :'Object', - :'packed_items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Containers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Containers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_type') - self.container_type = attributes[:'container_type'] - end - - if attributes.key?(:'container_sequence_number') - self.container_sequence_number = attributes[:'container_sequence_number'] - end - - if attributes.key?(:'container_identifiers') - if (value = attributes[:'container_identifiers']).is_a?(Array) - self.container_identifiers = value - end - end - - if attributes.key?(:'tracking_number') - self.tracking_number = attributes[:'tracking_number'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'tier') - self.tier = attributes[:'tier'] - end - - if attributes.key?(:'block') - self.block = attributes[:'block'] - end - - if attributes.key?(:'inner_containers_details') - self.inner_containers_details = attributes[:'inner_containers_details'] - end - - if attributes.key?(:'packed_items') - if (value = attributes[:'packed_items']).is_a?(Array) - self.packed_items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @container_type.nil? - invalid_properties.push('invalid value for "container_type", container_type cannot be nil.') - end - - if @container_identifiers.nil? - invalid_properties.push('invalid value for "container_identifiers", container_identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @container_type.nil? - container_type_validator = EnumAttributeValidator.new('Object', ['carton', 'pallet']) - return false unless container_type_validator.valid?(@container_type) - return false if @container_identifiers.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] container_type Object to be assigned - def container_type=(container_type) - validator = EnumAttributeValidator.new('Object', ['carton', 'pallet']) - unless validator.valid?(container_type) - fail ArgumentError, "invalid value for \"container_type\", must be one of #{validator.allowable_values}." - end - @container_type = container_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_type == o.container_type && - container_sequence_number == o.container_sequence_number && - container_identifiers == o.container_identifiers && - tracking_number == o.tracking_number && - dimensions == o.dimensions && - weight == o.weight && - tier == o.tier && - block == o.block && - inner_containers_details == o.inner_containers_details && - packed_items == o.packed_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_type, container_sequence_number, container_identifiers, tracking_number, dimensions, weight, tier, block, inner_containers_details, packed_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/decimal.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/decimal.rb deleted file mode 100644 index 57cd475..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/decimal.rb +++ /dev/null @@ -1,202 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`. - class Decimal - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Decimal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Decimal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/dimensions.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/dimensions.rb deleted file mode 100644 index 48560b9..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/dimensions.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Physical dimensional measurements of a container. - class Dimensions - attr_accessor :length - - attr_accessor :width - - attr_accessor :height - - # The unit of measure for dimensions. - attr_accessor :unit_of_measure - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'length', - :'width' => :'width', - :'height' => :'height', - :'unit_of_measure' => :'unitOfMeasure' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Object', - :'width' => :'Object', - :'height' => :'Object', - :'unit_of_measure' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Dimensions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Dimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - - if attributes.key?(:'width') - self.width = attributes[:'width'] - end - - if attributes.key?(:'height') - self.height = attributes[:'height'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @length.nil? - invalid_properties.push('invalid value for "length", length cannot be nil.') - end - - if @width.nil? - invalid_properties.push('invalid value for "width", width cannot be nil.') - end - - if @height.nil? - invalid_properties.push('invalid value for "height", height cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @length.nil? - return false if @width.nil? - return false if @height.nil? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['In', 'Ft', 'Meter', 'Yard']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['In', 'Ft', 'Meter', 'Yard']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length && - width == o.width && - height == o.height && - unit_of_measure == o.unit_of_measure - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length, width, height, unit_of_measure].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/duration.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/duration.rb deleted file mode 100644 index 6ecc798..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/duration.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Duration after manufacturing date during which the product is valid for consumption. - class Duration - # Unit for duration. - attr_accessor :duration_unit - - # Value for the duration in terms of the durationUnit. - attr_accessor :duration_value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'duration_unit' => :'durationUnit', - :'duration_value' => :'durationValue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'duration_unit' => :'Object', - :'duration_value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Duration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Duration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'duration_unit') - self.duration_unit = attributes[:'duration_unit'] - end - - if attributes.key?(:'duration_value') - self.duration_value = attributes[:'duration_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @duration_unit.nil? - invalid_properties.push('invalid value for "duration_unit", duration_unit cannot be nil.') - end - - if @duration_value.nil? - invalid_properties.push('invalid value for "duration_value", duration_value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @duration_unit.nil? - duration_unit_validator = EnumAttributeValidator.new('Object', ['Days', 'Months']) - return false unless duration_unit_validator.valid?(@duration_unit) - return false if @duration_value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] duration_unit Object to be assigned - def duration_unit=(duration_unit) - validator = EnumAttributeValidator.new('Object', ['Days', 'Months']) - unless validator.valid?(duration_unit) - fail ArgumentError, "invalid value for \"duration_unit\", must be one of #{validator.allowable_values}." - end - @duration_unit = duration_unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - duration_unit == o.duration_unit && - duration_value == o.duration_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [duration_unit, duration_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error.rb deleted file mode 100644 index c93c42b..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Error response returned when the request is unsuccessful. - class Error - # An error code that identifies the type of error that occurred. - attr_accessor :code - - # A message that describes the error condition. - attr_accessor :message - - # Additional details that can help the caller understand or fix the issue. - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'Object', - :'message' => :'Object', - :'details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @message.nil? - invalid_properties.push('invalid value for "message", message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error_list.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error_list.rb deleted file mode 100644 index 31b3697..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/error_list.rb +++ /dev/null @@ -1,206 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of error responses returned when a request is unsuccessful. - class ErrorList - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ErrorList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ErrorList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/expiry.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/expiry.rb deleted file mode 100644 index 6c646cc..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/expiry.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Expiry refers to the collection of dates required for certain items. These could be either expiryDate or mfgDate and expiryAfterDuration. These are mandatory for perishable items. - class Expiry - # Production, packaging or assembly date determined by the manufacturer. Its meaning is determined based on the trade item context. - attr_accessor :manufacturer_date - - # The date that determines the limit of consumption or use of a product. Its meaning is determined based on the trade item context. - attr_accessor :expiry_date - - attr_accessor :expiry_after_duration - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'manufacturer_date' => :'manufacturerDate', - :'expiry_date' => :'expiryDate', - :'expiry_after_duration' => :'expiryAfterDuration' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'manufacturer_date' => :'Object', - :'expiry_date' => :'Object', - :'expiry_after_duration' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Expiry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Expiry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'manufacturer_date') - self.manufacturer_date = attributes[:'manufacturer_date'] - end - - if attributes.key?(:'expiry_date') - self.expiry_date = attributes[:'expiry_date'] - end - - if attributes.key?(:'expiry_after_duration') - self.expiry_after_duration = attributes[:'expiry_after_duration'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - manufacturer_date == o.manufacturer_date && - expiry_date == o.expiry_date && - expiry_after_duration == o.expiry_after_duration - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [manufacturer_date, expiry_date, expiry_after_duration].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_details_response.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_details_response.rb deleted file mode 100644 index ca203fe..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_details_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The response schema for the GetShipmentDetails operation. - class GetShipmentDetailsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::GetShipmentDetailsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::GetShipmentDetailsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_labels.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_labels.rb deleted file mode 100644 index 3ec0c91..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/get_shipment_labels.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The response schema for the GetShipmentLabels operation. - class GetShipmentLabels - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::GetShipmentLabels` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::GetShipmentLabels`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/import_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/import_details.rb deleted file mode 100644 index fb3927f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/import_details.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Provide these fields only if this shipment is a direct import. - class ImportDetails - # This is used for import purchase orders only. If the recipient requests, this field will contain the shipment method of payment. - attr_accessor :method_of_payment - - # The container's seal number. - attr_accessor :seal_number - - attr_accessor :route - - # Types and numbers of container(s) for import purchase orders. Can be a comma-separated list if shipment has multiple containers. - attr_accessor :import_containers - - attr_accessor :billable_weight - - # Date on which the shipment is expected to be shipped. This value should not be in the past and not more than 60 days out in the future. - attr_accessor :estimated_ship_by_date - - # Identification of the instructions on how specified item/carton/pallet should be handled. - attr_accessor :handling_instructions - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'method_of_payment' => :'methodOfPayment', - :'seal_number' => :'sealNumber', - :'route' => :'route', - :'import_containers' => :'importContainers', - :'billable_weight' => :'billableWeight', - :'estimated_ship_by_date' => :'estimatedShipByDate', - :'handling_instructions' => :'handlingInstructions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'method_of_payment' => :'Object', - :'seal_number' => :'Object', - :'route' => :'Object', - :'import_containers' => :'Object', - :'billable_weight' => :'Object', - :'estimated_ship_by_date' => :'Object', - :'handling_instructions' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ImportDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ImportDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'method_of_payment') - self.method_of_payment = attributes[:'method_of_payment'] - end - - if attributes.key?(:'seal_number') - self.seal_number = attributes[:'seal_number'] - end - - if attributes.key?(:'route') - self.route = attributes[:'route'] - end - - if attributes.key?(:'import_containers') - self.import_containers = attributes[:'import_containers'] - end - - if attributes.key?(:'billable_weight') - self.billable_weight = attributes[:'billable_weight'] - end - - if attributes.key?(:'estimated_ship_by_date') - self.estimated_ship_by_date = attributes[:'estimated_ship_by_date'] - end - - if attributes.key?(:'handling_instructions') - self.handling_instructions = attributes[:'handling_instructions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - method_of_payment_validator = EnumAttributeValidator.new('Object', ['PaidByBuyer', 'CollectOnDelivery', 'DefinedByBuyerAndSeller', 'FOBPortOfCall', 'PrepaidBySeller', 'PaidBySeller']) - return false unless method_of_payment_validator.valid?(@method_of_payment) - handling_instructions_validator = EnumAttributeValidator.new('Object', ['Oversized', 'Fragile', 'Food', 'HandleWithCare']) - return false unless handling_instructions_validator.valid?(@handling_instructions) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] method_of_payment Object to be assigned - def method_of_payment=(method_of_payment) - validator = EnumAttributeValidator.new('Object', ['PaidByBuyer', 'CollectOnDelivery', 'DefinedByBuyerAndSeller', 'FOBPortOfCall', 'PrepaidBySeller', 'PaidBySeller']) - unless validator.valid?(method_of_payment) - fail ArgumentError, "invalid value for \"method_of_payment\", must be one of #{validator.allowable_values}." - end - @method_of_payment = method_of_payment - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] handling_instructions Object to be assigned - def handling_instructions=(handling_instructions) - validator = EnumAttributeValidator.new('Object', ['Oversized', 'Fragile', 'Food', 'HandleWithCare']) - unless validator.valid?(handling_instructions) - fail ArgumentError, "invalid value for \"handling_instructions\", must be one of #{validator.allowable_values}." - end - @handling_instructions = handling_instructions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - method_of_payment == o.method_of_payment && - seal_number == o.seal_number && - route == o.route && - import_containers == o.import_containers && - billable_weight == o.billable_weight && - estimated_ship_by_date == o.estimated_ship_by_date && - handling_instructions == o.handling_instructions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [method_of_payment, seal_number, route, import_containers, billable_weight, estimated_ship_by_date, handling_instructions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/inner_containers_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/inner_containers_details.rb deleted file mode 100644 index 94ec418..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/inner_containers_details.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the innerContainersDetails. - class InnerContainersDetails - # Total containers as part of the shipment - attr_accessor :container_count - - # Container sequence numbers that are involved in this shipment. - attr_accessor :container_sequence_numbers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'container_count' => :'containerCount', - :'container_sequence_numbers' => :'containerSequenceNumbers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'container_count' => :'Object', - :'container_sequence_numbers' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::InnerContainersDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::InnerContainersDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'container_count') - self.container_count = attributes[:'container_count'] - end - - if attributes.key?(:'container_sequence_numbers') - if (value = attributes[:'container_sequence_numbers']).is_a?(Array) - self.container_sequence_numbers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - container_count == o.container_count && - container_sequence_numbers == o.container_sequence_numbers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [container_count, container_sequence_numbers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item.rb deleted file mode 100644 index e34c743..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the item being shipped. - class Item - # Item sequence number for the item. The first item will be 001, the second 002, and so on. This number is used as a reference to refer to this item from the carton or pallet level. - attr_accessor :item_sequence_number - - # Buyer Standard Identification Number (ASIN) of an item. - attr_accessor :amazon_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :shipped_quantity - - attr_accessor :item_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'amazon_product_identifier' => :'amazonProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'shipped_quantity' => :'shippedQuantity', - :'item_details' => :'itemDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'amazon_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'shipped_quantity' => :'Object', - :'item_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'amazon_product_identifier') - self.amazon_product_identifier = attributes[:'amazon_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'shipped_quantity') - self.shipped_quantity = attributes[:'shipped_quantity'] - end - - if attributes.key?(:'item_details') - self.item_details = attributes[:'item_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @shipped_quantity.nil? - invalid_properties.push('invalid value for "shipped_quantity", shipped_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @shipped_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - amazon_product_identifier == o.amazon_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - shipped_quantity == o.shipped_quantity && - item_details == o.item_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, amazon_product_identifier, vendor_product_identifier, shipped_quantity, item_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_details.rb deleted file mode 100644 index 864cc29..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_details.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Item details for be provided for every item in shipment at either the item or carton or pallet level, whichever is appropriate. - class ItemDetails - # The purchase order number for the shipment being confirmed. If the items in this shipment belong to multiple purchase order numbers that are in particular carton or pallet within the shipment, then provide the purchaseOrderNumber at the appropriate carton or pallet level. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - # The batch or lot number associates an item with information the manufacturer considers relevant for traceability of the trade item to which the Element String is applied. The data may refer to the trade item itself or to items contained. This field is mandatory for all perishable items. - attr_accessor :lot_number - - attr_accessor :expiry - - attr_accessor :maximum_retail_price - - # Identification of the instructions on how specified item/carton/pallet should be handled. - attr_accessor :handling_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'lot_number' => :'lotNumber', - :'expiry' => :'expiry', - :'maximum_retail_price' => :'maximumRetailPrice', - :'handling_code' => :'handlingCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'lot_number' => :'Object', - :'expiry' => :'Object', - :'maximum_retail_price' => :'Object', - :'handling_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ItemDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ItemDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'lot_number') - self.lot_number = attributes[:'lot_number'] - end - - if attributes.key?(:'expiry') - self.expiry = attributes[:'expiry'] - end - - if attributes.key?(:'maximum_retail_price') - self.maximum_retail_price = attributes[:'maximum_retail_price'] - end - - if attributes.key?(:'handling_code') - self.handling_code = attributes[:'handling_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - handling_code_validator = EnumAttributeValidator.new('Object', ['Oversized', 'Fragile', 'Food', 'HandleWithCare']) - return false unless handling_code_validator.valid?(@handling_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] handling_code Object to be assigned - def handling_code=(handling_code) - validator = EnumAttributeValidator.new('Object', ['Oversized', 'Fragile', 'Food', 'HandleWithCare']) - unless validator.valid?(handling_code) - fail ArgumentError, "invalid value for \"handling_code\", must be one of #{validator.allowable_values}." - end - @handling_code = handling_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - lot_number == o.lot_number && - expiry == o.expiry && - maximum_retail_price == o.maximum_retail_price && - handling_code == o.handling_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, lot_number, expiry, maximum_retail_price, handling_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_quantity.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_quantity.rb deleted file mode 100644 index e92317a..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/item_quantity.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of item quantity. - class ItemQuantity - # Amount of units shipped for a specific item at a shipment level. If the item is present only in certain cartons or pallets within the shipment, please provide this at the appropriate carton or pallet level. - attr_accessor :amount - - # Unit of measure for the shipped quantity. - attr_accessor :unit_of_measure - - # The case size, in the event that we ordered using cases. Otherwise, 1. - attr_accessor :unit_size - - attr_accessor :total_weight - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure', - :'unit_size' => :'unitSize', - :'total_weight' => :'totalWeight' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object', - :'unit_size' => :'Object', - :'total_weight' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ItemQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ItemQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'unit_size') - self.unit_size = attributes[:'unit_size'] - end - - if attributes.key?(:'total_weight') - self.total_weight = attributes[:'total_weight'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure && - unit_size == o.unit_size && - total_weight == o.total_weight - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure, unit_size, total_weight].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/label_data.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/label_data.rb deleted file mode 100644 index 73ef6fb..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/label_data.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Label details as part of the transport label response - class LabelData - # A sequential number assigned to each label within a shipment. - attr_accessor :label_sequence_number - - # The format of the label. - attr_accessor :label_format - - # Unique identification of the carrier. - attr_accessor :carrier_code - - # Tracking Id for the transportation. - attr_accessor :tracking_id - - # The base-64 encoded string that represents the shipment label. - attr_accessor :label - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_sequence_number' => :'labelSequenceNumber', - :'label_format' => :'labelFormat', - :'carrier_code' => :'carrierCode', - :'tracking_id' => :'trackingId', - :'label' => :'label' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_sequence_number' => :'Object', - :'label_format' => :'Object', - :'carrier_code' => :'Object', - :'tracking_id' => :'Object', - :'label' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::LabelData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::LabelData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_sequence_number') - self.label_sequence_number = attributes[:'label_sequence_number'] - end - - if attributes.key?(:'label_format') - self.label_format = attributes[:'label_format'] - end - - if attributes.key?(:'carrier_code') - self.carrier_code = attributes[:'carrier_code'] - end - - if attributes.key?(:'tracking_id') - self.tracking_id = attributes[:'tracking_id'] - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - label_format_validator = EnumAttributeValidator.new('Object', ['PDF']) - return false unless label_format_validator.valid?(@label_format) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] label_format Object to be assigned - def label_format=(label_format) - validator = EnumAttributeValidator.new('Object', ['PDF']) - unless validator.valid?(label_format) - fail ArgumentError, "invalid value for \"label_format\", must be one of #{validator.allowable_values}." - end - @label_format = label_format - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_sequence_number == o.label_sequence_number && - label_format == o.label_format && - carrier_code == o.carrier_code && - tracking_id == o.tracking_id && - label == o.label - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_sequence_number, label_format, carrier_code, tracking_id, label].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/location.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/location.rb deleted file mode 100644 index 8e063b3..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/location.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Location identifier. - class Location - # Type of location identification. - attr_accessor :type - - # Location code. - attr_accessor :location_code - - # The two digit country code. In ISO 3166-1 alpha-2 format. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'location_code' => :'locationCode', - :'country_code' => :'countryCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'Object', - :'location_code' => :'Object', - :'country_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Location` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Location`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'location_code') - self.location_code = attributes[:'location_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - location_code == o.location_code && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, location_code, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/money.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/money.rb deleted file mode 100644 index 5af119c..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/money.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # An amount of money, including units in the form of currency. - class Money - # Three digit currency code in ISO 4217 format. - attr_accessor :currency_code - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency_code' => :'currencyCode', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency_code' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Money` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Money`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency_code.nil? - invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency_code.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency_code == o.currency_code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency_code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/package_item_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/package_item_details.rb deleted file mode 100644 index 4535b1f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/package_item_details.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Item details for be provided for every item in shipment at either the item or carton or pallet level, whichever is appropriate. - class PackageItemDetails - # The purchase order number for the shipment being confirmed. If the items in this shipment belong to multiple purchase order numbers that are in particular carton or pallet within the shipment, then provide the purchaseOrderNumber at the appropriate carton or pallet level. Formatting Notes: 8-character alpha-numeric code. - attr_accessor :purchase_order_number - - # The batch or lot number associates an item with information the manufacturer considers relevant for traceability of the trade item to which the Element String is applied. The data may refer to the trade item itself or to items contained. This field is mandatory for all perishable items. - attr_accessor :lot_number - - attr_accessor :expiry - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'lot_number' => :'lotNumber', - :'expiry' => :'expiry' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'lot_number' => :'Object', - :'expiry' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PackageItemDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PackageItemDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'lot_number') - self.lot_number = attributes[:'lot_number'] - end - - if attributes.key?(:'expiry') - self.expiry = attributes[:'expiry'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - lot_number == o.lot_number && - expiry == o.expiry - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, lot_number, expiry].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_items.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_items.rb deleted file mode 100644 index ef8ac25..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_items.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the item being shipped. - class PackedItems - # Item sequence number for the item. The first item will be 001, the second 002, and so on. This number is used as a reference to refer to this item from the carton or pallet level. - attr_accessor :item_sequence_number - - # Buyer Standard Identification Number (ASIN) of an item. - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :packed_quantity - - attr_accessor :item_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'packed_quantity' => :'packedQuantity', - :'item_details' => :'itemDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'packed_quantity' => :'Object', - :'item_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PackedItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PackedItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'packed_quantity') - self.packed_quantity = attributes[:'packed_quantity'] - end - - if attributes.key?(:'item_details') - self.item_details = attributes[:'item_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - packed_quantity == o.packed_quantity && - item_details == o.item_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, packed_quantity, item_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_quantity.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_quantity.rb deleted file mode 100644 index dc1b7e5..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/packed_quantity.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of item quantity. - class PackedQuantity - # Amount of units shipped for a specific item at a shipment level. If the item is present only in certain cartons or pallets within the shipment, please provide this at the appropriate carton or pallet level. - attr_accessor :amount - - # Unit of measure for the shipped quantity. - attr_accessor :unit_of_measure - - # The case size, in the event that we ordered using cases. Otherwise, 1. - attr_accessor :unit_size - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'unit_of_measure' => :'unitOfMeasure', - :'unit_size' => :'unitSize' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Object', - :'unit_of_measure' => :'Object', - :'unit_size' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PackedQuantity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PackedQuantity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'unit_size') - self.unit_size = attributes[:'unit_size'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['Cases', 'Eaches']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - unit_of_measure == o.unit_of_measure && - unit_size == o.unit_size - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, unit_of_measure, unit_size].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pagination.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pagination.rb deleted file mode 100644 index 2d6e874..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pagination.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The pagination elements required to retrieve the remaining data. - class Pagination - # A generated string used to pass information to your next request. If NextToken is returned, pass the value of NextToken to the next request. If NextToken is not returned, there are no more shipment items to return. - attr_accessor :next_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'next_token' => :'nextToken' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'next_token' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'next_token') - self.next_token = attributes[:'next_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - next_token == o.next_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [next_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pallet.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pallet.rb deleted file mode 100644 index 5526fee..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/pallet.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the Pallet/Tare being shipped. - class Pallet - # A list of pallet identifiers. - attr_accessor :pallet_identifiers - - # Number of layers per pallet. Only applicable to container type Pallet. - attr_accessor :tier - - # Number of cartons per layer on the pallet. Only applicable to container type Pallet. - attr_accessor :block - - attr_accessor :dimensions - - attr_accessor :weight - - attr_accessor :carton_reference_details - - # A list of container item details. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pallet_identifiers' => :'palletIdentifiers', - :'tier' => :'tier', - :'block' => :'block', - :'dimensions' => :'dimensions', - :'weight' => :'weight', - :'carton_reference_details' => :'cartonReferenceDetails', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pallet_identifiers' => :'Object', - :'tier' => :'Object', - :'block' => :'Object', - :'dimensions' => :'Object', - :'weight' => :'Object', - :'carton_reference_details' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Pallet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Pallet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pallet_identifiers') - if (value = attributes[:'pallet_identifiers']).is_a?(Array) - self.pallet_identifiers = value - end - end - - if attributes.key?(:'tier') - self.tier = attributes[:'tier'] - end - - if attributes.key?(:'block') - self.block = attributes[:'block'] - end - - if attributes.key?(:'dimensions') - self.dimensions = attributes[:'dimensions'] - end - - if attributes.key?(:'weight') - self.weight = attributes[:'weight'] - end - - if attributes.key?(:'carton_reference_details') - self.carton_reference_details = attributes[:'carton_reference_details'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @pallet_identifiers.nil? - invalid_properties.push('invalid value for "pallet_identifiers", pallet_identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @pallet_identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pallet_identifiers == o.pallet_identifiers && - tier == o.tier && - block == o.block && - dimensions == o.dimensions && - weight == o.weight && - carton_reference_details == o.carton_reference_details && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pallet_identifiers, tier, block, dimensions, weight, carton_reference_details, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/party_identification.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/party_identification.rb deleted file mode 100644 index 07fb95a..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/party_identification.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Name/Address and tax details of the party. - class PartyIdentification - attr_accessor :address - - # Assigned identification for the party. - attr_accessor :party_id - - # Tax registration details of the entity. - attr_accessor :tax_registration_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'party_id' => :'partyId', - :'tax_registration_details' => :'taxRegistrationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'Object', - :'party_id' => :'Object', - :'tax_registration_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PartyIdentification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PartyIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'party_id') - self.party_id = attributes[:'party_id'] - end - - if attributes.key?(:'tax_registration_details') - if (value = attributes[:'tax_registration_details']).is_a?(Array) - self.tax_registration_details = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_id.nil? - invalid_properties.push('invalid value for "party_id", party_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - party_id == o.party_id && - tax_registration_details == o.tax_registration_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, party_id, tax_registration_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_item_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_item_details.rb deleted file mode 100644 index 36cd8f1..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_item_details.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Item details for be provided for every item in shipment at either the item or carton or pallet level, whichever is appropriate. - class PurchaseOrderItemDetails - attr_accessor :maximum_retail_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'maximum_retail_price' => :'maximumRetailPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'maximum_retail_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PurchaseOrderItemDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PurchaseOrderItemDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'maximum_retail_price') - self.maximum_retail_price = attributes[:'maximum_retail_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - maximum_retail_price == o.maximum_retail_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [maximum_retail_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_items.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_items.rb deleted file mode 100644 index 8d70989..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_order_items.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Details of the item being shipped. - class PurchaseOrderItems - # Item sequence number for the item. The first item will be 001, the second 002, and so on. This number is used as a reference to refer to this item from the carton or pallet level. - attr_accessor :item_sequence_number - - # Amazon Standard Identification Number (ASIN) for a SKU - attr_accessor :buyer_product_identifier - - # The vendor selected product identification of the item. Should be the same as was sent in the purchase order. - attr_accessor :vendor_product_identifier - - attr_accessor :shipped_quantity - - attr_accessor :maximum_retail_price - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_sequence_number' => :'itemSequenceNumber', - :'buyer_product_identifier' => :'buyerProductIdentifier', - :'vendor_product_identifier' => :'vendorProductIdentifier', - :'shipped_quantity' => :'shippedQuantity', - :'maximum_retail_price' => :'maximumRetailPrice' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_sequence_number' => :'Object', - :'buyer_product_identifier' => :'Object', - :'vendor_product_identifier' => :'Object', - :'shipped_quantity' => :'Object', - :'maximum_retail_price' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PurchaseOrderItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PurchaseOrderItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_sequence_number') - self.item_sequence_number = attributes[:'item_sequence_number'] - end - - if attributes.key?(:'buyer_product_identifier') - self.buyer_product_identifier = attributes[:'buyer_product_identifier'] - end - - if attributes.key?(:'vendor_product_identifier') - self.vendor_product_identifier = attributes[:'vendor_product_identifier'] - end - - if attributes.key?(:'shipped_quantity') - self.shipped_quantity = attributes[:'shipped_quantity'] - end - - if attributes.key?(:'maximum_retail_price') - self.maximum_retail_price = attributes[:'maximum_retail_price'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_sequence_number.nil? - invalid_properties.push('invalid value for "item_sequence_number", item_sequence_number cannot be nil.') - end - - if @shipped_quantity.nil? - invalid_properties.push('invalid value for "shipped_quantity", shipped_quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_sequence_number.nil? - return false if @shipped_quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_sequence_number == o.item_sequence_number && - buyer_product_identifier == o.buyer_product_identifier && - vendor_product_identifier == o.vendor_product_identifier && - shipped_quantity == o.shipped_quantity && - maximum_retail_price == o.maximum_retail_price - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_sequence_number, buyer_product_identifier, vendor_product_identifier, shipped_quantity, maximum_retail_price].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_orders.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_orders.rb deleted file mode 100644 index bf1595d..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/purchase_orders.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Transport Request pickup date - class PurchaseOrders - # Purchase order numbers involved in this shipment, list all the PO that are involved as part of this shipment. - attr_accessor :purchase_order_number - - # Purchase order numbers involved in this shipment, list all the PO that are involved as part of this shipment. - attr_accessor :purchase_order_date - - # Date range in which shipment is expected for these purchase orders. - attr_accessor :ship_window - - # A list of the items that are associated to the PO in this transport and their associated details. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_order_number' => :'purchaseOrderNumber', - :'purchase_order_date' => :'purchaseOrderDate', - :'ship_window' => :'shipWindow', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_order_number' => :'Object', - :'purchase_order_date' => :'Object', - :'ship_window' => :'Object', - :'items' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::PurchaseOrders` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::PurchaseOrders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'purchase_order_date') - self.purchase_order_date = attributes[:'purchase_order_date'] - end - - if attributes.key?(:'ship_window') - self.ship_window = attributes[:'ship_window'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_order_number == o.purchase_order_number && - purchase_order_date == o.purchase_order_date && - ship_window == o.ship_window && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_order_number, purchase_order_date, ship_window, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/route.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/route.rb deleted file mode 100644 index 8dce2be..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/route.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # This is used only for direct import shipment confirmations. - class Route - # The port or location involved in transporting the cargo, as specified in transportation contracts or operational plans. - attr_accessor :stops - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'stops' => :'stops' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'stops' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Route` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Route`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'stops') - if (value = attributes[:'stops']).is_a?(Array) - self.stops = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @stops.nil? - invalid_properties.push('invalid value for "stops", stops cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @stops.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - stops == o.stops - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [stops].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment.rb deleted file mode 100644 index d395f4d..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment.rb +++ /dev/null @@ -1,489 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of one or more shipments with respective details. - class Shipment - # Unique Transportation ID created by Vendor (Should not be used over the last 365 days). - attr_accessor :vendor_shipment_identifier - - # Indicates the type of transportation request such as (New,Cancel,Confirm and PackageLabelRequest). Each transactiontype has a unique set of operation and there are corresponding details to be populated for each operation. - attr_accessor :transaction_type - - # The buyer Reference Number is a unique identifier generated by buyer for all Collect/WePay shipments when you submit a transportation request. This field is mandatory for Collect/WePay shipments. - attr_accessor :buyer_reference_number - - # Date on which the transportation request was submitted. - attr_accessor :transaction_date - - # Indicates the current shipment status. - attr_accessor :current_shipment_status - - # Date and time when the last status was updated. - attr_accessor :currentshipment_status_date - - # Indicates the list of current shipment status details and when the last update was received from carrier this is available on shipment Details response. - attr_accessor :shipment_status_details - - # The date and time of the shipment request created by vendor. - attr_accessor :shipment_create_date - - # The date and time of the departure of the shipment from the vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the Buyer destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future. - attr_accessor :shipment_confirm_date - - # The date and time of the package label created for the shipment by buyer. - attr_accessor :package_label_create_date - - # Indicates if this transportation request is WePay/Collect or TheyPay/Prepaid. This is a mandatory information. - attr_accessor :shipment_freight_term - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - attr_accessor :ship_to_party - - attr_accessor :shipment_measurements - - attr_accessor :collect_freight_pickup_details - - # Indicates the purchase orders involved for the transportation request. This group is an array create 1 for each PO and list their corresponding items. This information is used for deciding the route,truck allocation and storage efficiently. This is a mandatory information for Buyer performing transportation from vendor warehouse (WePay/Collect) - attr_accessor :purchase_orders - - attr_accessor :import_details - - # A list of the items in this transportation and their associated inner container details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level. - attr_accessor :containers - - attr_accessor :transportation_details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'vendor_shipment_identifier' => :'vendorShipmentIdentifier', - :'transaction_type' => :'transactionType', - :'buyer_reference_number' => :'buyerReferenceNumber', - :'transaction_date' => :'transactionDate', - :'current_shipment_status' => :'currentShipmentStatus', - :'currentshipment_status_date' => :'currentshipmentStatusDate', - :'shipment_status_details' => :'shipmentStatusDetails', - :'shipment_create_date' => :'shipmentCreateDate', - :'shipment_confirm_date' => :'shipmentConfirmDate', - :'package_label_create_date' => :'packageLabelCreateDate', - :'shipment_freight_term' => :'shipmentFreightTerm', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'ship_to_party' => :'shipToParty', - :'shipment_measurements' => :'shipmentMeasurements', - :'collect_freight_pickup_details' => :'collectFreightPickupDetails', - :'purchase_orders' => :'purchaseOrders', - :'import_details' => :'importDetails', - :'containers' => :'containers', - :'transportation_details' => :'transportationDetails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'vendor_shipment_identifier' => :'Object', - :'transaction_type' => :'Object', - :'buyer_reference_number' => :'Object', - :'transaction_date' => :'Object', - :'current_shipment_status' => :'Object', - :'currentshipment_status_date' => :'Object', - :'shipment_status_details' => :'Object', - :'shipment_create_date' => :'Object', - :'shipment_confirm_date' => :'Object', - :'package_label_create_date' => :'Object', - :'shipment_freight_term' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'ship_to_party' => :'Object', - :'shipment_measurements' => :'Object', - :'collect_freight_pickup_details' => :'Object', - :'purchase_orders' => :'Object', - :'import_details' => :'Object', - :'containers' => :'Object', - :'transportation_details' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Shipment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Shipment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'vendor_shipment_identifier') - self.vendor_shipment_identifier = attributes[:'vendor_shipment_identifier'] - end - - if attributes.key?(:'transaction_type') - self.transaction_type = attributes[:'transaction_type'] - end - - if attributes.key?(:'buyer_reference_number') - self.buyer_reference_number = attributes[:'buyer_reference_number'] - end - - if attributes.key?(:'transaction_date') - self.transaction_date = attributes[:'transaction_date'] - end - - if attributes.key?(:'current_shipment_status') - self.current_shipment_status = attributes[:'current_shipment_status'] - end - - if attributes.key?(:'currentshipment_status_date') - self.currentshipment_status_date = attributes[:'currentshipment_status_date'] - end - - if attributes.key?(:'shipment_status_details') - if (value = attributes[:'shipment_status_details']).is_a?(Array) - self.shipment_status_details = value - end - end - - if attributes.key?(:'shipment_create_date') - self.shipment_create_date = attributes[:'shipment_create_date'] - end - - if attributes.key?(:'shipment_confirm_date') - self.shipment_confirm_date = attributes[:'shipment_confirm_date'] - end - - if attributes.key?(:'package_label_create_date') - self.package_label_create_date = attributes[:'package_label_create_date'] - end - - if attributes.key?(:'shipment_freight_term') - self.shipment_freight_term = attributes[:'shipment_freight_term'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'shipment_measurements') - self.shipment_measurements = attributes[:'shipment_measurements'] - end - - if attributes.key?(:'collect_freight_pickup_details') - self.collect_freight_pickup_details = attributes[:'collect_freight_pickup_details'] - end - - if attributes.key?(:'purchase_orders') - if (value = attributes[:'purchase_orders']).is_a?(Array) - self.purchase_orders = value - end - end - - if attributes.key?(:'import_details') - self.import_details = attributes[:'import_details'] - end - - if attributes.key?(:'containers') - if (value = attributes[:'containers']).is_a?(Array) - self.containers = value - end - end - - if attributes.key?(:'transportation_details') - self.transportation_details = attributes[:'transportation_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @vendor_shipment_identifier.nil? - invalid_properties.push('invalid value for "vendor_shipment_identifier", vendor_shipment_identifier cannot be nil.') - end - - if @transaction_type.nil? - invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.') - end - - if @transaction_date.nil? - invalid_properties.push('invalid value for "transaction_date", transaction_date cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @ship_to_party.nil? - invalid_properties.push('invalid value for "ship_to_party", ship_to_party cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @vendor_shipment_identifier.nil? - return false if @transaction_type.nil? - transaction_type_validator = EnumAttributeValidator.new('Object', ['New', 'Cancel']) - return false unless transaction_type_validator.valid?(@transaction_type) - return false if @transaction_date.nil? - current_shipment_status_validator = EnumAttributeValidator.new('Object', ['Created', 'TransportationRequested', 'CarrierAssigned', 'Shipped']) - return false unless current_shipment_status_validator.valid?(@current_shipment_status) - shipment_freight_term_validator = EnumAttributeValidator.new('Object', ['Collect', 'Prepaid']) - return false unless shipment_freight_term_validator.valid?(@shipment_freight_term) - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @ship_to_party.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] transaction_type Object to be assigned - def transaction_type=(transaction_type) - validator = EnumAttributeValidator.new('Object', ['New', 'Cancel']) - unless validator.valid?(transaction_type) - fail ArgumentError, "invalid value for \"transaction_type\", must be one of #{validator.allowable_values}." - end - @transaction_type = transaction_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] current_shipment_status Object to be assigned - def current_shipment_status=(current_shipment_status) - validator = EnumAttributeValidator.new('Object', ['Created', 'TransportationRequested', 'CarrierAssigned', 'Shipped']) - unless validator.valid?(current_shipment_status) - fail ArgumentError, "invalid value for \"current_shipment_status\", must be one of #{validator.allowable_values}." - end - @current_shipment_status = current_shipment_status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_freight_term Object to be assigned - def shipment_freight_term=(shipment_freight_term) - validator = EnumAttributeValidator.new('Object', ['Collect', 'Prepaid']) - unless validator.valid?(shipment_freight_term) - fail ArgumentError, "invalid value for \"shipment_freight_term\", must be one of #{validator.allowable_values}." - end - @shipment_freight_term = shipment_freight_term - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - vendor_shipment_identifier == o.vendor_shipment_identifier && - transaction_type == o.transaction_type && - buyer_reference_number == o.buyer_reference_number && - transaction_date == o.transaction_date && - current_shipment_status == o.current_shipment_status && - currentshipment_status_date == o.currentshipment_status_date && - shipment_status_details == o.shipment_status_details && - shipment_create_date == o.shipment_create_date && - shipment_confirm_date == o.shipment_confirm_date && - package_label_create_date == o.package_label_create_date && - shipment_freight_term == o.shipment_freight_term && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - ship_to_party == o.ship_to_party && - shipment_measurements == o.shipment_measurements && - collect_freight_pickup_details == o.collect_freight_pickup_details && - purchase_orders == o.purchase_orders && - import_details == o.import_details && - containers == o.containers && - transportation_details == o.transportation_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [vendor_shipment_identifier, transaction_type, buyer_reference_number, transaction_date, current_shipment_status, currentshipment_status_date, shipment_status_details, shipment_create_date, shipment_confirm_date, package_label_create_date, shipment_freight_term, selling_party, ship_from_party, ship_to_party, shipment_measurements, collect_freight_pickup_details, purchase_orders, import_details, containers, transportation_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_confirmation.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_confirmation.rb deleted file mode 100644 index 55f3a49..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_confirmation.rb +++ /dev/null @@ -1,465 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of one or more shipment confirmations. - class ShipmentConfirmation - # Unique shipment ID (not used over the last 365 days). - attr_accessor :shipment_identifier - - # Indicates if this shipment confirmation is the initial confirmation, or intended to replace an already posted shipment confirmation. If replacing an existing shipment confirmation, be sure to provide the identical shipmentIdentifier and sellingParty information as in the previous confirmation. - attr_accessor :shipment_confirmation_type - - # The type of shipment. - attr_accessor :shipment_type - - # Shipment hierarchical structure. - attr_accessor :shipment_structure - - attr_accessor :transportation_details - - # The Amazon Reference Number is a unique identifier generated by Amazon for all Collect/WePay shipments when you submit a routing request. This field is mandatory for Collect/WePay shipments. - attr_accessor :amazon_reference_number - - # Date on which the shipment confirmation was submitted. - attr_accessor :shipment_confirmation_date - - # The date and time of the departure of the shipment from the vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the buyer destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future. - attr_accessor :shipped_date - - # The date and time on which the shipment is estimated to reach buyer's warehouse. It needs to be an estimate based on the average transit time between ship from location and the destination. The exact appointment time will be provided by the buyer and is potentially not known when creating the shipment confirmation. - attr_accessor :estimated_delivery_date - - attr_accessor :selling_party - - attr_accessor :ship_from_party - - attr_accessor :ship_to_party - - attr_accessor :shipment_measurements - - attr_accessor :import_details - - # A list of the items in this shipment and their associated details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level. - attr_accessor :shipped_items - - # A list of the cartons in this shipment. - attr_accessor :cartons - - # A list of the pallets in this shipment. - attr_accessor :pallets - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_identifier' => :'shipmentIdentifier', - :'shipment_confirmation_type' => :'shipmentConfirmationType', - :'shipment_type' => :'shipmentType', - :'shipment_structure' => :'shipmentStructure', - :'transportation_details' => :'transportationDetails', - :'amazon_reference_number' => :'amazonReferenceNumber', - :'shipment_confirmation_date' => :'shipmentConfirmationDate', - :'shipped_date' => :'shippedDate', - :'estimated_delivery_date' => :'estimatedDeliveryDate', - :'selling_party' => :'sellingParty', - :'ship_from_party' => :'shipFromParty', - :'ship_to_party' => :'shipToParty', - :'shipment_measurements' => :'shipmentMeasurements', - :'import_details' => :'importDetails', - :'shipped_items' => :'shippedItems', - :'cartons' => :'cartons', - :'pallets' => :'pallets' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_identifier' => :'Object', - :'shipment_confirmation_type' => :'Object', - :'shipment_type' => :'Object', - :'shipment_structure' => :'Object', - :'transportation_details' => :'Object', - :'amazon_reference_number' => :'Object', - :'shipment_confirmation_date' => :'Object', - :'shipped_date' => :'Object', - :'estimated_delivery_date' => :'Object', - :'selling_party' => :'Object', - :'ship_from_party' => :'Object', - :'ship_to_party' => :'Object', - :'shipment_measurements' => :'Object', - :'import_details' => :'Object', - :'shipped_items' => :'Object', - :'cartons' => :'Object', - :'pallets' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ShipmentConfirmation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ShipmentConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_identifier') - self.shipment_identifier = attributes[:'shipment_identifier'] - end - - if attributes.key?(:'shipment_confirmation_type') - self.shipment_confirmation_type = attributes[:'shipment_confirmation_type'] - end - - if attributes.key?(:'shipment_type') - self.shipment_type = attributes[:'shipment_type'] - end - - if attributes.key?(:'shipment_structure') - self.shipment_structure = attributes[:'shipment_structure'] - end - - if attributes.key?(:'transportation_details') - self.transportation_details = attributes[:'transportation_details'] - end - - if attributes.key?(:'amazon_reference_number') - self.amazon_reference_number = attributes[:'amazon_reference_number'] - end - - if attributes.key?(:'shipment_confirmation_date') - self.shipment_confirmation_date = attributes[:'shipment_confirmation_date'] - end - - if attributes.key?(:'shipped_date') - self.shipped_date = attributes[:'shipped_date'] - end - - if attributes.key?(:'estimated_delivery_date') - self.estimated_delivery_date = attributes[:'estimated_delivery_date'] - end - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'shipment_measurements') - self.shipment_measurements = attributes[:'shipment_measurements'] - end - - if attributes.key?(:'import_details') - self.import_details = attributes[:'import_details'] - end - - if attributes.key?(:'shipped_items') - if (value = attributes[:'shipped_items']).is_a?(Array) - self.shipped_items = value - end - end - - if attributes.key?(:'cartons') - if (value = attributes[:'cartons']).is_a?(Array) - self.cartons = value - end - end - - if attributes.key?(:'pallets') - if (value = attributes[:'pallets']).is_a?(Array) - self.pallets = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @shipment_identifier.nil? - invalid_properties.push('invalid value for "shipment_identifier", shipment_identifier cannot be nil.') - end - - if @shipment_confirmation_type.nil? - invalid_properties.push('invalid value for "shipment_confirmation_type", shipment_confirmation_type cannot be nil.') - end - - if @shipment_confirmation_date.nil? - invalid_properties.push('invalid value for "shipment_confirmation_date", shipment_confirmation_date cannot be nil.') - end - - if @selling_party.nil? - invalid_properties.push('invalid value for "selling_party", selling_party cannot be nil.') - end - - if @ship_from_party.nil? - invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') - end - - if @ship_to_party.nil? - invalid_properties.push('invalid value for "ship_to_party", ship_to_party cannot be nil.') - end - - if @shipped_items.nil? - invalid_properties.push('invalid value for "shipped_items", shipped_items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @shipment_identifier.nil? - return false if @shipment_confirmation_type.nil? - shipment_confirmation_type_validator = EnumAttributeValidator.new('Object', ['Original', 'Replace']) - return false unless shipment_confirmation_type_validator.valid?(@shipment_confirmation_type) - shipment_type_validator = EnumAttributeValidator.new('Object', ['TruckLoad', 'LessThanTruckLoad', 'SmallParcel']) - return false unless shipment_type_validator.valid?(@shipment_type) - shipment_structure_validator = EnumAttributeValidator.new('Object', ['PalletizedAssortmentCase', 'LooseAssortmentCase', 'PalletOfItems', 'PalletizedStandardCase', 'LooseStandardCase', 'MasterPallet', 'MasterCase']) - return false unless shipment_structure_validator.valid?(@shipment_structure) - return false if @shipment_confirmation_date.nil? - return false if @selling_party.nil? - return false if @ship_from_party.nil? - return false if @ship_to_party.nil? - return false if @shipped_items.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_confirmation_type Object to be assigned - def shipment_confirmation_type=(shipment_confirmation_type) - validator = EnumAttributeValidator.new('Object', ['Original', 'Replace']) - unless validator.valid?(shipment_confirmation_type) - fail ArgumentError, "invalid value for \"shipment_confirmation_type\", must be one of #{validator.allowable_values}." - end - @shipment_confirmation_type = shipment_confirmation_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_type Object to be assigned - def shipment_type=(shipment_type) - validator = EnumAttributeValidator.new('Object', ['TruckLoad', 'LessThanTruckLoad', 'SmallParcel']) - unless validator.valid?(shipment_type) - fail ArgumentError, "invalid value for \"shipment_type\", must be one of #{validator.allowable_values}." - end - @shipment_type = shipment_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_structure Object to be assigned - def shipment_structure=(shipment_structure) - validator = EnumAttributeValidator.new('Object', ['PalletizedAssortmentCase', 'LooseAssortmentCase', 'PalletOfItems', 'PalletizedStandardCase', 'LooseStandardCase', 'MasterPallet', 'MasterCase']) - unless validator.valid?(shipment_structure) - fail ArgumentError, "invalid value for \"shipment_structure\", must be one of #{validator.allowable_values}." - end - @shipment_structure = shipment_structure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_identifier == o.shipment_identifier && - shipment_confirmation_type == o.shipment_confirmation_type && - shipment_type == o.shipment_type && - shipment_structure == o.shipment_structure && - transportation_details == o.transportation_details && - amazon_reference_number == o.amazon_reference_number && - shipment_confirmation_date == o.shipment_confirmation_date && - shipped_date == o.shipped_date && - estimated_delivery_date == o.estimated_delivery_date && - selling_party == o.selling_party && - ship_from_party == o.ship_from_party && - ship_to_party == o.ship_to_party && - shipment_measurements == o.shipment_measurements && - import_details == o.import_details && - shipped_items == o.shipped_items && - cartons == o.cartons && - pallets == o.pallets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_identifier, shipment_confirmation_type, shipment_type, shipment_structure, transportation_details, amazon_reference_number, shipment_confirmation_date, shipped_date, estimated_delivery_date, selling_party, ship_from_party, ship_to_party, shipment_measurements, import_details, shipped_items, cartons, pallets].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_details.rb deleted file mode 100644 index d19dd09..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_details.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The request schema for the GetShipmentDetails operation. - class ShipmentDetails - attr_accessor :pagination - - # A list of one or more shipments with underlying details. - attr_accessor :shipments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'shipments' => :'shipments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'shipments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ShipmentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ShipmentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'shipments') - if (value = attributes[:'shipments']).is_a?(Array) - self.shipments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - shipments == o.shipments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, shipments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_information.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_information.rb deleted file mode 100644 index 0533fa5..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_information.rb +++ /dev/null @@ -1,313 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Shipment Information details for Label request. - class ShipmentInformation - attr_accessor :vendor_details - - # The buyer reference number is a unique identifier generated by the buyer for all Collect and WePay shipments. - attr_accessor :buyer_reference_number - - attr_accessor :ship_to_party - - attr_accessor :ship_from_party - - # Vendor Warehouse ID from where the shipment is scheduled to be picked up by buyer / Carrier. - attr_accessor :warehouse_id - - # Unique Id with which the shipment can be tracked for Small Parcels. - attr_accessor :master_tracking_id - - # Number of Labels that are created as part of this shipment. - attr_accessor :total_label_count - - # Type of shipment whether it is Small Parcel - attr_accessor :ship_mode - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'vendor_details' => :'vendorDetails', - :'buyer_reference_number' => :'buyerReferenceNumber', - :'ship_to_party' => :'shipToParty', - :'ship_from_party' => :'shipFromParty', - :'warehouse_id' => :'warehouseId', - :'master_tracking_id' => :'masterTrackingId', - :'total_label_count' => :'totalLabelCount', - :'ship_mode' => :'shipMode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'vendor_details' => :'Object', - :'buyer_reference_number' => :'Object', - :'ship_to_party' => :'Object', - :'ship_from_party' => :'Object', - :'warehouse_id' => :'Object', - :'master_tracking_id' => :'Object', - :'total_label_count' => :'Object', - :'ship_mode' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ShipmentInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ShipmentInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'vendor_details') - self.vendor_details = attributes[:'vendor_details'] - end - - if attributes.key?(:'buyer_reference_number') - self.buyer_reference_number = attributes[:'buyer_reference_number'] - end - - if attributes.key?(:'ship_to_party') - self.ship_to_party = attributes[:'ship_to_party'] - end - - if attributes.key?(:'ship_from_party') - self.ship_from_party = attributes[:'ship_from_party'] - end - - if attributes.key?(:'warehouse_id') - self.warehouse_id = attributes[:'warehouse_id'] - end - - if attributes.key?(:'master_tracking_id') - self.master_tracking_id = attributes[:'master_tracking_id'] - end - - if attributes.key?(:'total_label_count') - self.total_label_count = attributes[:'total_label_count'] - end - - if attributes.key?(:'ship_mode') - self.ship_mode = attributes[:'ship_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - ship_mode_validator = EnumAttributeValidator.new('Object', ['SmallParcel', 'LTL']) - return false unless ship_mode_validator.valid?(@ship_mode) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] ship_mode Object to be assigned - def ship_mode=(ship_mode) - validator = EnumAttributeValidator.new('Object', ['SmallParcel', 'LTL']) - unless validator.valid?(ship_mode) - fail ArgumentError, "invalid value for \"ship_mode\", must be one of #{validator.allowable_values}." - end - @ship_mode = ship_mode - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - vendor_details == o.vendor_details && - buyer_reference_number == o.buyer_reference_number && - ship_to_party == o.ship_to_party && - ship_from_party == o.ship_from_party && - warehouse_id == o.warehouse_id && - master_tracking_id == o.master_tracking_id && - total_label_count == o.total_label_count && - ship_mode == o.ship_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [vendor_details, buyer_reference_number, ship_to_party, ship_from_party, warehouse_id, master_tracking_id, total_label_count, ship_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_measurements.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_measurements.rb deleted file mode 100644 index 7803afd..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_measurements.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Shipment measurement details. - class ShipmentMeasurements - attr_accessor :gross_shipment_weight - - attr_accessor :shipment_volume - - # Number of cartons present in the shipment. Provide the cartonCount only for non-palletized shipments. - attr_accessor :carton_count - - # Number of pallets present in the shipment. Provide the palletCount only for palletized shipments. - attr_accessor :pallet_count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'gross_shipment_weight' => :'grossShipmentWeight', - :'shipment_volume' => :'shipmentVolume', - :'carton_count' => :'cartonCount', - :'pallet_count' => :'palletCount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'gross_shipment_weight' => :'Object', - :'shipment_volume' => :'Object', - :'carton_count' => :'Object', - :'pallet_count' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ShipmentMeasurements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ShipmentMeasurements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'gross_shipment_weight') - self.gross_shipment_weight = attributes[:'gross_shipment_weight'] - end - - if attributes.key?(:'shipment_volume') - self.shipment_volume = attributes[:'shipment_volume'] - end - - if attributes.key?(:'carton_count') - self.carton_count = attributes[:'carton_count'] - end - - if attributes.key?(:'pallet_count') - self.pallet_count = attributes[:'pallet_count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - gross_shipment_weight == o.gross_shipment_weight && - shipment_volume == o.shipment_volume && - carton_count == o.carton_count && - pallet_count == o.pallet_count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [gross_shipment_weight, shipment_volume, carton_count, pallet_count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_status_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_status_details.rb deleted file mode 100644 index cc7ec4c..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/shipment_status_details.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Shipment Status details. - class ShipmentStatusDetails - # Current status of the shipment on whether it is picked up or scheduled. - attr_accessor :shipment_status - - # Date and time on last status update received for the shipment - attr_accessor :shipment_status_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_status' => :'shipmentStatus', - :'shipment_status_date' => :'shipmentStatusDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_status' => :'Object', - :'shipment_status_date' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::ShipmentStatusDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::ShipmentStatusDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_status') - self.shipment_status = attributes[:'shipment_status'] - end - - if attributes.key?(:'shipment_status_date') - self.shipment_status_date = attributes[:'shipment_status_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - shipment_status_validator = EnumAttributeValidator.new('Object', ['Created', 'TransportationRequested', 'CarrierAssigned', 'Shipped']) - return false unless shipment_status_validator.valid?(@shipment_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] shipment_status Object to be assigned - def shipment_status=(shipment_status) - validator = EnumAttributeValidator.new('Object', ['Created', 'TransportationRequested', 'CarrierAssigned', 'Shipped']) - unless validator.valid?(shipment_status) - fail ArgumentError, "invalid value for \"shipment_status\", must be one of #{validator.allowable_values}." - end - @shipment_status = shipment_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_status == o.shipment_status && - shipment_status_date == o.shipment_status_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_status, shipment_status_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/stop.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/stop.rb deleted file mode 100644 index 45c6259..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/stop.rb +++ /dev/null @@ -1,280 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Contractual or operational port or point relevant to the movement of the cargo. - class Stop - # Provide the function code. - attr_accessor :function_code - - attr_accessor :location_identification - - # Date and time of the arrival of the cargo. - attr_accessor :arrival_time - - # Date and time of the departure of the cargo. - attr_accessor :departure_time - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'function_code' => :'functionCode', - :'location_identification' => :'locationIdentification', - :'arrival_time' => :'arrivalTime', - :'departure_time' => :'departureTime' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'function_code' => :'Object', - :'location_identification' => :'Object', - :'arrival_time' => :'Object', - :'departure_time' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Stop` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Stop`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'function_code') - self.function_code = attributes[:'function_code'] - end - - if attributes.key?(:'location_identification') - self.location_identification = attributes[:'location_identification'] - end - - if attributes.key?(:'arrival_time') - self.arrival_time = attributes[:'arrival_time'] - end - - if attributes.key?(:'departure_time') - self.departure_time = attributes[:'departure_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @function_code.nil? - invalid_properties.push('invalid value for "function_code", function_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @function_code.nil? - function_code_validator = EnumAttributeValidator.new('Object', ['PortOfDischarge', 'FreightPayableAt', 'PortOfLoading']) - return false unless function_code_validator.valid?(@function_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] function_code Object to be assigned - def function_code=(function_code) - validator = EnumAttributeValidator.new('Object', ['PortOfDischarge', 'FreightPayableAt', 'PortOfLoading']) - unless validator.valid?(function_code) - fail ArgumentError, "invalid value for \"function_code\", must be one of #{validator.allowable_values}." - end - @function_code = function_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - function_code == o.function_code && - location_identification == o.location_identification && - arrival_time == o.arrival_time && - departure_time == o.departure_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [function_code, location_identification, arrival_time, departure_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_request.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_request.rb deleted file mode 100644 index 274c770..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_request.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The request schema for the SubmitShipmentConfirmations operation. - class SubmitShipmentConfirmationsRequest - # A list of one or more shipment confirmations. - attr_accessor :shipment_confirmations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipment_confirmations' => :'shipmentConfirmations' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipment_confirmations' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::SubmitShipmentConfirmationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::SubmitShipmentConfirmationsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipment_confirmations') - if (value = attributes[:'shipment_confirmations']).is_a?(Array) - self.shipment_confirmations = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipment_confirmations == o.shipment_confirmations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipment_confirmations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_response.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_response.rb deleted file mode 100644 index 4a5997c..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipment_confirmations_response.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The response schema for the SubmitShipmentConfirmations operation. - class SubmitShipmentConfirmationsResponse - attr_accessor :payload - - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payload' => :'payload', - :'errors' => :'errors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payload' => :'Object', - :'errors' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::SubmitShipmentConfirmationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::SubmitShipmentConfirmationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payload') - self.payload = attributes[:'payload'] - end - - if attributes.key?(:'errors') - self.errors = attributes[:'errors'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payload == o.payload && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payload, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipments.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipments.rb deleted file mode 100644 index c8e108d..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/submit_shipments.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The request schema for the SubmitShipments operation. - class SubmitShipments - # A list of one or more shipments with underlying details. - attr_accessor :shipments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'shipments' => :'shipments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'shipments' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::SubmitShipments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::SubmitShipments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'shipments') - if (value = attributes[:'shipments']).is_a?(Array) - self.shipments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - shipments == o.shipments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [shipments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/tax_registration_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/tax_registration_details.rb deleted file mode 100644 index be8bd9f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/tax_registration_details.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Tax registration details of the entity. - class TaxRegistrationDetails - # Tax registration type for the entity. - attr_accessor :tax_registration_type - - # Tax registration number for the entity. For example, VAT ID. - attr_accessor :tax_registration_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_registration_type' => :'taxRegistrationType', - :'tax_registration_number' => :'taxRegistrationNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_registration_type' => :'Object', - :'tax_registration_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TaxRegistrationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TaxRegistrationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_registration_type') - self.tax_registration_type = attributes[:'tax_registration_type'] - end - - if attributes.key?(:'tax_registration_number') - self.tax_registration_number = attributes[:'tax_registration_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @tax_registration_type.nil? - invalid_properties.push('invalid value for "tax_registration_type", tax_registration_type cannot be nil.') - end - - if @tax_registration_number.nil? - invalid_properties.push('invalid value for "tax_registration_number", tax_registration_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @tax_registration_type.nil? - tax_registration_type_validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - return false unless tax_registration_type_validator.valid?(@tax_registration_type) - return false if @tax_registration_number.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] tax_registration_type Object to be assigned - def tax_registration_type=(tax_registration_type) - validator = EnumAttributeValidator.new('Object', ['VAT', 'GST']) - unless validator.valid?(tax_registration_type) - fail ArgumentError, "invalid value for \"tax_registration_type\", must be one of #{validator.allowable_values}." - end - @tax_registration_type = tax_registration_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_registration_type == o.tax_registration_type && - tax_registration_number == o.tax_registration_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_registration_type, tax_registration_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/total_weight.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/total_weight.rb deleted file mode 100644 index 31b92a5..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/total_weight.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The total weight of units that are sold by weight in a shipment. - class TotalWeight - # The unit of measure for the weight of items that are ordered by cases and support pricing by weight. - attr_accessor :unit_of_measure - - attr_accessor :amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'amount' => :'amount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'amount' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TotalWeight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TotalWeight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @amount.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['POUNDS', 'OUNCES', 'GRAMS', 'KILOGRAMS']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transaction_reference.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transaction_reference.rb deleted file mode 100644 index a46a091..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transaction_reference.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The response payload for the SubmitShipmentConfirmations operation. - class TransactionReference - # GUID assigned by Buyer to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transactionId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransactionReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransactionReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_label.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_label.rb deleted file mode 100644 index 4f32eb6..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_label.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # A list of one or more ShipmentLabels. - class TransportLabel - # Date on which label is created. - attr_accessor :label_create_date_time - - attr_accessor :shipment_information - - # Indicates the label data,format and type associated . - attr_accessor :label_data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'label_create_date_time' => :'labelCreateDateTime', - :'shipment_information' => :'shipmentInformation', - :'label_data' => :'labelData' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'label_create_date_time' => :'Object', - :'shipment_information' => :'Object', - :'label_data' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransportLabel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransportLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'label_create_date_time') - self.label_create_date_time = attributes[:'label_create_date_time'] - end - - if attributes.key?(:'shipment_information') - self.shipment_information = attributes[:'shipment_information'] - end - - if attributes.key?(:'label_data') - if (value = attributes[:'label_data']).is_a?(Array) - self.label_data = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - label_create_date_time == o.label_create_date_time && - shipment_information == o.shipment_information && - label_data == o.label_data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [label_create_date_time, shipment_information, label_data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_shipment_measurements.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_shipment_measurements.rb deleted file mode 100644 index c9b7bb0..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transport_shipment_measurements.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Shipment measurement details. - class TransportShipmentMeasurements - # Total number of cartons present in the shipment. Provide the cartonCount only for non-palletized shipments. - attr_accessor :total_carton_count - - # Total number of Stackable Pallets present in the shipment. - attr_accessor :total_pallet_stackable - - # Total number of Non Stackable Pallets present in the shipment. - attr_accessor :total_pallet_non_stackable - - attr_accessor :shipment_weight - - attr_accessor :shipment_volume - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_carton_count' => :'totalCartonCount', - :'total_pallet_stackable' => :'totalPalletStackable', - :'total_pallet_non_stackable' => :'totalPalletNonStackable', - :'shipment_weight' => :'shipmentWeight', - :'shipment_volume' => :'shipmentVolume' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_carton_count' => :'Object', - :'total_pallet_stackable' => :'Object', - :'total_pallet_non_stackable' => :'Object', - :'shipment_weight' => :'Object', - :'shipment_volume' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransportShipmentMeasurements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransportShipmentMeasurements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_carton_count') - self.total_carton_count = attributes[:'total_carton_count'] - end - - if attributes.key?(:'total_pallet_stackable') - self.total_pallet_stackable = attributes[:'total_pallet_stackable'] - end - - if attributes.key?(:'total_pallet_non_stackable') - self.total_pallet_non_stackable = attributes[:'total_pallet_non_stackable'] - end - - if attributes.key?(:'shipment_weight') - self.shipment_weight = attributes[:'shipment_weight'] - end - - if attributes.key?(:'shipment_volume') - self.shipment_volume = attributes[:'shipment_volume'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_carton_count == o.total_carton_count && - total_pallet_stackable == o.total_pallet_stackable && - total_pallet_non_stackable == o.total_pallet_non_stackable && - shipment_weight == o.shipment_weight && - shipment_volume == o.shipment_volume - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_carton_count, total_pallet_stackable, total_pallet_non_stackable, shipment_weight, shipment_volume].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details.rb deleted file mode 100644 index fe85397..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Transportation details for this shipment. - class TransportationDetails - # The type of shipment. - attr_accessor :ship_mode - - # The mode of transportation for this shipment. - attr_accessor :transportation_mode - - # Date when shipment is performed by the Vendor to Buyer - attr_accessor :shipped_date - - # Estimated Date on which shipment will be delivered from Vendor to Buyer - attr_accessor :estimated_delivery_date - - # Date on which shipment will be delivered from Vendor to Buyer - attr_accessor :shipment_delivery_date - - attr_accessor :carrier_details - - # The Bill of Lading (BOL) number is a unique number assigned to each shipment of goods by the vendor or shipper during the creation of the Bill of Lading. This number must be unique for every shipment and cannot be a date/time or single character. The BOL numer is mandatory in Shipment Confirmation message for FTL and LTL shipments, and must match the paper BOL provided with the shipment. Instead of BOL, an alternative reference number (like Delivery Note Number) for the shipment can also be sent in this field. - attr_accessor :bill_of_lading_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ship_mode' => :'shipMode', - :'transportation_mode' => :'transportationMode', - :'shipped_date' => :'shippedDate', - :'estimated_delivery_date' => :'estimatedDeliveryDate', - :'shipment_delivery_date' => :'shipmentDeliveryDate', - :'carrier_details' => :'carrierDetails', - :'bill_of_lading_number' => :'billOfLadingNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'ship_mode' => :'Object', - :'transportation_mode' => :'Object', - :'shipped_date' => :'Object', - :'estimated_delivery_date' => :'Object', - :'shipment_delivery_date' => :'Object', - :'carrier_details' => :'Object', - :'bill_of_lading_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransportationDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransportationDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ship_mode') - self.ship_mode = attributes[:'ship_mode'] - end - - if attributes.key?(:'transportation_mode') - self.transportation_mode = attributes[:'transportation_mode'] - end - - if attributes.key?(:'shipped_date') - self.shipped_date = attributes[:'shipped_date'] - end - - if attributes.key?(:'estimated_delivery_date') - self.estimated_delivery_date = attributes[:'estimated_delivery_date'] - end - - if attributes.key?(:'shipment_delivery_date') - self.shipment_delivery_date = attributes[:'shipment_delivery_date'] - end - - if attributes.key?(:'carrier_details') - self.carrier_details = attributes[:'carrier_details'] - end - - if attributes.key?(:'bill_of_lading_number') - self.bill_of_lading_number = attributes[:'bill_of_lading_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - ship_mode_validator = EnumAttributeValidator.new('Object', ['TruckLoad', 'LessThanTruckLoad', 'SmallParcel']) - return false unless ship_mode_validator.valid?(@ship_mode) - transportation_mode_validator = EnumAttributeValidator.new('Object', ['Road', 'Air', 'Ocean']) - return false unless transportation_mode_validator.valid?(@transportation_mode) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] ship_mode Object to be assigned - def ship_mode=(ship_mode) - validator = EnumAttributeValidator.new('Object', ['TruckLoad', 'LessThanTruckLoad', 'SmallParcel']) - unless validator.valid?(ship_mode) - fail ArgumentError, "invalid value for \"ship_mode\", must be one of #{validator.allowable_values}." - end - @ship_mode = ship_mode - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] transportation_mode Object to be assigned - def transportation_mode=(transportation_mode) - validator = EnumAttributeValidator.new('Object', ['Road', 'Air', 'Ocean']) - unless validator.valid?(transportation_mode) - fail ArgumentError, "invalid value for \"transportation_mode\", must be one of #{validator.allowable_values}." - end - @transportation_mode = transportation_mode - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ship_mode == o.ship_mode && - transportation_mode == o.transportation_mode && - shipped_date == o.shipped_date && - estimated_delivery_date == o.estimated_delivery_date && - shipment_delivery_date == o.shipment_delivery_date && - carrier_details == o.carrier_details && - bill_of_lading_number == o.bill_of_lading_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ship_mode, transportation_mode, shipped_date, estimated_delivery_date, shipment_delivery_date, carrier_details, bill_of_lading_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details_for_shipment_confirmation.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details_for_shipment_confirmation.rb deleted file mode 100644 index e29067b..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_details_for_shipment_confirmation.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Transportation details for this shipment. - class TransportationDetailsForShipmentConfirmation - # Code that identifies the carrier for the shipment. The Standard Carrier Alpha Code (SCAC) is a unique two to four letter code used to identify a carrier. Carrier SCAC codes are assigned and maintained by the NMFTA (National Motor Freight Association). This field is mandatory for US, CA, MX shipment confirmations. - attr_accessor :carrier_scac - - # The field also known as PRO number is a unique number assigned by the carrier. It is used to identify and track the shipment that goes out for delivery. This field is mandatory for UA, CA, MX shipment confirmations. - attr_accessor :carrier_shipment_reference_number - - # The mode of transportation for this shipment. - attr_accessor :transportation_mode - - # The Bill of Lading (BOL) number is a unique number assigned to each shipment of goods by the vendor or shipper during the creation of the Bill of Lading. This number must be unique for every shipment and cannot be a date/time or single character. The BOL numer is mandatory in Shipment Confirmation message for FTL and LTL shipments, and must match the paper BOL provided with the shipment. Instead of BOL, an alternative reference number (like Delivery Note Number) for the shipment can also be sent in this field. - attr_accessor :bill_of_lading_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'carrier_scac' => :'carrierScac', - :'carrier_shipment_reference_number' => :'carrierShipmentReferenceNumber', - :'transportation_mode' => :'transportationMode', - :'bill_of_lading_number' => :'billOfLadingNumber' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'carrier_scac' => :'Object', - :'carrier_shipment_reference_number' => :'Object', - :'transportation_mode' => :'Object', - :'bill_of_lading_number' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransportationDetailsForShipmentConfirmation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransportationDetailsForShipmentConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'carrier_scac') - self.carrier_scac = attributes[:'carrier_scac'] - end - - if attributes.key?(:'carrier_shipment_reference_number') - self.carrier_shipment_reference_number = attributes[:'carrier_shipment_reference_number'] - end - - if attributes.key?(:'transportation_mode') - self.transportation_mode = attributes[:'transportation_mode'] - end - - if attributes.key?(:'bill_of_lading_number') - self.bill_of_lading_number = attributes[:'bill_of_lading_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - transportation_mode_validator = EnumAttributeValidator.new('Object', ['Road', 'Air', 'Ocean']) - return false unless transportation_mode_validator.valid?(@transportation_mode) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] transportation_mode Object to be assigned - def transportation_mode=(transportation_mode) - validator = EnumAttributeValidator.new('Object', ['Road', 'Air', 'Ocean']) - unless validator.valid?(transportation_mode) - fail ArgumentError, "invalid value for \"transportation_mode\", must be one of #{validator.allowable_values}." - end - @transportation_mode = transportation_mode - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - carrier_scac == o.carrier_scac && - carrier_shipment_reference_number == o.carrier_shipment_reference_number && - transportation_mode == o.transportation_mode && - bill_of_lading_number == o.bill_of_lading_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [carrier_scac, carrier_shipment_reference_number, transportation_mode, bill_of_lading_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_labels.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_labels.rb deleted file mode 100644 index be02241..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/transportation_labels.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The request schema for the GetShipmentLabels operation. - class TransportationLabels - attr_accessor :pagination - - # A list of one or more ShipmentLabels. - attr_accessor :transport_labels - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'transport_labels' => :'transportLabels' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Object', - :'transport_labels' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::TransportationLabels` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::TransportationLabels`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'transport_labels') - if (value = attributes[:'transport_labels']).is_a?(Array) - self.transport_labels = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - transport_labels == o.transport_labels - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, transport_labels].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/vendor_details.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/vendor_details.rb deleted file mode 100644 index 51a63a6..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/vendor_details.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # Vendor Details as part of Label response. - class VendorDetails - attr_accessor :selling_party - - # Unique vendor shipment id which is not used in last 365 days - attr_accessor :vendor_shipment_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'selling_party' => :'sellingParty', - :'vendor_shipment_identifier' => :'vendorShipmentIdentifier' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'selling_party' => :'Object', - :'vendor_shipment_identifier' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::VendorDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::VendorDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'selling_party') - self.selling_party = attributes[:'selling_party'] - end - - if attributes.key?(:'vendor_shipment_identifier') - self.vendor_shipment_identifier = attributes[:'vendor_shipment_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - selling_party == o.selling_party && - vendor_shipment_identifier == o.vendor_shipment_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [selling_party, vendor_shipment_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/volume.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/volume.rb deleted file mode 100644 index b6c9ffc..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/volume.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The volume of the shipment. - class Volume - # The unit of measurement. - attr_accessor :unit_of_measure - - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Volume` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Volume`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['CuFt', 'CuIn', 'CuM', 'CuY']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['CuFt', 'CuIn', 'CuM', 'CuY']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/weight.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/models/weight.rb deleted file mode 100644 index 08a637f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/models/weight.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -require 'date' - -module AmazonSpClients - module SpVendorsShipments - # The weight of the shipment. - class Weight - # The unit of measurement. - attr_accessor :unit_of_measure - - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_of_measure' => :'unitOfMeasure', - :'value' => :'value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_of_measure' => :'Object', - :'value' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `AmazonSpClients::SpVendorsShipments::Weight` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `AmazonSpClients::SpVendorsShipments::Weight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_of_measure') - self.unit_of_measure = attributes[:'unit_of_measure'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unit_of_measure.nil? - invalid_properties.push('invalid value for "unit_of_measure", unit_of_measure cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unit_of_measure.nil? - unit_of_measure_validator = EnumAttributeValidator.new('Object', ['G', 'Kg', 'Oz', 'Lb']) - return false unless unit_of_measure_validator.valid?(@unit_of_measure) - return false if @value.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit_of_measure Object to be assigned - def unit_of_measure=(unit_of_measure) - validator = EnumAttributeValidator.new('Object', ['G', 'Kg', 'Oz', 'Lb']) - unless validator.valid?(unit_of_measure) - fail ArgumentError, "invalid value for \"unit_of_measure\", must be one of #{validator.allowable_values}." - end - @unit_of_measure = unit_of_measure - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_of_measure == o.unit_of_measure && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_of_measure, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - AmazonSpClients::SpVendorsShipments.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end - - end -end diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/version.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/version.rb deleted file mode 100644 index 712a10f..0000000 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/version.rb +++ /dev/null @@ -1,14 +0,0 @@ -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -module SpVendorsShipments - VERSION = '1.0.0' -end diff --git a/vendor/vendors_shipments/sp_vendors_shipments.gemspec b/vendor/vendors_shipments/sp_vendors_shipments.gemspec deleted file mode 100644 index 8b242c4..0000000 --- a/vendor/vendors_shipments/sp_vendors_shipments.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#Selling Partner API for Retail Procurement Shipments - -#The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. - -OpenAPI spec version: v1 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.68 -=end - -$:.push File.expand_path("../lib", __FILE__) -require "sp_vendors_shipments/version" - -Gem::Specification.new do |s| - s.name = "sp_vendors_shipments" - s.version = SpVendorsShipments::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Swagger-Codegen"] - s.email = [""] - s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.summary = "Selling Partner API for Retail Procurement Shipments Ruby Gem" - s.description = "The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors." - s.license = "Unlicense" - s.required_ruby_version = ">= 2.5" - - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end From 1b893218815719b8a731dd4e2ca3e40c78313e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:56:23 +0200 Subject: [PATCH 14/83] Delete dead code left by the swagger-codegen client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit None of this was reachable: - ServiceError: never raised; the middleware raises Faraday errors. - Configuration: basic_auth_token (calls undefined username/password), the host= writer (the host reader recomputes from region, so writes never surfaced), and attrs only the old typhoeus client read: temp_folder_path, verify_ssl, verify_ssl_host, ssl_ca_cert, cert_file, key_file, params_encoding, inject_format, force_ending_format, plus the dead @refresh_token ivar. - ApiClient: typo'd @api_req_otps, the typhoeus-era req_opts keys that call_api never passes to Faraday, the commented-out update_params_for_auth! and download_file remains, and the 'File' return path reading a never-assigned @tempfile. - RaiseError: :sts in VALID_SERVICE — no caller ever passes it (STS goes through aws-sdk, not this middleware). Pinned by a new spec. --- lib/amazon_sp_clients.rb | 7 -- lib/amazon_sp_clients/api_client.rb | 46 +---------- lib/amazon_sp_clients/configuration.rb | 82 +------------------ .../middlewares/raise_error.rb | 2 +- lib/amazon_sp_clients/uploader.rb | 1 - .../middlewares/raise_error_spec.rb | 4 + 6 files changed, 9 insertions(+), 133 deletions(-) diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index 90abe2b..2dc08ad 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -77,13 +77,6 @@ module AmazonSpClients 'A1VC38T7YXB528' => 'fe' }.freeze - class ServiceError < StandardError - def initialize(original_msg, service) - msg = "Service '#{service}' ERR: #{original_msg}" - super(msg) - end - end - # Normal calls def self.new_session(refresh_token) AmazonSpClients::Session.new.authenticate(refresh_token) diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index b903dd4..676a145 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -2,7 +2,6 @@ require 'time' require 'json' -require 'tempfile' require 'faraday' require 'faraday_middleware' @@ -28,7 +27,6 @@ def initialize(session, config = Configuration.default) @config = config @user_agent = "Dropstream/1.0 (Language=Ruby/#{RUBY_VERSION})" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent } - @api_req_otps = {} @connection = Faraday.new( url: @config.base_url, @@ -97,7 +95,7 @@ def call_api(http_method, path, opts = {}) # @option opts [Hash] :query_params Query parameters # @option opts [Hash] :form_params Query parameters # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request + # @return [Array(String, Hash)] the request url and options def build_request(http_method, path, opts = {}) url = build_request_url(path) http_method = http_method.to_sym.downcase @@ -106,25 +104,12 @@ def build_request(http_method, path, opts = {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - req_opts = { method: http_method, headers: header_params, - params: query_params, - params_encoding: @config.params_encoding, - timeout: @config.timeout, - ssl_verifypeer: @config.verify_ssl, - ssl_verifyhost: _verify_ssl_host, - sslcert: @config.cert_file, - sslkey: @config.key_file, - verbose: @config.debugging + params: query_params } - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - if %i[post patch put delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update body: req_body @@ -133,7 +118,6 @@ def build_request(http_method, path, opts = {}) end end - # download_file(request) if opts[:return_type] == 'File' [url, req_opts] end @@ -186,11 +170,6 @@ def deserialize(response, return_type) body = response.body body = JSON.parse(body, symbolize_names: true) if body.is_a?(String) - # handle file downloading - return the File instance processed in request - # callbacks note that response body is empty when the file is written in - # chunks in request on_body callback - return @tempfile if return_type == 'File' - return nil if body.nil? || body.empty? # return response body directly for String return type @@ -260,27 +239,6 @@ def build_request_url(path) @config.base_url + path end - ## Update hearder and query params based on authentication settings. - ## - ## @param [Hash] header_params Header parameters - ## @param [Hash] query_params Query parameters - ## @param [String] auth_names Authentication scheme name - # def update_params_for_auth!(header_params, query_params, auth_names) - # Array(auth_names).each do |auth_name| - # auth_setting = @config.auth_settings[auth_name] - # next unless auth_setting - # case auth_setting[:in] - # when 'header' - # header_params[auth_setting[:key]] = auth_setting[:value] - # when 'query' - # query_params[auth_setting[:key]] = auth_setting[:value] - # else - # fail ArgumentError, - # 'Authentication token must be in `query` of `header`' - # end - # end - # end - # Sets user agent in HTTP header # # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index 5ff6f30..1266809 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -23,9 +23,6 @@ class Configuration # Defines url scheme attr_accessor :scheme - # Defines url host - attr_accessor :host - # Defines url base path attr_accessor :base_path @@ -42,13 +39,6 @@ class Configuration # @return [#debug] attr_accessor :logger - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - # The time limit for HTTP request in seconds. # Default to 0 (never times out). attr_accessor :timeout @@ -58,62 +48,11 @@ class Configuration # @return [true, false] attr_accessor :client_side_validation - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API . - # from https server Default to true . - # - # @note Do NOT set it to false in production code, otherwise you would face - # multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face - # multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related - # source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi - # collectionFormat. Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - def initialize @sandbox_env = false @credentials_provider = nil - # ap api - @refresh_token = nil @marketplace_id = nil # iam @@ -128,18 +67,10 @@ def initialize @endpoint = nil @scheme = 'https' @region = 'us-east-1' - @host = "#{'sandbox.' if @sandbox_env}#{AmazonSpClients::REGIONS.fetch(@region)}" @base_path = '/' @timeout = 60 @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil @debugging = false - @inject_format = false - @force_ending_format = false @logger = Logger.new(STDOUT) @logger.level = 1 yield(self) if block_given? @@ -159,11 +90,6 @@ def scheme=(scheme) @scheme = scheme.sub(%r{://}, '') end - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(%r{https?://}, '').split('/').first - end - def host "#{'sandbox.' if @sandbox_env}#{AmazonSpClients::REGIONS.fetch(@region)}" end @@ -178,14 +104,10 @@ def base_url "#{scheme}://#{[host, base_path].join('/').gsub(%r{/+}, '/')}".sub(%r{/+\z}, '') end - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - def region=(region) + # The fetch validates the region; host is computed from it. + AmazonSpClients::REGIONS.fetch(region) @region = region - @host = AmazonSpClients::REGIONS.fetch(@region) end # When sandbox mode is enabled, all requests will go to 'sandbox.' host. diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index 2e8d98c..23c84e9 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -15,7 +15,7 @@ class RaiseError < Faraday::Response::Middleware # rubocop:enable Naming/ConstantName - VALID_SERVICE = %i[sts token spapi uploads].freeze + VALID_SERVICE = %i[token spapi uploads].freeze def initialize(app, options = {}) super(app) diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index 7af1eb2..f48c578 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -2,7 +2,6 @@ require 'faraday' require 'faraday_middleware' -# require 'openssl' require 'zlib' require 'multi_xml' diff --git a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb index 534515c..3cfee0c 100644 --- a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb +++ b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb @@ -29,6 +29,10 @@ def rescued_error expect { described_class.new(app, { service: :bogus }) } .to raise_error(an_instance_of(RuntimeError)) end + + it 'accepts only the services the gem uses' do + expect(described_class::VALID_SERVICE).to eq(%i[token spapi uploads]) + end end describe 'status to error map' do From 61638f2c111ad0e3ed5b59cb9dea4b56cdb0ff44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:00:12 +0200 Subject: [PATCH 15/83] Remove AWS SigV4 signing and the STS session call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amazon dropped the SigV4 requirement for SP-API in October 2023; only the LWA access token is needed. This deletes the SigV4 middleware, the eager synchronous AssumeRole call that every new_session made for nothing, and the aws-sdk-core / aws-sigv4 dependencies. The Configuration attrs consumers still write (access_key, secret_key, role_arn, credentials_provider) stay as accepted-but- ignored, marked deprecated, so 1.8.0 is a drop-in upgrade. They go away in 2.0. Behavior changes: - new_session no longer makes an STS network call. - STS failures can no longer surface as laundered Faraday::ForbiddenError. - Session#role_credentials and Session#credentials_provider are gone; no consumer reads them (verified in active_cart, active_fulfillment, beagle_event_logger). Also: raise_error.rb and configuration.rb now require faraday and logger themselves (aws-sdk-core and the signer file used to load them first), and webmock is bumped because Ruby 3.4 no longer ships base64 — it previously arrived via aws-sdk-core. --- Gemfile.lock | 21 +--- amazon_sp_clients.gemspec | 2 - lib/amazon_sp_clients.rb | 1 - lib/amazon_sp_clients/api_client.rb | 3 - lib/amazon_sp_clients/configuration.rb | 10 +- .../middlewares/raise_error.rb | 1 + .../middlewares/request_signer_v4.rb | 52 --------- lib/amazon_sp_clients/session.rb | 20 +--- spec/amazon_sp_clients/api_client_spec.rb | 6 +- spec/amazon_sp_clients/module_helpers_spec.rb | 2 - spec/amazon_sp_clients/session_spec.rb | 2 - spec/amazon_sp_clients_spec.rb | 102 ------------------ spec/fixtures/sts_200_response.xml | 17 --- spec/fixtures/sts_403_response.xml | 8 -- 14 files changed, 13 insertions(+), 234 deletions(-) delete mode 100644 lib/amazon_sp_clients/middlewares/request_signer_v4.rb delete mode 100644 spec/fixtures/sts_200_response.xml delete mode 100644 spec/fixtures/sts_403_response.xml diff --git a/Gemfile.lock b/Gemfile.lock index 783f3c1..30b6212 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,6 @@ PATH remote: . specs: amazon_sp_clients (1.7.0) - aws-sdk-core - aws-sigv4 faraday (~> 1.4) faraday_middleware httpclient @@ -15,19 +13,9 @@ GEM addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) - aws-eventstream (1.3.2) - aws-partitions (1.1063.0) - aws-sdk-core (3.220.1) - aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.992.0) - aws-sigv4 (~> 1.9) - base64 - jmespath (~> 1, >= 1.6.1) - aws-sigv4 (1.11.0) - aws-eventstream (~> 1, >= 1.0.2) - base64 (0.2.0) bigdecimal (3.1.9) - crack (0.4.5) + crack (1.0.1) + bigdecimal rexml diff-lcs (1.5.0) dotenv (2.7.6) @@ -56,10 +44,9 @@ GEM faraday-retry (1.0.4) faraday_middleware (1.2.1) faraday (~> 1.0) - hashdiff (1.0.1) + hashdiff (1.2.1) httpclient (2.9.0) mutex_m - jmespath (1.6.2) json (2.21.2) language_server-protocol (3.17.0.5) lint_roller (1.1.0) @@ -111,7 +98,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.2.0) - webmock (3.14.0) + webmock (3.26.4) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 9c26b23..142d240 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -30,8 +30,6 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'aws-sdk-core' - spec.add_dependency 'aws-sigv4' spec.add_dependency 'faraday', '~> 1.4' spec.add_dependency 'faraday_middleware' spec.add_dependency 'httpclient' diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index 2dc08ad..cdd0e2f 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -2,7 +2,6 @@ require 'amazon_sp_clients/version' -require 'amazon_sp_clients/middlewares/request_signer_v4' require 'amazon_sp_clients/middlewares/raise_error' require 'amazon_sp_clients/token_exchange_auth' diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 676a145..99ab84c 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -37,9 +37,6 @@ def initialize(session, config = Configuration.default) ) do |conn| conn.adapter Faraday::Adapter::HTTPClient - conn.use AmazonSpClients::Middlewares::RequestSignerV4, - { session: @session, region: @config.region } - conn.use AmazonSpClients::Middlewares::RaiseError, { service: :spapi } end end diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index 1266809..bac0d5d 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'logger' + module AmazonSpClients class Configuration # SP specific @@ -8,16 +10,16 @@ class Configuration attr_reader :endpoint - attr_accessor :credentials_provider - # App credentials attr_accessor :client_id attr_accessor :client_secret - # IAM credentials + # Deprecated AWS/SigV4-era settings. Amazon dropped the SigV4 + # requirement in October 2023. Accepted and ignored since 1.8.0; + # they will be removed in 2.0. + attr_accessor :credentials_provider attr_accessor :access_key attr_accessor :secret_key - attr_accessor :role_arn # Defines url scheme diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index 23c84e9..d6ca8a8 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'faraday' require 'multi_xml' require 'json' diff --git a/lib/amazon_sp_clients/middlewares/request_signer_v4.rb b/lib/amazon_sp_clients/middlewares/request_signer_v4.rb deleted file mode 100644 index 1cc9a72..0000000 --- a/lib/amazon_sp_clients/middlewares/request_signer_v4.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'faraday' -require 'aws-sigv4' - -module AmazonSpClients - module Middlewares - class RequestSignerV4 < Faraday::Middleware - CRYPTO_HEADER = 'x-amz-content-sha256' - SESSION_HEADER = 'x-amz-security-token' - - def initialize(app, options = {}) - super(app) - @app = app - @options = options - end - - def call(env) - # https://www.rubydoc.info/gems/aws-sigv4/1.0.0/Aws/Sigv4/Signer#sign_request-instance_method - signer = - Aws::Sigv4::Signer.new( - service: 'execute-api', - region: @options[:region], - credentials_provider: @options[:session].credentials_provider - ) - - signature = - signer.sign_request( - http_method: env.method.to_s.upcase!, - url: env.url, - headers: env.request_headers, - body: env.request_body - ) - - signature_headers = signature.headers - env.request_headers.merge!( - 'authorization' => signature_headers['authorization'], - 'host' => signature_headers['host'], - CRYPTO_HEADER => signature_headers[CRYPTO_HEADER], - 'x-amz-date' => signature_headers['x-amz-date'] - ) - - # Only include SESSION_HEADER if it exists in signature_headers - if signature_headers.key?(SESSION_HEADER) - env.request_headers[SESSION_HEADER] = signature_headers[SESSION_HEADER] - end - - @app.call env - end - end - end -end diff --git a/lib/amazon_sp_clients/session.rb b/lib/amazon_sp_clients/session.rb index d67043c..cacb554 100644 --- a/lib/amazon_sp_clients/session.rb +++ b/lib/amazon_sp_clients/session.rb @@ -2,7 +2,6 @@ require 'time' require 'amazon_sp_clients/sp_tokens_2021' -require 'aws-sdk-core' module AmazonSpClients class Session @@ -21,7 +20,7 @@ class Session } }.freeze - attr_reader :access_token, :restricted_data_token, :credentials_provider + attr_reader :access_token, :restricted_data_token def initialize(config = Configuration.default, &block) @config = config @@ -35,26 +34,9 @@ def initialize(config = Configuration.default, &block) @grantless = false @scope = nil - @session_client = nil - @credentials_provider = @config.credentials_provider || role_credentials - @callback = block end - # NOTE: usually will make immediate web request - def role_credentials - Aws::AssumeRoleCredentials.new( - client: Aws::STS::Client.new( - credentials: Aws::Credentials.new(@config.access_key, - @config.secret_key), region: @config.region - ), - role_arn: @config.role_arn, - role_session_name: 'SPAPISession' - ) - rescue StandardError => e - raise Faraday::ForbiddenError.new(e.message, { service: 'sts', request: {}, response: {} }) - end - def with_callback(&block) @callback = block self diff --git a/spec/amazon_sp_clients/api_client_spec.rb b/spec/amazon_sp_clients/api_client_spec.rb index 9c145eb..2ea523c 100644 --- a/spec/amazon_sp_clients/api_client_spec.rb +++ b/spec/amazon_sp_clients/api_client_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -# Fake session for ApiClient specs. Records calls, never talks to AWS. +# Fake session for ApiClient specs. Records calls. class FakeSpSession attr_reader :events, :rdt_resources @@ -25,10 +25,6 @@ def ask_for_restricted_data_token(resource) def restricted_data_token @rdt_resources.to_h { |r| [r, 'RDT_TOKEN'] } end - - def credentials_provider - Aws::Credentials.new('a', 'b', 'c') - end end # Bare response stand-in for the pure helper methods. diff --git a/spec/amazon_sp_clients/module_helpers_spec.rb b/spec/amazon_sp_clients/module_helpers_spec.rb index 24179d9..84dd457 100644 --- a/spec/amazon_sp_clients/module_helpers_spec.rb +++ b/spec/amazon_sp_clients/module_helpers_spec.rb @@ -10,8 +10,6 @@ AmazonSpClients.configure do |c| c.client_id = 'CLIENT_ID' c.client_secret = 'CLIENT_SECRET' - # Skips the eager STS AssumeRole request in Session#initialize. - c.credentials_provider = Aws::Credentials.new('key', 'secret') c.logger = Logger.new(File::NULL) end end diff --git a/spec/amazon_sp_clients/session_spec.rb b/spec/amazon_sp_clients/session_spec.rb index 05b4f6d..9caf06c 100644 --- a/spec/amazon_sp_clients/session_spec.rb +++ b/spec/amazon_sp_clients/session_spec.rb @@ -13,8 +13,6 @@ AmazonSpClients::Configuration.new do |c| c.client_id = 'CLIENT_ID' c.client_secret = 'CLIENT_SECRET' - # Skips the eager STS AssumeRole call in Session#initialize. - c.credentials_provider = Aws::Credentials.new('k', 's') c.sandbox_env! end end diff --git a/spec/amazon_sp_clients_spec.rb b/spec/amazon_sp_clients_spec.rb index 16149e8..d771cc0 100644 --- a/spec/amazon_sp_clients_spec.rb +++ b/spec/amazon_sp_clients_spec.rb @@ -17,10 +17,6 @@ def access_token 'oaisdhgoajsdfoahgasd' end - def credentials_provider - Aws::Credentials.new('access_key_id', 'secret_access_key', 'session_token') - end - def restricted_data_token 'RESTRTOKENosdfjaoighasdf' end @@ -32,10 +28,6 @@ def restricted_data_token Timecop.freeze(new_time) AmazonSpClients.configure do |c| - c.access_key = ENV['AMZ_ACCESS_KEY_ID'] || 'ACCESS_KEY' - c.secret_key = ENV['AMZ_SECRET_ACCESS_KEY'] || 'SECRET_KEY' - c.role_arn = ENV['AMZ_ROLE_ARN'] || 'arn:aws:iam::*' - c.client_id = ENV['AMZ_CLIENT_ID'] || 'CLIENT_ID' c.client_secret = ENV['AMZ_CLIENT_SECRET'] || 'CLIENT_SECRET' @@ -56,11 +48,6 @@ def to_json(*_opts) describe 'restricted access resources' do context 'success path' do it 'returns success response with PII data' do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, body: fixture('token_success.json') @@ -103,11 +90,6 @@ def to_json(*_opts) describe 'complete flow test' do context 'success path' do it 'returns success responses' do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, body: fixture('token_success.json') @@ -136,11 +118,6 @@ def to_json(*_opts) context 'success path with different region' do it 'returns success responses' do - stub_request(:post, 'https://sts.eu-west-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 200, body: fixture('token_success.json') @@ -169,26 +146,8 @@ def to_json(*_opts) end end - context 'with sts error' do - it 'session never runs and returns error' do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 403, - body: fixture('sts_403_response.xml') - ) - - refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' - - expect { AmazonSpClients.new_session(refresh_token) }.to raise_error Faraday::ForbiddenError - end - end - context 'with token error' do it 'session never runs and returns error' do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( status: 400, body: fixture('token_error.json') @@ -230,62 +189,6 @@ def to_json(*_opts) end end - describe 'aws sdk global credentials' do - before do - Aws.config.update(credentials: Aws::Credentials.new('bogus', 'bogus'), region: 'bogus') - end - - after { Aws.config = {} } - - it 'initializes sts client with correct credentials' do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - - stub_request(:post, 'https://api.amazon.com/auth/o2/token').to_return( - status: 200, - body: fixture('token_success.json') - ) - - refresh_token = ENV['AMZ_REFRESH_TOKEN'] || 'REFRESH_TOKEN' - session = AmazonSpClients.new_session(refresh_token) - - expect(session.credentials_provider.client.config.credentials.access_key_id) - .to eq(AmazonSpClients.configure.access_key) - - expect(session.credentials_provider.client.config.credentials.secret_access_key) - .to eq(AmazonSpClients.configure.secret_key) - end - end - - describe 'custom credentials provider config' do - let(:callback) { -> { 'initial_access_token' } } - let(:session) { AmazonSpClients.new_callback_session(&callback) } - let(:api_client) { AmazonSpClients::ApiClient.new(session) } - - before do - AmazonSpClients.configure do |c| - c.access_key = nil - c.secret_key = nil - c.role_arn = nil - c.client_id = nil - c.client_secret = nil - c.sandbox_env! - c.credentials_provider = Aws::Credentials.new('foo', 'bar') - end - end - - it 'uses credentials_provider from config' do - stub_request(:get, 'https://sandbox.sellingpartnerapi-na.amazon.com/test/endpoint1').to_return( - status: 200, body: '{}' - ) - expect(callback).to receive(:call).and_return('initial_access_token') - api_client.call_api(:get, '/test/endpoint1') - expect(session.credentials_provider).to be_a(Aws::Credentials) - end - end - describe 'new_callback_session' do let(:api_client) { AmazonSpClients::ApiClient.new(session) } let(:session) { AmazonSpClients.new_callback_session(&callback) } @@ -293,11 +196,6 @@ def to_json(*_opts) let(:access_token) { 'initial_access_token' } before do - stub_request(:post, 'https://sts.us-east-1.amazonaws.com/').to_return( - status: 200, - body: fixture('sts_200_response.xml') - ) - stub_request(:get, %r{https://sandbox\.sellingpartnerapi-na\.amazon\.com/.*}) .to_return(status: 200, body: '{}') end diff --git a/spec/fixtures/sts_200_response.xml b/spec/fixtures/sts_200_response.xml deleted file mode 100644 index 7dcd26d..0000000 --- a/spec/fixtures/sts_200_response.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - AR0ARSGHDFEGSDGERHDFF:SPAPISession - arn:aws:sts::123123123123:assumed-role/SellingPartnerAPIRole/SPAPISession - - - ASIA2RRSYYBAYP2IUWBN - VV9w5kBfknpHi1dKVCle9VyZBZ6hawBrME8DKnWA - FwoGZXIvYXdzEJ7//////////wEaDEnSBETH9jIq5MXPAiKwAa56A52qdVEgL6xwd0bZepceZpgRN8vFQZ+sf2Tk79yrduOL2WO8MMHgu1E4ozj7i+3T/ZR8jQuANx4bJJlaZDJvyADZZq9a5OimzGmz6+y4rD29l2zQhqRhpHHzqTpKrIFCpYkVW+16JxTtHMqkduORCtkXcwfiJL+7BFE5HuRmRdZiGOZOEUjc4clPnHDmAuo1mBD0luVT7B5TO/gs+9cwfbWH7eosYEVco1eNXgCmKLf98oUGMi26OzQUTBr7sirDqTmFhwkXUy1eV/U5DanQSsu96JJ6a1kpmR1r1VG92tLrAsY= - 2021-06-06T13:25:27Z - - - - 9727eb79-4e5a-45f2-af3f-327128de291c - - diff --git a/spec/fixtures/sts_403_response.xml b/spec/fixtures/sts_403_response.xml deleted file mode 100644 index 5e954f3..0000000 --- a/spec/fixtures/sts_403_response.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Sender - SignatureDoesNotMatch - The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. - - 1666d4dd-6b9c-4aa3-8759-71e6f1e98d8a - From 25cfbb914f8c354f07934bec82f742b4849ea1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:01:26 +0200 Subject: [PATCH 16/83] Fix grantless sessions never re-authenticating Session#refresh tested @grantles, a misspelling of @grantless that is never assigned, so the branch never ran. An expired grantless session fell through to the refresh-token branch, which is also a no-op there (client_credentials responses carry no refresh token), and kept using the stale access token until Amazon returned 403. --- lib/amazon_sp_clients/session.rb | 2 +- spec/amazon_sp_clients/session_spec.rb | 35 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/amazon_sp_clients/session.rb b/lib/amazon_sp_clients/session.rb index cacb554..698d2ee 100644 --- a/lib/amazon_sp_clients/session.rb +++ b/lib/amazon_sp_clients/session.rb @@ -65,7 +65,7 @@ def refresh if @callback @access_token = @callback.call @access_token_expires_at = nil - elsif @grantles + elsif @grantless authenticate_grantless(@scope) elsif !@refresh_token.nil? authenticate(@refresh_token) diff --git a/spec/amazon_sp_clients/session_spec.rb b/spec/amazon_sp_clients/session_spec.rb index 9caf06c..b79ee80 100644 --- a/spec/amazon_sp_clients/session_spec.rb +++ b/spec/amazon_sp_clients/session_spec.rb @@ -104,6 +104,41 @@ end end + describe '#refresh with a grantless session' do + # Grantless (client_credentials) responses carry no refresh_token. + let(:grantless_body) do + '{"access_token":"Atza|GRANTLESS","token_type":"bearer","expires_in":3600}' + end + + before do + stub_request(:post, token_url).to_return(status: 200, body: grantless_body) + end + + it 'makes no request while the token is valid' do + session.authenticate_grantless('test::scope') + + session.refresh + + expect(a_request(:post, token_url)).to have_been_made.once + end + + it 're-requests with the client_credentials grant after expiry' do + session.authenticate_grantless('test::scope') + + Timecop.freeze(Time.now + 3601) + session.refresh + + expect( + a_request(:post, token_url).with( + body: hash_including( + 'grant_type' => 'client_credentials', + 'scope' => 'test::scope' + ) + ) + ).to have_been_made.times(2) + end + end + describe '#authenticate_grantless' do before do stub_request(:post, token_url).to_return(status: 200, body: fixture('token_success.json')) From 7ad086f6f4e6dbd996d198f5855c2c3562185354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:02:10 +0200 Subject: [PATCH 17/83] Fix dropped query params on POST, PUT and PATCH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit call_api passed query params as the second positional argument for every verb. Faraday's get/delete accept (url, params), but post/put/ patch accept (url, body) — the params landed in the body slot and were then overwritten by the real body. Every POST/PUT/PATCH with query params silently lost them: 21 generated operations, including put_listings_item and patch_listings_item, whose required marketplaceIds is a query param. Set params on the request object instead, which works for all verbs. --- lib/amazon_sp_clients/api_client.rb | 6 +++++- spec/amazon_sp_clients/api_client_spec.rb | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 99ab84c..1f36137 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -64,8 +64,12 @@ def call_api(http_method, path, opts = {}) access_token = @session.access_token end + # Query params go through the request object: Faraday's post/put/ + # patch helpers take (url, body), so a positional params argument + # would be treated as the body there and lost. response = - @connection.send(req_opts[:method], url, req_opts[:params]) do |req| + @connection.send(req_opts[:method], url) do |req| + req.params.update(req_opts[:params]) req.body = req_opts[:body] req.headers.merge!( { diff --git a/spec/amazon_sp_clients/api_client_spec.rb b/spec/amazon_sp_clients/api_client_spec.rb index 2ea523c..d38b6be 100644 --- a/spec/amazon_sp_clients/api_client_spec.rb +++ b/spec/amazon_sp_clients/api_client_spec.rb @@ -52,6 +52,24 @@ def restricted_data_token expect(stub).to have_been_requested end + # Faraday's post/put/patch take (url, body); passing params there + # used to drop them entirely (21 generated operations affected). + it 'puts query params in the PUT url next to the body' do + stub = + stub_request(:put, "#{base_url}/listings/2021-08-01/items/SELLER/SKU") + .with(query: { 'marketplaceIds' => 'ATVPDKIKX0DER' }, body: '{"productType":"X"}') + .to_return(status: 200, body: '{}') + + client.call_api( + :PUT, + '/listings/2021-08-01/items/SELLER/SKU', + query_params: { 'marketplaceIds' => 'ATVPDKIKX0DER' }, + body: { productType: 'X' } + ) + + expect(stub).to have_been_requested + end + it 'sends content type, user agent, access token and amz date headers' do Timecop.freeze(Time.utc(2021, 6, 9, 9, 16, 55)) From 17211014a94d63049eba975c50a3521a8a23cec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:02:49 +0200 Subject: [PATCH 18/83] Send the header params built for each operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build_request merged the generated APIs' header_params (per-op Accept, Content-Type) into req_opts[:headers], but call_api never read it — only the connection defaults and the x-amz pair reached the wire. Harmless for Content-Type (every operation happens to use application/json, same as the default) but the Accept header was never sent at all, including application/hal+json where specs ask for it. Merge req_opts[:headers] into the request before the x-amz pair. --- lib/amazon_sp_clients/api_client.rb | 1 + spec/amazon_sp_clients/api_client_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 1f36137..7e83387 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -71,6 +71,7 @@ def call_api(http_method, path, opts = {}) @connection.send(req_opts[:method], url) do |req| req.params.update(req_opts[:params]) req.body = req_opts[:body] + req.headers.merge!(req_opts[:headers]) req.headers.merge!( { 'x-amz-date' => Time.now.utc.strftime('%Y%m%dT%H%M%SZ'), diff --git a/spec/amazon_sp_clients/api_client_spec.rb b/spec/amazon_sp_clients/api_client_spec.rb index d38b6be..a8c09b8 100644 --- a/spec/amazon_sp_clients/api_client_spec.rb +++ b/spec/amazon_sp_clients/api_client_spec.rb @@ -90,6 +90,19 @@ def restricted_data_token expect(stub).to have_been_requested end + # Generated APIs pass per-operation Accept/Content-Type through + # header_params; they used to be built and then thrown away. + it 'sends per-operation header params' do + stub = + stub_request(:get, "#{base_url}/test") + .with(headers: { 'Accept' => 'application/hal+json' }) + .to_return(status: 200, body: '{}') + + client.call_api(:GET, '/test', header_params: { 'Accept' => 'application/hal+json' }) + + expect(stub).to have_been_requested + end + it 'refreshes the session before the request' do stub_request(:get, "#{base_url}/test").to_return do |_req| session.events << :http_request From 240379a52da51c385d4c912b6553a98fc640bfdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:03:49 +0200 Subject: [PATCH 19/83] Redact secrets in raised error payloads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RaiseError copied the full request headers and body into Faraday::Error#response, which consumers log. That exposed the LWA or restricted data token (x-amz-access-token), SigV4-era authorization and x-amz-security-token headers, and — for the token service — client_secret and refresh_token in the form body. Replace those header values with [FILTERED] and filter the whole request body for the token service. Response details and non-token request bodies are unchanged; consumers only read e.message. --- .../middlewares/raise_error.rb | 24 ++++++++++++-- .../middlewares/raise_error_spec.rb | 31 +++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index d6ca8a8..b2e53a5 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -18,6 +18,10 @@ class RaiseError < Faraday::Response::Middleware VALID_SERVICE = %i[token spapi uploads].freeze + # The error payload ends up in consumer logs; keep secrets out. + FILTERED = '[FILTERED]' + SENSITIVE_HEADERS = %w[authorization x-amz-access-token x-amz-security-token].freeze + def initialize(app, options = {}) super(app) @app = app @@ -123,11 +127,27 @@ def response_values(env) url_path: env.url.path, url: env.url, params: env.params, - headers: env.request_headers, - body: env.request_body + headers: redacted_request_headers(env.request_headers), + body: redacted_request_body(env) } } end + + private + + def redacted_request_headers(headers) + (headers || {}).to_hash.to_h do |key, value| + SENSITIVE_HEADERS.include?(key.downcase) ? [key, FILTERED] : [key, value] + end + end + + # The LWA token request body carries client_secret and + # refresh_token as form fields. + def redacted_request_body(env) + return FILTERED if @service == :token + + env.request_body + end end end end diff --git a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb index 3cfee0c..875079f 100644 --- a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb +++ b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb @@ -160,5 +160,36 @@ def rescued_error expect(err.response[:request][:url_path]).to eq('/orders/v0/orders') expect(err.response[:request][:body]).to eq('req') end + + # Consumers log these payloads; tokens must not leak through them. + it 'filters auth headers from the request details' do + stub_request(:get, "#{base_url}/orders").to_return(status: 400, body: '') + + err = + rescued_error do + conn(:spapi).get('/orders') do |req| + req.headers['x-amz-access-token'] = 'SECRET_TOKEN' + req.headers['authorization'] = 'AWS4-HMAC-SHA256 secret' + req.headers['x-amz-security-token'] = 'STS_TOKEN' + end + end + + headers = err.response[:request][:headers] + expect(headers['x-amz-access-token']).to eq('[FILTERED]') + expect(headers['authorization']).to eq('[FILTERED]') + expect(headers['x-amz-security-token']).to eq('[FILTERED]') + end + + it 'filters the request body of token errors' do + stub_request(:post, "#{base_url}/auth/o2/token") + .to_return(status: 400, body: fixture('token_error.json')) + + err = + rescued_error do + conn(:token).post('/auth/o2/token', 'client_secret=SECRET') + end + + expect(err.response[:request][:body]).to eq('[FILTERED]') + end end end From 7ea69ec204976985116ddb474d89168ba3b86a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:04:30 +0200 Subject: [PATCH 20/83] Raise a clear error for an unknown endpoint config.endpoint = 'zz' used to corrupt @region to nil and then die with KeyError 'key not found: nil' from deep inside region=. Now set_region_by_endpoint raises ArgumentError naming the bad value before touching any state. --- lib/amazon_sp_clients/configuration.rb | 2 ++ spec/amazon_sp_clients/configuration_spec.rb | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index bac0d5d..018b2d8 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -146,6 +146,8 @@ def set_region_by_endpoint(str) AmazonSpClients::REGION_FE when 'ae', 'de', 'eg', 'es', 'fr', 'gb', 'in', 'it', 'nl', 'sa', 'tr', 'pl', 'se' AmazonSpClients::REGION_EU + else + raise ArgumentError, "unknown endpoint #{str.inspect}" end end end diff --git a/spec/amazon_sp_clients/configuration_spec.rb b/spec/amazon_sp_clients/configuration_spec.rb index ae9c4e9..5e4000a 100644 --- a/spec/amazon_sp_clients/configuration_spec.rb +++ b/spec/amazon_sp_clients/configuration_spec.rb @@ -144,6 +144,20 @@ expect(config.region).to eq('eu-west-1') end end + + it 'raises a clear error for an unknown endpoint' do + expect { config.endpoint = 'zz' } + .to raise_error(ArgumentError, 'unknown endpoint "zz"') + end + + it 'keeps region and endpoint on an unknown endpoint' do + config.endpoint = 'na' + + expect { config.endpoint = 'zz' }.to raise_error(ArgumentError) + + expect(config.region).to eq('us-east-1') + expect(config.endpoint).to eq('na') + end end describe '#scheme=' do From 9e9151e1f69998ff79391fb5743bdeff6b971186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:05:12 +0200 Subject: [PATCH 21/83] Stop nil-ing string-keyed ApiResponse payloads The envelope guard accepted string 'payload'/'errors' keys but the branch read only symbol keys, so a string-keyed hash matched the guard and came out as a nil payload. Envelope keys are always symbols in practice (deserialize symbolizes), so drop the string checks: a string-keyed hash now lands intact in payload like any other unrecognized shape. --- lib/amazon_sp_clients/api_response.rb | 5 +++-- spec/amazon_sp_clients/api_response_spec.rb | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/amazon_sp_clients/api_response.rb b/lib/amazon_sp_clients/api_response.rb index 1c91111..6b48c97 100644 --- a/lib/amazon_sp_clients/api_response.rb +++ b/lib/amazon_sp_clients/api_response.rb @@ -23,8 +23,9 @@ def initialize(attributes = {}, response = nil) 'The input argument (attributes) must be a hash in `ApiResponse` initialize method' end - if attributes.key?('payload') || attributes.key?(:payload) || attributes.key?('errors') || - attributes.key?(:errors) + # The envelope keys are always symbols: deserialize parses + # response bodies with symbolize_names. + if attributes.key?(:payload) || attributes.key?(:errors) self.payload = attributes[:payload] if attributes.key?(:errors) self.errors = AmazonSpClients::ApiError.new(attributes.delete(:errors)) diff --git a/spec/amazon_sp_clients/api_response_spec.rb b/spec/amazon_sp_clients/api_response_spec.rb index c2aaa51..71341f4 100644 --- a/spec/amazon_sp_clients/api_response_spec.rb +++ b/spec/amazon_sp_clients/api_response_spec.rb @@ -83,6 +83,15 @@ expect(response.errors).to be_a(AmazonSpClients::ApiError) end + # The envelope keys are always symbols (deserialize symbolizes). + # A string-keyed hash used to match the guard but read nothing, + # silently turning the payload into nil. + it 'keeps a string-keyed hash intact as the payload' do + response = api_response.new('payload' => { 'feedId' => 1 }) + + expect(response.payload).to eq('payload' => { 'feedId' => 1 }) + end + it 'exposes attributes and response readers' do attrs = { payload: { feedId: 1 } } http_response = double('response') From 9720324bca0c1a2f5692a87c1df4b7dac67f8606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:05:54 +0200 Subject: [PATCH 22/83] Add Saudi Arabia to MARKETPLACE_IDS MARKETPLACE_ENDPOINT_MAP and set_region_by_endpoint both know the Saudi marketplace (A17E79C6D8DWNP, 'sa'), but MARKETPLACE_IDS was missing the key. A spec now keeps the two constants in sync. --- lib/amazon_sp_clients.rb | 1 + spec/amazon_sp_clients/configuration_spec.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index cdd0e2f..e4b9524 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -45,6 +45,7 @@ module AmazonSpClients pl: 'A1C3SOZRARQ6R3', eg: 'ARBP9OOSHTCHU', tr: 'A33AVAJ2PDY3EV', + sa: 'A17E79C6D8DWNP', ae: 'A2VIGQ35RCS4UG', in: 'A21TJRUUN4KGV', # FE diff --git a/spec/amazon_sp_clients/configuration_spec.rb b/spec/amazon_sp_clients/configuration_spec.rb index 5e4000a..a9093e6 100644 --- a/spec/amazon_sp_clients/configuration_spec.rb +++ b/spec/amazon_sp_clients/configuration_spec.rb @@ -256,5 +256,10 @@ expect(AmazonSpClients::MARKETPLACE_IDS[:de]).to eq('A1PA6795UKMFR9') expect(AmazonSpClients::MARKETPLACE_IDS[:jp]).to eq('A1VC38T7YXB528') end + + it 'keeps both marketplace constants in sync' do + expect(AmazonSpClients::MARKETPLACE_IDS.values.sort) + .to eq(AmazonSpClients::MARKETPLACE_ENDPOINT_MAP.keys.sort) + end end end From 3a34ac59d2267ee9174117fef005302bd365f031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:07:23 +0200 Subject: [PATCH 23/83] Apply the configured timeout to every connection Only ApiClient honored config.timeout. TokenExchangeAuth, Uploader, Downloader, and download_report_document built Faraday connections with no timeout at all, so a hung LWA or S3 endpoint blocked the caller forever. All connections now pass the configured timeout (default 60s). --- lib/amazon_sp_clients.rb | 2 +- lib/amazon_sp_clients/token_exchange_auth.rb | 2 +- lib/amazon_sp_clients/uploader.rb | 7 +++-- spec/amazon_sp_clients/module_helpers_spec.rb | 10 ++++++ .../token_exchange_auth_spec.rb | 10 ++++++ spec/amazon_sp_clients/uploader_spec.rb | 31 +++++++++++++++---- 6 files changed, 51 insertions(+), 11 deletions(-) diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index e4b9524..e17d9b8 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -110,7 +110,7 @@ def self.download_feed_report(feed_processing_report) def self.download_report_document(doc_params) url = doc_params.fetch(:url) conn = - Faraday.new do |c| + Faraday.new(request: { timeout: configure.timeout }) do |c| c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } c.response :logger, configure.logger, {} end diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index de23cf1..72ddfbb 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -23,7 +23,7 @@ def initialize(refresh_token = nil, config = Configuration.default) @debugging = @config.debugging @conn = - Faraday.new("https://#{TOKEN_HOST}") do |conn| + Faraday.new("https://#{TOKEN_HOST}", request: { timeout: @config.timeout }) do |conn| conn.use AmazonSpClients::Middlewares::RaiseError, { service: :token } conn.adapter Faraday::Adapter::HTTPClient end diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index f48c578..9fcd20f 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -10,11 +10,12 @@ class Uploader attr_reader :response def initialize + config = AmazonSpClients.configure @conn = - Faraday.new do |c| + Faraday.new(request: { timeout: config.timeout }) do |c| c.adapter Faraday::Adapter::HTTPClient c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } - c.response :logger, AmazonSpClients.configure.logger, {} + c.response :logger, config.logger, {} end end @@ -46,7 +47,7 @@ def initialize(feed_processing_report) @compression_algorithm = feed_processing_report[:compressionAlgorithm] @conn = - Faraday.new do |c| + Faraday.new(request: { timeout: @config.timeout }) do |c| c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } c.response :logger, @config.logger, {} end diff --git a/spec/amazon_sp_clients/module_helpers_spec.rb b/spec/amazon_sp_clients/module_helpers_spec.rb index 84dd457..5d6badc 100644 --- a/spec/amazon_sp_clients/module_helpers_spec.rb +++ b/spec/amazon_sp_clients/module_helpers_spec.rb @@ -136,6 +136,16 @@ expect(WebMock).to have_requested(:get, doc_url) end + it 'applies the configured timeout to its connection' do + AmazonSpClients.configure.timeout = 7 + allow(Faraday).to receive(:new).and_call_original + stub_request(:get, doc_url).to_return(status: 200, body: 'x') + + AmazonSpClients.download_report_document(url: doc_url) + + expect(Faraday).to have_received(:new).with(request: { timeout: 7 }) + end + it 'raises not found error on 404' do stub_request(:get, doc_url).to_return(status: 404, body: 'gone') diff --git a/spec/amazon_sp_clients/token_exchange_auth_spec.rb b/spec/amazon_sp_clients/token_exchange_auth_spec.rb index f1391c6..b572964 100644 --- a/spec/amazon_sp_clients/token_exchange_auth_spec.rb +++ b/spec/amazon_sp_clients/token_exchange_auth_spec.rb @@ -8,6 +8,16 @@ @token = AmazonSpClients::TokenExchangeAuth.new('REFRESH_TOKEN', c) end + it 'applies the configured timeout to its connection' do + c = AmazonSpClients::Configuration.new + c.timeout = 7 + + token = described_class.new('REFRESH_TOKEN', c) + conn = token.instance_variable_get(:@conn) + + expect(conn.options.timeout).to eq(7) + end + describe '#exchange' do context 'granted (refresh_token)' do it 'returns AuthResponse with token fields' do diff --git a/spec/amazon_sp_clients/uploader_spec.rb b/spec/amazon_sp_clients/uploader_spec.rb index 1edc5a8..32b2a4c 100644 --- a/spec/amazon_sp_clients/uploader_spec.rb +++ b/spec/amazon_sp_clients/uploader_spec.rb @@ -2,10 +2,19 @@ require 'amazon_sp_clients/uploader' RSpec.describe AmazonSpClients::Uploader do - let(:logger) { instance_double(Logger, info: nil) } + let(:config) do + AmazonSpClients::Configuration.new { |c| c.logger = Logger.new(File::NULL) } + end + + before { Thread.current[:amazon_sp_configuration] = config } + after { Thread.current[:amazon_sp_configuration] = nil } + + it 'applies the configured timeout to its connection' do + config.timeout = 7 + + conn = described_class.new.instance_variable_get(:@conn) - before do - allow(AmazonSpClients).to receive_message_chain(:configure, :logger).and_return(logger) + expect(conn.options.timeout).to eq(7) end describe '#upload' do @@ -30,10 +39,20 @@ end RSpec.describe AmazonSpClients::Downloader do - let(:logger) { instance_double(Logger, info: nil) } + let(:config) do + AmazonSpClients::Configuration.new { |c| c.logger = Logger.new(File::NULL) } + end + + before { Thread.current[:amazon_sp_configuration] = config } + after { Thread.current[:amazon_sp_configuration] = nil } + + it 'applies the configured timeout to its connection' do + config.timeout = 7 + + downloader = described_class.new(url: 'https://example.com/download') + conn = downloader.instance_variable_get(:@conn) - before do - allow(AmazonSpClients).to receive_message_chain(:configure, :logger).and_return(logger) + expect(conn.options.timeout).to eq(7) end describe '#download' do From 5279dd022aa55efc0fa5a48b3f9796c6cc59cb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:07:55 +0200 Subject: [PATCH 24/83] Keep session expiry times as Time objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expiry was stored as a strftime string and re-parsed with strptime on every check — needless work, and a wrong-zone parse would shift the comparison silently. Store the Time directly and drop the String branch. Also renames the consistently misspelled @restricted_data_token_expirest_at ivar. --- lib/amazon_sp_clients/session.rb | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/amazon_sp_clients/session.rb b/lib/amazon_sp_clients/session.rb index 698d2ee..0acd359 100644 --- a/lib/amazon_sp_clients/session.rb +++ b/lib/amazon_sp_clients/session.rb @@ -30,7 +30,7 @@ def initialize(config = Configuration.default, &block) @access_token = nil @access_token_expires_at = nil @restricted_data_token = {} - @restricted_data_token_expirest_at = {} + @restricted_data_token_expires_at = {} @grantless = false @scope = nil @@ -75,7 +75,7 @@ def refresh def ask_for_restricted_data_token(restricted_resource) @logger.debug('this request will require restricted data token') if !@restricted_data_token[restricted_resource].nil? && - !expired?(@restricted_data_token_expirest_at[restricted_resource]) + !expired?(@restricted_data_token_expires_at[restricted_resource]) @logger.debug( "restricted_data_token for `#{restricted_resource}` is still valid, skipping /tokes20210 request" ) @@ -96,8 +96,8 @@ def ask_for_restricted_data_token(restricted_resource) # TODO: handle errors for restricted_data_token request! tokens_resp = tokens_api.create_restricted_data_token(token_params) - @restricted_data_token_expirest_at[restricted_resource] = - duration_to_date(tokens_resp.payload[:expiresIn]) + @restricted_data_token_expires_at[restricted_resource] = + duration_to_time(tokens_resp.payload[:expiresIn]) @restricted_data_token[restricted_resource] = tokens_resp.payload[:restrictedDataToken] end @@ -113,7 +113,7 @@ def request_access_token resp_struct = exchange_token_request @access_token = resp_struct.access_token @refresh_token = resp_struct.refresh_token - @access_token_expires_at = duration_to_date(resp_struct.expires_in) + @access_token_expires_at = duration_to_time(resp_struct.expires_in) end def exchange_token_request @@ -125,19 +125,12 @@ def exchange_token_request def expired?(expires) return true if expires.nil? - expires_time = if expires.is_a?(String) - Time.strptime(expires, '%Y-%m-%dT%H:%M:%S%Z') - else - expires - end - now = Time.now.utc - now >= expires_time - 60 # Shorten expiration time by 60s as a safety net + # Shorten expiration time by 60s as a safety net. + Time.now.utc >= expires - 60 end - def duration_to_date(seconds) - now = Time.now.utc - new = now + seconds.to_i - new.strftime('%Y-%m-%dT%H:%M:%SZ') + def duration_to_time(seconds) + Time.now.utc + seconds.to_i end end end From c32fc25ea8fcfded077dce8f5593bec2765dfbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:09:52 +0200 Subject: [PATCH 25/83] Document phase 2 changes and bump version to 1.8.0 Changelog gains the 1.8.0 section (deletions, bug fixes, deprecated AWS attrs). README drops the AWS IAM settings from the usage example and explains the deprecation. Note for consumers: active_cart and active_fulfillment pin '~> 1.7.0' in their gemspecs and must bump it to pick this release up. --- CHANGELOG.md | 51 ++++++++++++++++++++++++++++++-- CLAUDE.md | 20 +++++++------ README.md | 15 ++++++---- lib/amazon_sp_clients/version.rb | 2 +- 4 files changed, 69 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fba935b..d509478 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. -## [Unreleased] +## [1.8.0] - 2026-09-01 ### Added @@ -29,11 +29,56 @@ considered breaking and do not trigger a major version bump. new `Generated by:` header, and the unused commented-out model requires are gone from the vendor entry files. - `codegen-config.yml` now lists only the 14 API modules that have - consumers. The other 17 vendored modules stay in the repo for now - and will be deleted in a later cleanup. + consumers. + +### Deprecated + +- The AWS IAM configuration settings `access_key`, `secret_key`, + `role_arn`, and `credentials_provider`. Amazon dropped the SigV4 + signing requirement in October 2023. The setters are accepted and + ignored; they will be removed in 2.0. + +### Fixed + +- Grantless sessions re-authenticate after their token expires + (a typo'd variable made `refresh` a no-op for them). +- POST, PUT, and PATCH requests keep their query params. They were + silently dropped before, which broke 21 operations, including + `put_listings_item` and `patch_listings_item`. +- Per-operation header params (such as `Accept`) are sent. +- Raised errors no longer carry secrets: auth headers are filtered + from the exception payload, and the token service's request body + (client secret, refresh token) is filtered too. +- `config.endpoint = 'zz'` raises a clear `ArgumentError` instead of + `KeyError: key not found: nil`. +- A string-keyed response hash no longer turns `ApiResponse#payload` + into nil. +- `MARKETPLACE_IDS` includes Saudi Arabia (`sa`), matching + `MARKETPLACE_ENDPOINT_MAP`. +- `config.timeout` now applies to every connection (token exchange, + feed upload, report download). Only the API client honored it + before; the rest could hang forever. ### Removed +- AWS SigV4 request signing and the STS AssumeRole call, with the + `aws-sdk-core` and `aws-sigv4` dependencies. `new_session` no + longer makes a synchronous AWS network call, and + `Session#role_credentials` / `Session#credentials_provider` are + gone. +- The 17 vendored API modules with no consumers (catalog_items_2020, + catalog_items_v0, fba_inbound, fulfillment_inbound_v0, + merchant_fulfillment_v0, messaging, notifications, product_fees_v0, + product_pricing_v0, sales, sellers, services, shipping, + solicitations, uploads_2020, vdf_payments_v1, vdf_transactions_v1) + and their require shims. +- The generated per-module scaffolding under `vendor/`: models + (1,037 files nothing required), per-module api_client / + configuration / api_error / version copies, and gem boilerplate. + Each vendor module now holds only its entry file and API classes. +- Dead code: `ServiceError`, `Configuration#basic_auth_token`, the + inert `host=` writer, and typhoeus-era configuration attrs + (`verify_ssl`, `cert_file`, `params_encoding`, and friends). - Travis CI config, `.ruby-gemset`, and the broken `.gitmodules`. - The swagger-codegen mustache templates (`codegen-templates/`) and the old `codegen:generate` / `codegen:clean` rake tasks. diff --git a/CLAUDE.md b/CLAUDE.md index 5601d76..42eedeb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -21,18 +21,20 @@ clients: hand-written core code plus generated output. - `../amazon_sp_clients.rb` — entry point. Region and marketplace id constants, `configure`, `new_session`, feed upload/download helpers. - `configuration.rb` — global config (credentials, region, host, sandbox, - logger). `Configuration.default` is per-thread. -- `session.rb` — auth. Exchanges refresh token for an access token, gets - STS role credentials, and gets restricted data tokens (RDT) for PII - calls. `RESTRICTED_OPS` holds the common RDT resource lists. + logger). `Configuration.default` is per-thread. The AWS IAM attrs + (`access_key`, `secret_key`, `role_arn`, `credentials_provider`) are + deprecated no-ops kept for consumers; removed in 2.0. +- `session.rb` — auth. Exchanges refresh token for an access token and + gets restricted data tokens (RDT) for PII calls. `RESTRICTED_OPS` + holds the common RDT resource lists. - `api_client.rb` — Faraday connection used by every generated API class. - Adds signing, error middleware, tokens, and deserialization. + Adds error middleware, tokens, and deserialization. - `api_response.rb` — wraps the response into `payload` / `errors` / `pagination`. Payload is a Hash with symbol keys. - `api_error.rb`, `uploader.rb` (feed upload + report download), `token_exchange_auth.rb` (LWA token request). -- `middlewares/request_signer_v4.rb` — AWS SigV4 signing. -- `middlewares/raise_error.rb` — turns HTTP 4xx/5xx into Faraday errors. +- `middlewares/raise_error.rb` — turns HTTP 4xx/5xx into Faraday errors + and redacts auth headers from the error payload. - `sp_*.rb` — autogenerated one-line requires that point into `vendor/`. Do not edit; the generator writes them. @@ -45,8 +47,8 @@ The generator emits API classes matching the old swagger-codegen output: - responses default to `AmazonSpClients::ApiResponse`, - `auth_names` is reused to mark restricted (RDT) operations, - only API classes and entry/require files are emitted — no models, no - per-vendor api_client/configuration (leftovers under `vendor/` from - the old generator are dead code, removed in a later cleanup). + per-vendor api_client/configuration. `vendor//` holds exactly + `lib/sp_.rb` plus `lib/sp_/api/*.rb`, nothing else. To change generated code, change the generator or its templates, run `rake generate`, and review the diff. CI runs `rake generate:verify`, diff --git a/README.md b/README.md index 1f925da..ae65b4f 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ require 'amazon_sp_clients' # you can skip if you use Bundle.setup require 'amazon_sp_clients/sp_orders_v0' # Orders API # ...and others -# in beagle_shipment -require 'amazon_sp_clients/sp_shipping' # Shipping API +# in active_fulfillment +require 'amazon_sp_clients/sp_fba_inventory' # FBA Inventory API # ...and others ``` @@ -34,10 +34,6 @@ require 'amazon_sp_clients/sp_orders_v0' require 'dotenv/load' AmazonSpClients.configure do |c| - c.access_key = ENV['AMZ_ACCESS_KEY_ID'] - c.secret_key = ENV['AMZ_SECRET_ACCESS_KEY'] - c.role_arn = ENV['AMZ_ROLE_ARN'] - c.client_id = ENV['AMZ_CLIENT_ID'] c.client_secret = ENV['AMZ_CLIENT_SECRET'] @@ -54,6 +50,13 @@ get_orders_response = puts get_orders_response.payload # Hash with symbolized keys ``` + +The AWS IAM settings (`access_key`, `secret_key`, `role_arn`, +`credentials_provider`) are deprecated. Amazon dropped the SigV4 +signing requirement in October 2023, so the gem no longer signs +requests or calls STS. The setters still exist but do nothing; they +will be removed in 2.0. + ### Restricted operations (requesting PII data) ```ruby diff --git a/lib/amazon_sp_clients/version.rb b/lib/amazon_sp_clients/version.rb index c55e084..f60a046 100644 --- a/lib/amazon_sp_clients/version.rb +++ b/lib/amazon_sp_clients/version.rb @@ -1,3 +1,3 @@ module AmazonSpClients - VERSION = '1.7.0'.freeze + VERSION = '1.8.0'.freeze end From f0dd8925853bd9b388ffe650b0550b2aac163603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:21:29 +0200 Subject: [PATCH 26/83] Update Gemfile.lock for the 1.8.0 bump The version bump commit changed the gemspec without re-locking, so CI's frozen-mode bundle install failed with 'the gemspecs for path gems changed'. Re-locking also floats multi_xml to 0.9.1 (its bigdecimal bound widened); the suite is green with it. --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 30b6212..ebfc0c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - amazon_sp_clients (1.7.0) + amazon_sp_clients (1.8.0) faraday (~> 1.4) faraday_middleware httpclient @@ -50,8 +50,8 @@ GEM json (2.21.2) language_server-protocol (3.17.0.5) lint_roller (1.1.0) - multi_xml (0.7.1) - bigdecimal (~> 3.1) + multi_xml (0.9.1) + bigdecimal (>= 3.1, < 5) multipart-post (2.4.1) mutex_m (0.3.0) parallel (2.0.1) From b74f305cf2d478bf4f671656cc3d1cd2c3d2cafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:29:20 +0200 Subject: [PATCH 27/83] Harden error payload redaction Follow-ups to the redaction commit, from review: - Redact on a Faraday::Utils::Headers copy instead of converting to a plain Hash, so header lookup in the error payload stays case-insensitive as before. - Strip the query string from uploads-service urls in the payload. Those are presigned S3 urls whose query string is a live, time-limited credential; it leaked into consumer logs on any S3 error. The path stays for debugging; spapi urls keep their query. - Pin that non-sensitive request headers survive redaction. --- .../middlewares/raise_error.rb | 17 +++++++-- .../middlewares/raise_error_spec.rb | 35 +++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index b2e53a5..9f28f86 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -125,7 +125,7 @@ def response_values(env) request: { method: env.method, url_path: env.url.path, - url: env.url, + url: redacted_url(env), params: env.params, headers: redacted_request_headers(env.request_headers), body: redacted_request_body(env) @@ -135,10 +135,21 @@ def response_values(env) private + # Returns a copy that keeps Faraday's case-insensitive lookup. def redacted_request_headers(headers) - (headers || {}).to_hash.to_h do |key, value| - SENSITIVE_HEADERS.include?(key.downcase) ? [key, FILTERED] : [key, value] + redacted = Faraday::Utils::Headers.new(headers || {}) + SENSITIVE_HEADERS.each do |name| + redacted[name] = FILTERED unless redacted[name].nil? end + redacted + end + + # Presigned S3 urls (uploads service) carry their credential in + # the query string. + def redacted_url(env) + return env.url unless @service == :uploads + + env.url.dup.tap { |url| url.query = nil } end # The LWA token request body carries client_secret and diff --git a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb index 875079f..e893fd7 100644 --- a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb +++ b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb @@ -180,6 +180,41 @@ def rescued_error expect(headers['x-amz-security-token']).to eq('[FILTERED]') end + it 'keeps other request headers readable in any case' do + stub_request(:get, "#{base_url}/orders").to_return(status: 400, body: '') + + err = + rescued_error do + conn(:spapi).get('/orders') { |req| req.headers['X-Custom'] = 'kept' } + end + + headers = err.response[:request][:headers] + expect(headers['X-Custom']).to eq('kept') + expect(headers['x-custom']).to eq('kept') + end + + # Presigned S3 URLs carry their credential in the query string. + it 'strips the query string from upload service urls' do + stub_request(:get, "#{base_url}/doc") + .with(query: { 'X-Amz-Signature' => 'SECRET' }) + .to_return(status: 400, body: '') + + err = rescued_error { conn(:uploads).get('/doc?X-Amz-Signature=SECRET') } + + expect(err.response[:request][:url].to_s).not_to include('SECRET') + expect(err.response[:request][:url_path]).to eq('/doc') + end + + it 'keeps the query string for spapi urls' do + stub_request(:get, "#{base_url}/orders") + .with(query: { 'MarketplaceIds' => 'ATVPDKIKX0DER' }) + .to_return(status: 400, body: '') + + err = rescued_error { conn(:spapi).get('/orders?MarketplaceIds=ATVPDKIKX0DER') } + + expect(err.response[:request][:url].to_s).to include('MarketplaceIds') + end + it 'filters the request body of token errors' do stub_request(:post, "#{base_url}/auth/o2/token") .to_return(status: 400, body: fixture('token_error.json')) From 9ea4d6692a8b22e86abc943cf064ed4fb72da6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:30:07 +0200 Subject: [PATCH 28/83] Validate marketplace id before mutating config set_endpoint_by_marketplace_id assigned @marketplace_id before the fetch that validates it, so an unknown id raised KeyError but left the config holding the bogus id. Look the endpoint up first. --- lib/amazon_sp_clients/configuration.rb | 5 ++++- spec/amazon_sp_clients/configuration_spec.rb | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index 018b2d8..ecb310d 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -122,8 +122,11 @@ def disable_sandbox! end def set_endpoint_by_marketplace_id(marketplace_id) + # Validate before assigning so a bad id cannot corrupt state. + endpoint = AmazonSpClients::MARKETPLACE_ENDPOINT_MAP.fetch(marketplace_id) + @marketplace_id = marketplace_id - self.endpoint = AmazonSpClients::MARKETPLACE_ENDPOINT_MAP.fetch(marketplace_id) + self.endpoint = endpoint end def endpoint=(str) diff --git a/spec/amazon_sp_clients/configuration_spec.rb b/spec/amazon_sp_clients/configuration_spec.rb index a9093e6..c7e66cd 100644 --- a/spec/amazon_sp_clients/configuration_spec.rb +++ b/spec/amazon_sp_clients/configuration_spec.rb @@ -107,6 +107,17 @@ expect(config.region).to eq('us-west-2') expect(config.host).to eq('sellingpartnerapi-fe.amazon.com') end + + it 'keeps its state on an unknown marketplace id' do + config.set_endpoint_by_marketplace_id('ATVPDKIKX0DER') + + expect { config.set_endpoint_by_marketplace_id('BOGUS') } + .to raise_error(KeyError) + + expect(config.marketplace_id).to eq('ATVPDKIKX0DER') + expect(config.endpoint).to eq('na') + expect(config.region).to eq('us-east-1') + end end describe '#endpoint=' do From e011f247e8b20c2cde1299b39f0ac617f1a9b6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:30:33 +0200 Subject: [PATCH 29/83] Pin the deprecated AWS config writers active_cart and active_fulfillment set access_key, secret_key, role_arn, and credentials_provider unconditionally at boot. Nothing in the suite exercised the writers after the SigV4 removal, so a future cleanup could delete them with a green build and break every consumer. This spec keeps them writable and inert until 2.0. --- spec/amazon_sp_clients/configuration_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/amazon_sp_clients/configuration_spec.rb b/spec/amazon_sp_clients/configuration_spec.rb index c7e66cd..0811a73 100644 --- a/spec/amazon_sp_clients/configuration_spec.rb +++ b/spec/amazon_sp_clients/configuration_spec.rb @@ -171,6 +171,21 @@ end end + # Consumers still set these at boot. They must stay writable (and + # inert) until 2.0, or every cart raises NoMethodError on upgrade. + describe 'deprecated AWS attrs' do + it 'accepts writes without any effect' do + config.access_key = 'AK' + config.secret_key = 'SK' + config.role_arn = 'arn:aws:iam::1:role/x' + config.credentials_provider = Object.new + + expect(config.access_key).to eq('AK') + expect(config.region).to eq('us-east-1') + expect(config.host).to eq('sellingpartnerapi-na.amazon.com') + end + end + describe '#scheme=' do it 'strips "://"' do config.scheme = 'http://' From 04715bee53bc441ef6b2100b0be90ae952672eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 13:35:00 +0200 Subject: [PATCH 30/83] Remove debug gated logging --- lib/amazon_sp_clients.rb | 1 - lib/amazon_sp_clients/api_client.rb | 7 ------- lib/amazon_sp_clients/configuration.rb | 17 ++--------------- lib/amazon_sp_clients/session.rb | 16 ++-------------- lib/amazon_sp_clients/token_exchange_auth.rb | 7 ------- lib/amazon_sp_clients/uploader.rb | 2 -- 6 files changed, 4 insertions(+), 46 deletions(-) diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index e17d9b8..40502b1 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -112,7 +112,6 @@ def self.download_report_document(doc_params) conn = Faraday.new(request: { timeout: configure.timeout }) do |c| c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } - c.response :logger, configure.logger, {} end conn.get(url)&.body diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 7e83387..493f8d3 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -80,10 +80,6 @@ def call_api(http_method, path, opts = {}) ) end - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - # Skipping error check and raise (use middleware for that instead) (deserialize(response, opts[:return_type]) if opts[:return_type]) @@ -115,9 +111,6 @@ def build_request(http_method, path, opts = {}) if %i[post patch put delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update body: req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end end [url, req_opts] diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index ecb310d..3b463bd 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'logger' - module AmazonSpClients class Configuration # SP specific @@ -28,17 +26,9 @@ class Configuration # Defines url base path attr_accessor :base_path - # Set this to enable/disable debugging. When enabled (set to true), HTTP - # request/response details will be logged with `logger.debug` (see the - # `logger` attribute). Default to false. - # - # @return [true, false] + # Deprecated: the gem no longer logs. Accepted and ignored since 1.8.0; + # they will be removed in 2.0. attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] attr_accessor :logger # The time limit for HTTP request in seconds. @@ -72,9 +62,6 @@ def initialize @base_path = '/' @timeout = 60 @client_side_validation = true - @debugging = false - @logger = Logger.new(STDOUT) - @logger.level = 1 yield(self) if block_given? end diff --git a/lib/amazon_sp_clients/session.rb b/lib/amazon_sp_clients/session.rb index 0acd359..f8b3b92 100644 --- a/lib/amazon_sp_clients/session.rb +++ b/lib/amazon_sp_clients/session.rb @@ -24,7 +24,6 @@ class Session def initialize(config = Configuration.default, &block) @config = config - @logger = @config.logger @refresh_token = nil @access_token = nil @@ -73,17 +72,9 @@ def refresh end def ask_for_restricted_data_token(restricted_resource) - @logger.debug('this request will require restricted data token') if !@restricted_data_token[restricted_resource].nil? && !expired?(@restricted_data_token_expires_at[restricted_resource]) - @logger.debug( - "restricted_data_token for `#{restricted_resource}` is still valid, skipping /tokes20210 request" - ) return - else - @logger.debug( - "restricted_data_token for `#{restricted_resource}` is nil or stale, making /tokens2021 request" - ) end tokens_api = AmazonSpClients::SpTokens2021::TokensApi.new(self) @@ -105,11 +96,8 @@ def ask_for_restricted_data_token(restricted_resource) # Returns nil on success, error struct on error def request_access_token - if @access_token && !expired?(@access_token_expires_at) - @logger.debug('`access_token` is present - skipping token request') - return - end - @logger.debug('`access_token` is nil or expired') + return if @access_token && !expired?(@access_token_expires_at) + resp_struct = exchange_token_request @access_token = resp_struct.access_token @refresh_token = resp_struct.refresh_token diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index 72ddfbb..1142a8b 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -19,8 +19,6 @@ class TokenExchangeAuth def initialize(refresh_token = nil, config = Configuration.default) @refresh_token = refresh_token @config = config - @logger = @config.logger - @debugging = @config.debugging @conn = Faraday.new("https://#{TOKEN_HOST}", request: { timeout: @config.timeout }) do |conn| @@ -73,11 +71,6 @@ def exchange(grant_type = 'refresh_token', scope = nil) body = resp.body body = JSON.parse(body, symbolize_names: true) if body.is_a?(String) - if @debugging == true - @logger.debug "#{self.class.name} response body ~BEGIN~\n#{body}\n~END~\n" - @logger.debug "#{self.class.name} returned success response" - end - AuthResponse.new( body[:access_token], body[:token_type], diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index 9fcd20f..eb79e46 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -15,7 +15,6 @@ def initialize Faraday.new(request: { timeout: config.timeout }) do |c| c.adapter Faraday::Adapter::HTTPClient c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } - c.response :logger, config.logger, {} end end @@ -49,7 +48,6 @@ def initialize(feed_processing_report) @conn = Faraday.new(request: { timeout: @config.timeout }) do |c| c.use AmazonSpClients::Middlewares::RaiseError, { service: :uploads } - c.response :logger, @config.logger, {} end end From d22404e8581559211231e301a11fa09004c8758b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:46:04 +0200 Subject: [PATCH 31/83] Remove unused faraday_middleware dependency Nothing in the gem uses a FaradayMiddleware constant; the three requires were vestigial. The gem also pins faraday to ~> 1.0, which blocks resolving Faraday 2 in any bundle that includes this gem. --- Gemfile.lock | 3 --- amazon_sp_clients.gemspec | 1 - lib/amazon_sp_clients/api_client.rb | 1 - lib/amazon_sp_clients/token_exchange_auth.rb | 1 - lib/amazon_sp_clients/uploader.rb | 1 - 5 files changed, 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ebfc0c7..70c7937 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,6 @@ PATH specs: amazon_sp_clients (1.8.0) faraday (~> 1.4) - faraday_middleware httpclient multi_xml @@ -42,8 +41,6 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.4) - faraday_middleware (1.2.1) - faraday (~> 1.0) hashdiff (1.2.1) httpclient (2.9.0) mutex_m diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 142d240..3fca008 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -31,7 +31,6 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'faraday', '~> 1.4' - spec.add_dependency 'faraday_middleware' spec.add_dependency 'httpclient' spec.add_dependency 'multi_xml' diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 493f8d3..515c116 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -3,7 +3,6 @@ require 'time' require 'json' require 'faraday' -require 'faraday_middleware' module AmazonSpClients class ApiClient diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index 1142a8b..37fd93e 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'faraday' -require 'faraday_middleware' module AmazonSpClients class AuthResponse < Struct.new( diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index eb79e46..752a314 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'faraday' -require 'faraday_middleware' require 'zlib' require 'multi_xml' From d7a6c894fee30409d1f2f61cca79014dd83bb674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:46:50 +0200 Subject: [PATCH 32/83] Port RaiseError to Faraday::Middleware Faraday 2 removed Faraday::Response::Middleware. Faraday::Middleware has the same initialize(app, options) and on_complete(env) contract in 1.10 and 2.x, so one class serves both. Also drop two leftovers: the multi_xml require (unused since the STS XML errors were removed) and the params field in the error payload (env.params is never set by real adapters, so it was always nil). --- lib/amazon_sp_clients/middlewares/raise_error.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index 9f28f86..2b46888 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'faraday' -require 'multi_xml' require 'json' # Based on https://github.com/lostisland/faraday/blob/main/lib/faraday/response/raise_error.rb @@ -9,7 +8,9 @@ module AmazonSpClients module Middlewares # RaiseError is a Faraday middleware that raises exceptions on common HTTP # client or server error responses. - class RaiseError < Faraday::Response::Middleware + # Subclasses Faraday::Middleware (not Faraday::Response::Middleware, + # which Faraday 2 removed) so one class works on Faraday 1.10 and 2.x. + class RaiseError < Faraday::Middleware # rubocop:disable Naming/ConstantName ClientErrorStatuses = (400...500) ServerErrorStatuses = (500...600) @@ -23,8 +24,7 @@ class RaiseError < Faraday::Response::Middleware SENSITIVE_HEADERS = %w[authorization x-amz-access-token x-amz-security-token].freeze def initialize(app, options = {}) - super(app) - @app = app + super @service = options.fetch(:service) raise unless VALID_SERVICE.include?(@service) end @@ -126,7 +126,6 @@ def response_values(env) method: env.method, url_path: env.url.path, url: redacted_url(env), - params: env.params, headers: redacted_request_headers(env.request_headers), body: redacted_request_body(env) } From 423b84debcba0e964a38bcd69b01a1bbd0d42089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:47:33 +0200 Subject: [PATCH 33/83] Allow Faraday 2 Widen the faraday pin to '>= 1.10, < 3' and declare what Faraday 2 stopped bundling: faraday-httpclient (the HTTPClient adapter all write paths use) and faraday-retry (defines Faraday::RetriableResponse, which the middleware raises on 429 and consumers rescue for throttling). Faraday 1 already ships and loads both, so nothing changes there; under Faraday 2 the explicit requires load them. The HTTPClient adapter stays: its body handling is identical across both adapter gem majors, while net_http would break the LWA token POST (Hash body) and the feed upload PUT (StringIO without Content-Length) - failures WebMock cannot catch. --- Gemfile.lock | 4 +++- amazon_sp_clients.gemspec | 4 +++- lib/amazon_sp_clients/api_client.rb | 2 ++ lib/amazon_sp_clients/middlewares/raise_error.rb | 3 +++ lib/amazon_sp_clients/token_exchange_auth.rb | 2 ++ lib/amazon_sp_clients/uploader.rb | 2 ++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 70c7937..e4ef48b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,9 @@ PATH remote: . specs: amazon_sp_clients (1.8.0) - faraday (~> 1.4) + faraday (>= 1.10, < 3) + faraday-httpclient (>= 1.0, < 3) + faraday-retry (>= 1.0, < 3) httpclient multi_xml diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 3fca008..77a3688 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -30,7 +30,9 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'faraday', '~> 1.4' + spec.add_dependency 'faraday', '>= 1.10', '< 3' + spec.add_dependency 'faraday-httpclient', '>= 1.0', '< 3' + spec.add_dependency 'faraday-retry', '>= 1.0', '< 3' spec.add_dependency 'httpclient' spec.add_dependency 'multi_xml' diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 515c116..64601e3 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -3,6 +3,8 @@ require 'time' require 'json' require 'faraday' +# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. +require 'faraday/httpclient' module AmazonSpClients class ApiClient diff --git a/lib/amazon_sp_clients/middlewares/raise_error.rb b/lib/amazon_sp_clients/middlewares/raise_error.rb index 2b46888..001ad7f 100644 --- a/lib/amazon_sp_clients/middlewares/raise_error.rb +++ b/lib/amazon_sp_clients/middlewares/raise_error.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true require 'faraday' +# Faraday::RetriableResponse (raised on 429) lives in the faraday-retry +# gem under Faraday 2; a no-op under Faraday 1, which loads it itself. +require 'faraday/retry' require 'json' # Based on https://github.com/lostisland/faraday/blob/main/lib/faraday/response/raise_error.rb diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index 37fd93e..e27d08a 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require 'faraday' +# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. +require 'faraday/httpclient' module AmazonSpClients class AuthResponse < Struct.new( diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index 752a314..b6da78c 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require 'faraday' +# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. +require 'faraday/httpclient' require 'zlib' require 'multi_xml' From f5b253d692e7043349903f173b2359933d0d6205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:49:37 +0200 Subject: [PATCH 34/83] Run the test suite against Faraday 1 and 2 in CI gemfiles/faraday_1.gemfile and faraday_2.gemfile pin each major; the test job matrix crosses them with Ruby 3.3/3.4 (six jobs total with rubocop and verify-generated, which stay on the root Gemfile). BUNDLE_GEMFILE is job-level so setup-ruby installs and caches per gemfile. The gemfiles/ directory is excluded from the packaged gem and from rubocop. --- .github/workflows/ci.yml | 6 ++ .rubocop.yml | 2 + amazon_sp_clients.gemspec | 2 +- gemfiles/faraday_1.gemfile | 5 + gemfiles/faraday_1.gemfile.lock | 171 ++++++++++++++++++++++++++++++++ gemfiles/faraday_2.gemfile | 5 + gemfiles/faraday_2.gemfile.lock | 154 ++++++++++++++++++++++++++++ 7 files changed, 344 insertions(+), 1 deletion(-) create mode 100644 gemfiles/faraday_1.gemfile create mode 100644 gemfiles/faraday_1.gemfile.lock create mode 100644 gemfiles/faraday_2.gemfile create mode 100644 gemfiles/faraday_2.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea20e9..4f4efdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,15 @@ jobs: test: strategy: + fail-fast: false matrix: ruby: ["3.3", "3.4"] + gemfile: [faraday_1, faraday_2] runs-on: ubuntu-latest + # BUNDLE_GEMFILE must be job-level so setup-ruby installs and + # caches against the matrix gemfile instead of the root Gemfile. + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 diff --git a/.rubocop.yml b/.rubocop.yml index a330006..999b74a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,6 +9,8 @@ AllCops: - amzn-models/**/* - tmp/**/* - bin/**/* + # CI matrix gemfiles, not gem code. + - gemfiles/**/* # Autogenerated require shims; the Rakefile writes them. - lib/amazon_sp_clients/sp_*.rb diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 77a3688..87a8a50 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features|amzn-models)/|^lib/generator}) + f.match(%r{^(test|spec|features|amzn-models|gemfiles)/|^lib/generator}) end end spec.bindir = 'exe' diff --git a/gemfiles/faraday_1.gemfile b/gemfiles/faraday_1.gemfile new file mode 100644 index 0000000..6755b5b --- /dev/null +++ b/gemfiles/faraday_1.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gemspec path: '..' + +gem 'faraday', '~> 1.10' diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock new file mode 100644 index 0000000..dfdda53 --- /dev/null +++ b/gemfiles/faraday_1.gemfile.lock @@ -0,0 +1,171 @@ +PATH + remote: .. + specs: + amazon_sp_clients (1.8.0) + faraday (>= 1.10, < 3) + faraday-httpclient (>= 1.0, < 3) + faraday-retry (>= 1.0, < 3) + httpclient + multi_xml + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + bigdecimal (4.1.2) + crack (1.0.1) + bigdecimal + rexml + diff-lcs (1.6.2) + dotenv (3.2.0) + faraday (1.10.6) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.1) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.4) + hashdiff (1.2.1) + httpclient (2.9.0) + mutex_m + json (2.21.2) + language_server-protocol (3.17.0.6) + lint_roller (1.1.0) + multi_xml (0.9.1) + bigdecimal (>= 3.1, < 5) + multipart-post (2.4.1) + mutex_m (0.3.0) + parallel (2.1.0) + parser (3.3.12.0) + ast (~> 2.4.1) + racc + prism (1.9.0) + public_suffix (7.0.5) + racc (1.8.1) + rainbow (3.1.1) + rake (13.4.2) + regexp_parser (2.12.0) + rexml (3.4.4) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + rubocop (1.90.0) + json (>= 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.50.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + timecop (0.9.11) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + webmock (3.26.4) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + amazon_sp_clients! + dotenv + faraday (~> 1.10) + rake + rspec + rubocop (~> 1.86) + timecop + webmock + +CHECKSUMS + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + amazon_sp_clients (1.8.0) + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 + crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e + diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962 + dotenv (3.2.0) sha256=e375b83121ea7ca4ce20f214740076129ab8514cd81378161f11c03853fe619d + faraday (1.10.6) sha256=7ff4802a6b312876a2241b3e641ce0d5045e168dd871b422c35b505e5261ad4d + faraday-em_http (1.0.0) sha256=7a3d4c7079789121054f57e08cd4ef7e40ad1549b63101f38c7093a9d6c59689 + faraday-em_synchrony (1.0.1) sha256=bf3ce45dcf543088d319ab051f80985ea6d294930635b7a0b966563179f81750 + faraday-excon (1.1.0) sha256=b055c842376734d7f74350fe8611542ae2000c5387348d9ba9708109d6e40940 + faraday-httpclient (1.0.1) sha256=4c8ff1f0973ff835be8d043ef16aaf54f47f25b7578f6d916deee8399a04d33b + faraday-multipart (1.2.0) sha256=7d89a949693714176f612323ca13746a2ded204031a6ba528adee788694ef757 + faraday-net_http (1.0.2) sha256=63992efea42c925a20818cf3c0830947948541fdcf345842755510d266e4c682 + faraday-net_http_persistent (1.2.0) sha256=0b0cbc8f03dab943c3e1cc58d8b7beb142d9df068b39c718cd83e39260348335 + faraday-patron (1.0.0) sha256=dc2cd7b340bb3cc8e36bcb9e6e7eff43d134b6d526d5f3429c7a7680ddd38fa7 + faraday-rack (1.0.0) sha256=ef60ec969a2bb95b8dbf24400155aee64a00fc8ba6c6a4d3968562bcc92328c0 + faraday-retry (1.0.4) sha256=dc659233777fabf96c69c2ffe56c0a5d2c102af90321a42cc6c90157bcd716aa + hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1 + httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8 + json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a + language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + multi_xml (0.9.1) sha256=7ce766b59c17241ed62976caeae1fae9b2431b263398c35396239a68c4a64e57 + multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8 + mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751 + parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356 + parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587 + rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d + rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836 + rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47 + rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c + rubocop (1.90.0) sha256=9eb4c065b5c5154e4ef554c547972f3905a9eb6b53e657e580b6796b54bf8242 + rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef + timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 + unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 + unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f + webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d + +BUNDLED WITH + 4.0.11 diff --git a/gemfiles/faraday_2.gemfile b/gemfiles/faraday_2.gemfile new file mode 100644 index 0000000..57fe72d --- /dev/null +++ b/gemfiles/faraday_2.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gemspec path: '..' + +gem 'faraday', '~> 2.0' diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock new file mode 100644 index 0000000..1dbfa4e --- /dev/null +++ b/gemfiles/faraday_2.gemfile.lock @@ -0,0 +1,154 @@ +PATH + remote: .. + specs: + amazon_sp_clients (1.8.0) + faraday (>= 1.10, < 3) + faraday-httpclient (>= 1.0, < 3) + faraday-retry (>= 1.0, < 3) + httpclient + multi_xml + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + bigdecimal (4.1.2) + crack (1.0.1) + bigdecimal + rexml + diff-lcs (1.6.2) + dotenv (3.2.0) + faraday (2.14.3) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-httpclient (2.0.2) + httpclient (>= 2.2) + faraday-net_http (3.4.4) + net-http (~> 0.5) + faraday-retry (2.4.0) + faraday (~> 2.0) + hashdiff (1.2.1) + httpclient (2.9.0) + mutex_m + json (2.21.2) + language_server-protocol (3.17.0.6) + lint_roller (1.1.0) + logger (1.7.0) + multi_xml (0.9.1) + bigdecimal (>= 3.1, < 5) + mutex_m (0.3.0) + net-http (0.9.1) + uri (>= 0.11.1) + parallel (2.1.0) + parser (3.3.12.0) + ast (~> 2.4.1) + racc + prism (1.9.0) + public_suffix (7.0.5) + racc (1.8.1) + rainbow (3.1.1) + rake (13.4.2) + regexp_parser (2.12.0) + rexml (3.4.4) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + rubocop (1.90.0) + json (>= 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.50.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + ruby-progressbar (1.13.0) + timecop (0.9.11) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + webmock (3.26.4) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + amazon_sp_clients! + dotenv + faraday (~> 2.0) + rake + rspec + rubocop (~> 1.86) + timecop + webmock + +CHECKSUMS + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + amazon_sp_clients (1.8.0) + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 + crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e + diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962 + dotenv (3.2.0) sha256=e375b83121ea7ca4ce20f214740076129ab8514cd81378161f11c03853fe619d + faraday (2.14.3) sha256=1882247e6766615c8220b4392bf1d27f6ebb63d8e28267587cef1fb0bf37f278 + faraday-httpclient (2.0.2) sha256=d95fbe60cce5a87e157957d67c539a4c22fb8b0b0611d493a939cdde19d8d67c + faraday-net_http (3.4.4) sha256=0e78af151747ed1b00f33e25973b4bc220d7f16c00c39676817c8b12331eb588 + faraday-retry (2.4.0) sha256=7b79c48fb7e56526faf247b12d94a680071ff40c9fda7cf1ec1549439ad11ebe + hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1 + httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8 + json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a + language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 + multi_xml (0.9.1) sha256=7ce766b59c17241ed62976caeae1fae9b2431b263398c35396239a68c4a64e57 + mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751 + net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996 + parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356 + parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587 + rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d + rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836 + rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47 + rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c + rubocop (1.90.0) sha256=9eb4c065b5c5154e4ef554c547972f3905a9eb6b53e657e580b6796b54bf8242 + rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 + unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 + unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f + uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 + webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d + +BUNDLED WITH + 4.0.11 From 25b923edc670764f8b6f3e6cd2d3d6abe69b546b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:52:24 +0200 Subject: [PATCH 35/83] Document Faraday 2 support and bump version to 1.9.0 All three lockfiles re-locked for the bump. The root Gemfile gains a dev-time faraday ~> 1.10.0 pin so the root lock stays on Faraday 1, which is what every consumer runs today; CI covers both majors via gemfiles/. --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ Gemfile | 4 ++++ Gemfile.lock | 3 ++- README.md | 8 ++++++++ gemfiles/faraday_1.gemfile.lock | 4 ++-- gemfiles/faraday_2.gemfile.lock | 4 ++-- lib/amazon_sp_clients/version.rb | 2 +- 7 files changed, 45 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d509478..d9d712d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,32 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. +## [1.9.0] - 2026-09-01 + +### Added + +- Faraday 2 support. The gem now runs on Faraday 1.10 and Faraday 2; + CI tests the suite against both majors on Ruby 3.3 and 3.4. + +### Changed + +- The `faraday` dependency is `>= 1.10, < 3` (was `~> 1.4`). +- New dependencies `faraday-httpclient` and `faraday-retry`. Faraday 1 + already ships both, so nothing changes there. Faraday 2 stopped + bundling them: the first provides the HTTPClient adapter the gem + uses, the second defines `Faraday::RetriableResponse`, which the + error middleware raises on HTTP 429 and consumers rescue for + throttling. + +### Removed + +- The unused `faraday_middleware` dependency. It pinned + `faraday ~> 1.0`, which blocked Faraday 2 in any bundle with this + gem. +- The `params` field in error payloads (`error.response[:request]`). + Real adapters never fill it, so it was always `nil`. Error classes + and messages are unchanged. + ## [1.8.0] - 2026-09-01 ### Added diff --git a/Gemfile b/Gemfile index 7d0b135..97f56a3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,7 @@ source 'https://rubygems.org' # Specify your gem's dependencies in amazon_sp_clients.gemspec gemspec + +# Dev-time pin only: keep the root lock on Faraday 1, which is what +# every consumer runs today. CI tests both majors via gemfiles/. +gem 'faraday', '~> 1.10.0' diff --git a/Gemfile.lock b/Gemfile.lock index e4ef48b..eea8040 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - amazon_sp_clients (1.8.0) + amazon_sp_clients (1.9.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -108,6 +108,7 @@ PLATFORMS DEPENDENCIES amazon_sp_clients! dotenv + faraday (~> 1.10.0) rake rspec rubocop (~> 1.86) diff --git a/README.md b/README.md index ae65b4f..fdc1a24 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,14 @@ require 'amazon_sp_clients/sp_fba_inventory' # FBA Inventory API Generally the you should look for files with `sp_` prefix inside `lib` dir. +### Faraday + +The gem works with Faraday 1.10 and Faraday 2; CI runs the suite +against both. One note for apps that pin `faraday-httpclient` +themselves: version 1.0.1 of that adapter gem cannot load under +Faraday 2, so let Bundler pick it (Faraday 1 needs 1.x, Faraday 2 +needs 2.x). + ## Usage Example ```ruby diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index dfdda53..e4fe02c 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (1.8.0) + amazon_sp_clients (1.9.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -118,7 +118,7 @@ DEPENDENCIES CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (1.8.0) + amazon_sp_clients (1.9.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index 1dbfa4e..9993bb2 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (1.8.0) + amazon_sp_clients (1.9.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -107,7 +107,7 @@ DEPENDENCIES CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (1.8.0) + amazon_sp_clients (1.9.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 diff --git a/lib/amazon_sp_clients/version.rb b/lib/amazon_sp_clients/version.rb index f60a046..d6ead8d 100644 --- a/lib/amazon_sp_clients/version.rb +++ b/lib/amazon_sp_clients/version.rb @@ -1,3 +1,3 @@ module AmazonSpClients - VERSION = '1.8.0'.freeze + VERSION = '1.9.0'.freeze end From b79aa33250632729676d702daafd1e72a72c5d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 18:18:12 +0200 Subject: [PATCH 36/83] Fail clearly on Faraday 2 with a stale adapter Bundler can pair Faraday 2 with faraday-httpclient 1.x: the adapter gem has no runtime dependency on faraday, so a stale lock entry survives a conservative update. That pair used to crash at require time with a cryptic NoMethodError. Move the adapter require into AdapterLoader, which rescues that failure and raises a LoadError naming the exact bundle command that fixes the lock. Verified against a real mixed-major bundle. --- lib/amazon_sp_clients/adapter_loader.rb | 28 +++++++++++++++ lib/amazon_sp_clients/api_client.rb | 3 +- lib/amazon_sp_clients/token_exchange_auth.rb | 3 +- lib/amazon_sp_clients/uploader.rb | 3 +- spec/amazon_sp_clients/adapter_loader_spec.rb | 34 +++++++++++++++++++ 5 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 lib/amazon_sp_clients/adapter_loader.rb create mode 100644 spec/amazon_sp_clients/adapter_loader_spec.rb diff --git a/lib/amazon_sp_clients/adapter_loader.rb b/lib/amazon_sp_clients/adapter_loader.rb new file mode 100644 index 0000000..827c598 --- /dev/null +++ b/lib/amazon_sp_clients/adapter_loader.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'faraday' + +module AmazonSpClients + # Loads the HTTPClient Faraday adapter (Faraday 2 no longer auto-loads + # adapter gems; a no-op under Faraday 1). + # + # Bundler can pair Faraday 2 with faraday-httpclient 1.x — that adapter + # gem has no runtime dependency on faraday, so a stale lock entry + # survives a `bundle update faraday`. The pair fails at require time + # with a cryptic NoMethodError; turn it into a message that names the + # fix. + module AdapterLoader + FIX_CMD = 'bundle update faraday faraday-httpclient faraday-retry' + + def self.require_adapter! + require 'faraday/httpclient' + rescue NoMethodError + version = Gem.loaded_specs['faraday-httpclient']&.version + raise LoadError, + "faraday-httpclient #{version} cannot load under " \ + "Faraday #{Faraday::VERSION}. Run: #{FIX_CMD}" + end + end +end + +AmazonSpClients::AdapterLoader.require_adapter! diff --git a/lib/amazon_sp_clients/api_client.rb b/lib/amazon_sp_clients/api_client.rb index 64601e3..669316d 100644 --- a/lib/amazon_sp_clients/api_client.rb +++ b/lib/amazon_sp_clients/api_client.rb @@ -3,8 +3,7 @@ require 'time' require 'json' require 'faraday' -# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. -require 'faraday/httpclient' +require 'amazon_sp_clients/adapter_loader' module AmazonSpClients class ApiClient diff --git a/lib/amazon_sp_clients/token_exchange_auth.rb b/lib/amazon_sp_clients/token_exchange_auth.rb index e27d08a..7048b6b 100644 --- a/lib/amazon_sp_clients/token_exchange_auth.rb +++ b/lib/amazon_sp_clients/token_exchange_auth.rb @@ -1,8 +1,7 @@ # frozen_string_literal: true require 'faraday' -# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. -require 'faraday/httpclient' +require 'amazon_sp_clients/adapter_loader' module AmazonSpClients class AuthResponse < Struct.new( diff --git a/lib/amazon_sp_clients/uploader.rb b/lib/amazon_sp_clients/uploader.rb index b6da78c..f43db9a 100644 --- a/lib/amazon_sp_clients/uploader.rb +++ b/lib/amazon_sp_clients/uploader.rb @@ -1,8 +1,7 @@ # frozen_string_literal: true require 'faraday' -# Faraday 2 no longer auto-loads adapter gems; a no-op under Faraday 1. -require 'faraday/httpclient' +require 'amazon_sp_clients/adapter_loader' require 'zlib' require 'multi_xml' diff --git a/spec/amazon_sp_clients/adapter_loader_spec.rb b/spec/amazon_sp_clients/adapter_loader_spec.rb new file mode 100644 index 0000000..4084da7 --- /dev/null +++ b/spec/amazon_sp_clients/adapter_loader_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe AmazonSpClients::AdapterLoader do + describe '.require_adapter!' do + it 'loads the adapter without error' do + expect { described_class.require_adapter! }.not_to raise_error + end + + context 'when the adapter cannot load under this Faraday' do + before do + # faraday-httpclient 1.x under Faraday 2 fails inside the require + # with NoMethodError (Faraday 1's `dependency` DSL is gone). + allow(described_class).to receive(:require) + .with('faraday/httpclient') + .and_raise(NoMethodError, "undefined method 'dependency'") + end + + it 'raises LoadError naming the fix command' do + expect { described_class.require_adapter! }.to raise_error( + LoadError, + /bundle update faraday faraday-httpclient faraday-retry/ + ) + end + + it 'names both gem versions in the message' do + expect { described_class.require_adapter! }.to raise_error( + LoadError, /faraday-httpclient .* under Faraday #{Faraday::VERSION}/ + ) + end + end + end +end From 1c2b5b2826b682ac78c9a788d65919244af92f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Tue, 1 Sep 2026 18:18:38 +0200 Subject: [PATCH 37/83] Correct the Faraday 2 upgrade note The README said the faraday-httpclient 1.x load failure only hits apps that pin that gem themselves. Reproduced a broader path: any app that bumps its faraday pin and runs a plain bundle install keeps the 1.x adapter in the lock and fails at boot. Document the exact bundle update command instead. --- CHANGELOG.md | 4 ++++ README.md | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d712d..0c153cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ considered breaking and do not trigger a major version bump. - Faraday 2 support. The gem now runs on Faraday 1.10 and Faraday 2; CI tests the suite against both majors on Ruby 3.3 and 3.4. +- A clear `LoadError` at boot when the bundle pairs Faraday 2 with + faraday-httpclient 1.x. A stale lock can produce this pair, since + that adapter gem has no runtime dependency on faraday. The message + names the `bundle update` command that fixes the lock. ### Changed diff --git a/README.md b/README.md index fdc1a24..4d37115 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,19 @@ Generally the you should look for files with `sp_` prefix inside `lib` dir. ### Faraday The gem works with Faraday 1.10 and Faraday 2; CI runs the suite -against both. One note for apps that pin `faraday-httpclient` -themselves: version 1.0.1 of that adapter gem cannot load under -Faraday 2, so let Bundler pick it (Faraday 1 needs 1.x, Faraday 2 -needs 2.x). +against both. + +When you move an app from Faraday 1 to Faraday 2, run: + +```sh +bundle update faraday faraday-httpclient faraday-retry +``` + +A plain `bundle install` after changing the `faraday` pin is not +enough. The lock keeps `faraday-httpclient` 1.x, which cannot load +under Faraday 2 (it has no runtime dependency on faraday, so nothing +forces the 2.x adapter). The gem detects this pair at boot and raises +a `LoadError` with the command above. ## Usage Example From 342411bae5c296d5b2c1ac2ece54a493c9e1db30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:45:22 +0200 Subject: [PATCH 38/83] Move marketplace tables to their own file The region and marketplace constants lived in the gem entry file, so nothing could use them without loading all of v1. The V2 namespace needs them on their own. Same constants, same values; the entry file requires the new file, so v1 callers see no change. --- lib/amazon_sp_clients.rb | 60 +------------------- lib/amazon_sp_clients/marketplaces.rb | 63 +++++++++++++++++++++ spec/amazon_sp_clients/marketplaces_spec.rb | 26 +++++++++ 3 files changed, 90 insertions(+), 59 deletions(-) create mode 100644 lib/amazon_sp_clients/marketplaces.rb create mode 100644 spec/amazon_sp_clients/marketplaces_spec.rb diff --git a/lib/amazon_sp_clients.rb b/lib/amazon_sp_clients.rb index 40502b1..5a23def 100644 --- a/lib/amazon_sp_clients.rb +++ b/lib/amazon_sp_clients.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'amazon_sp_clients/version' +require 'amazon_sp_clients/marketplaces' require 'amazon_sp_clients/middlewares/raise_error' @@ -18,65 +19,6 @@ require 'httpclient' module AmazonSpClients - REGION_FE = 'us-west-2' - REGION_EU = 'eu-west-1' - REGION_NA = 'us-east-1' - - REGIONS = { - REGION_NA => 'sellingpartnerapi-na.amazon.com', - REGION_EU => 'sellingpartnerapi-eu.amazon.com', - REGION_FE => 'sellingpartnerapi-fe.amazon.com' - }.freeze - - MARKETPLACE_IDS = { - # NA - us: 'ATVPDKIKX0DER', - ca: 'A2EUQ1WTGCTBG2', - mx: 'A1AM78C64UM0Y8', - br: 'A2Q3Y263D00KWC', - # EU - es: 'A1RKKUPIHCS9HS', - gb: 'A1F83G8C2ARO7P', - fr: 'A13V1IB3VIYZZH', - nl: 'A1805IZSGTT6HS', - de: 'A1PA6795UKMFR9', - it: 'APJ6JRA9NG5V4', - se: 'A2NODRKZP88ZB9', - pl: 'A1C3SOZRARQ6R3', - eg: 'ARBP9OOSHTCHU', - tr: 'A33AVAJ2PDY3EV', - sa: 'A17E79C6D8DWNP', - ae: 'A2VIGQ35RCS4UG', - in: 'A21TJRUUN4KGV', - # FE - sg: 'A19VAU5U5O7RUS', - au: 'A39IBJ37TRP1C6', - jp: 'A1VC38T7YXB528' - }.freeze - - MARKETPLACE_ENDPOINT_MAP = { - 'A2EUQ1WTGCTBG2' => 'na', - 'ATVPDKIKX0DER' => 'na', - 'A1AM78C64UM0Y8' => 'na', - 'A2Q3Y263D00KWC' => 'na', - 'A1RKKUPIHCS9HS' => 'eu', - 'A1F83G8C2ARO7P' => 'eu', - 'A13V1IB3VIYZZH' => 'eu', - 'A1805IZSGTT6HS' => 'eu', - 'A1PA6795UKMFR9' => 'eu', - 'APJ6JRA9NG5V4' => 'eu', - 'A2NODRKZP88ZB9' => 'eu', - 'A1C3SOZRARQ6R3' => 'eu', - 'ARBP9OOSHTCHU' => 'eu', - 'A33AVAJ2PDY3EV' => 'eu', - 'A17E79C6D8DWNP' => 'eu', - 'A2VIGQ35RCS4UG' => 'eu', - 'A21TJRUUN4KGV' => 'eu', - 'A19VAU5U5O7RUS' => 'fe', - 'A39IBJ37TRP1C6' => 'fe', - 'A1VC38T7YXB528' => 'fe' - }.freeze - # Normal calls def self.new_session(refresh_token) AmazonSpClients::Session.new.authenticate(refresh_token) diff --git a/lib/amazon_sp_clients/marketplaces.rb b/lib/amazon_sp_clients/marketplaces.rb new file mode 100644 index 0000000..47a148b --- /dev/null +++ b/lib/amazon_sp_clients/marketplaces.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Region and marketplace tables. Shared by v1 and V2; depends on nothing. +module AmazonSpClients + REGION_FE = 'us-west-2' + REGION_EU = 'eu-west-1' + REGION_NA = 'us-east-1' + + REGIONS = { + REGION_NA => 'sellingpartnerapi-na.amazon.com', + REGION_EU => 'sellingpartnerapi-eu.amazon.com', + REGION_FE => 'sellingpartnerapi-fe.amazon.com' + }.freeze + + MARKETPLACE_IDS = { + # NA + us: 'ATVPDKIKX0DER', + ca: 'A2EUQ1WTGCTBG2', + mx: 'A1AM78C64UM0Y8', + br: 'A2Q3Y263D00KWC', + # EU + es: 'A1RKKUPIHCS9HS', + gb: 'A1F83G8C2ARO7P', + fr: 'A13V1IB3VIYZZH', + nl: 'A1805IZSGTT6HS', + de: 'A1PA6795UKMFR9', + it: 'APJ6JRA9NG5V4', + se: 'A2NODRKZP88ZB9', + pl: 'A1C3SOZRARQ6R3', + eg: 'ARBP9OOSHTCHU', + tr: 'A33AVAJ2PDY3EV', + sa: 'A17E79C6D8DWNP', + ae: 'A2VIGQ35RCS4UG', + in: 'A21TJRUUN4KGV', + # FE + sg: 'A19VAU5U5O7RUS', + au: 'A39IBJ37TRP1C6', + jp: 'A1VC38T7YXB528' + }.freeze + + MARKETPLACE_ENDPOINT_MAP = { + 'A2EUQ1WTGCTBG2' => 'na', + 'ATVPDKIKX0DER' => 'na', + 'A1AM78C64UM0Y8' => 'na', + 'A2Q3Y263D00KWC' => 'na', + 'A1RKKUPIHCS9HS' => 'eu', + 'A1F83G8C2ARO7P' => 'eu', + 'A13V1IB3VIYZZH' => 'eu', + 'A1805IZSGTT6HS' => 'eu', + 'A1PA6795UKMFR9' => 'eu', + 'APJ6JRA9NG5V4' => 'eu', + 'A2NODRKZP88ZB9' => 'eu', + 'A1C3SOZRARQ6R3' => 'eu', + 'ARBP9OOSHTCHU' => 'eu', + 'A33AVAJ2PDY3EV' => 'eu', + 'A17E79C6D8DWNP' => 'eu', + 'A2VIGQ35RCS4UG' => 'eu', + 'A21TJRUUN4KGV' => 'eu', + 'A19VAU5U5O7RUS' => 'fe', + 'A39IBJ37TRP1C6' => 'fe', + 'A1VC38T7YXB528' => 'fe' + }.freeze +end diff --git a/spec/amazon_sp_clients/marketplaces_spec.rb b/spec/amazon_sp_clients/marketplaces_spec.rb new file mode 100644 index 0000000..6f8347a --- /dev/null +++ b/spec/amazon_sp_clients/marketplaces_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' +require 'open3' +require 'rbconfig' + +# V2 must load the region and marketplace tables without loading the +# rest of v1, so they live in a file of their own. +RSpec.describe 'amazon_sp_clients/marketplaces' do + it 'defines the tables without loading v1' do + script = <<~RUBY + require 'amazon_sp_clients/marketplaces' + puts [ + AmazonSpClients::REGIONS.frozen?, + AmazonSpClients::MARKETPLACE_IDS.size, + AmazonSpClients::MARKETPLACE_ENDPOINT_MAP.size, + AmazonSpClients::REGIONS.fetch(AmazonSpClients::REGION_NA), + defined?(AmazonSpClients::Session).inspect + ].join(' ') + RUBY + + out, err, status = Open3.capture3(RbConfig.ruby, '-Ilib', '-e', script) + + expect(err).to eq('') + expect(status).to be_success + expect(out.strip).to eq('true 20 20 sellingpartnerapi-na.amazon.com nil') + end +end From 9ea2b6e6185f3b1fc3254b24872be8d59c23beaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:46:16 +0200 Subject: [PATCH 39/83] Keep the deprecated settings past 2.0 The AWS IAM and logger settings were announced as "removed in 2.0". Every consumer still sets them in its configure block, and the generated v1 code still reads debugging and logger on every call. Removing them in 2.0.0 would break each cart at construction. They stay as no-ops and leave together with the v1 API. --- CHANGELOG.md | 2 +- README.md | 4 ++-- lib/amazon_sp_clients/configuration.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c153cf..7236500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,7 +66,7 @@ considered breaking and do not trigger a major version bump. - The AWS IAM configuration settings `access_key`, `secret_key`, `role_arn`, and `credentials_provider`. Amazon dropped the SigV4 signing requirement in October 2023. The setters are accepted and - ignored; they will be removed in 2.0. + ignored; they go away together with the v1 API in a later major. ### Fixed diff --git a/README.md b/README.md index 4d37115..a00818b 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ puts get_orders_response.payload # Hash with symbolized keys The AWS IAM settings (`access_key`, `secret_key`, `role_arn`, `credentials_provider`) are deprecated. Amazon dropped the SigV4 signing requirement in October 2023, so the gem no longer signs -requests or calls STS. The setters still exist but do nothing; they -will be removed in 2.0. +requests or calls STS. The setters still exist but do nothing. They +stay until the v1 API itself is removed in a later major. ### Restricted operations (requesting PII data) diff --git a/lib/amazon_sp_clients/configuration.rb b/lib/amazon_sp_clients/configuration.rb index 3b463bd..aa9a0ab 100644 --- a/lib/amazon_sp_clients/configuration.rb +++ b/lib/amazon_sp_clients/configuration.rb @@ -14,7 +14,7 @@ class Configuration # Deprecated AWS/SigV4-era settings. Amazon dropped the SigV4 # requirement in October 2023. Accepted and ignored since 1.8.0; - # they will be removed in 2.0. + # they go away together with the v1 API in a later major. attr_accessor :credentials_provider attr_accessor :access_key attr_accessor :secret_key @@ -27,7 +27,7 @@ class Configuration attr_accessor :base_path # Deprecated: the gem no longer logs. Accepted and ignored since 1.8.0; - # they will be removed in 2.0. + # they go away together with the v1 API in a later major. attr_accessor :debugging attr_accessor :logger From 91eb4af56545df2df034a576cb62aa865429e472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:55:45 +0200 Subject: [PATCH 40/83] Add V2 config, token and errors First pieces of the AmazonSpClients::V2 namespace, which fixes the v1 design flaws without changing v1: a frozen per-client Config (no thread-local global), a frozen Token value with the 60 second expiry skew, a typed error tree, and an ErrorMapper that turns responses and transport exceptions into those errors. Consumers on V2 match on error class and code, not on message text. ThrottledError sits beside ClientError, not under it, so a rescue of ClientError cannot swallow throttling. The mapper wraps only a named list of transport exceptions, never StandardError: beagle_worker cancels a task by raising into the cart's thread, and that must pass through untouched. --- lib/amazon_sp_clients/v2.rb | 26 ++ lib/amazon_sp_clients/v2/config.rb | 72 +++++ lib/amazon_sp_clients/v2/error_mapper.rb | 198 ++++++++++++++ lib/amazon_sp_clients/v2/errors.rb | 113 ++++++++ lib/amazon_sp_clients/v2/token.rb | 27 ++ spec/amazon_sp_clients/v2/config_spec.rb | 73 +++++ .../amazon_sp_clients/v2/error_mapper_spec.rb | 252 ++++++++++++++++++ spec/amazon_sp_clients/v2/errors_spec.rb | 66 +++++ spec/amazon_sp_clients/v2/token_spec.rb | 32 +++ 9 files changed, 859 insertions(+) create mode 100644 lib/amazon_sp_clients/v2.rb create mode 100644 lib/amazon_sp_clients/v2/config.rb create mode 100644 lib/amazon_sp_clients/v2/error_mapper.rb create mode 100644 lib/amazon_sp_clients/v2/errors.rb create mode 100644 lib/amazon_sp_clients/v2/token.rb create mode 100644 spec/amazon_sp_clients/v2/config_spec.rb create mode 100644 spec/amazon_sp_clients/v2/error_mapper_spec.rb create mode 100644 spec/amazon_sp_clients/v2/errors_spec.rb create mode 100644 spec/amazon_sp_clients/v2/token_spec.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb new file mode 100644 index 0000000..725a2e4 --- /dev/null +++ b/lib/amazon_sp_clients/v2.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'amazon_sp_clients/version' +require 'amazon_sp_clients/marketplaces' +require 'amazon_sp_clients/api_error' +require 'amazon_sp_clients/api_response' + +require 'amazon_sp_clients/v2/errors' +require 'amazon_sp_clients/v2/config' +require 'amazon_sp_clients/v2/token' +require 'amazon_sp_clients/v2/error_mapper' + +# Ruby clients for the Amazon Selling Partner API. +module AmazonSpClients + # The second-generation client: explicit per-client configuration, a + # thread-safe token source, first-class restricted data tokens and + # typed errors. Loads without the v1 code. + # + # require 'amazon_sp_clients/v2' + # + # config = AmazonSpClients::V2::Config.new(endpoint: 'na') + # client = AmazonSpClients::V2::Client.new(config) { current_access_token } + # client.orders_v0.get_orders(marketplace_ids, created_after: since) + module V2 + end +end diff --git a/lib/amazon_sp_clients/v2/config.rb b/lib/amazon_sp_clients/v2/config.rb new file mode 100644 index 0000000..bd73319 --- /dev/null +++ b/lib/amazon_sp_clients/v2/config.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +require 'amazon_sp_clients/version' +require 'amazon_sp_clients/marketplaces' + +module AmazonSpClients + module V2 + # Per-client settings: which SP-API host to talk to, timeouts, the + # user agent, and the LWA app credentials (only needed by clients + # that exchange refresh tokens themselves). Frozen; build a variant + # with +with+: + # + # config = Config.new(endpoint: 'eu', sandbox: true) + # config.with(sandbox: false) + Config = Data.define(:endpoint, :sandbox, :timeout, :open_timeout, + :client_id, :client_secret, :user_agent) + + class Config + # Endpoint codes consumers store per merchant, mapped to the AWS + # region that names the SP-API host. Same table as v1's + # Configuration#endpoint=. + ENDPOINT_REGIONS = { + 'na' => REGION_NA, 'br' => REGION_NA, 'ca' => REGION_NA, 'mx' => REGION_NA, + 'us' => REGION_NA, + 'fe' => REGION_FE, 'au' => REGION_FE, 'jp' => REGION_FE, 'sg' => REGION_FE, + 'eu' => REGION_EU, 'ae' => REGION_EU, 'de' => REGION_EU, 'eg' => REGION_EU, + 'es' => REGION_EU, 'fr' => REGION_EU, 'gb' => REGION_EU, 'in' => REGION_EU, + 'it' => REGION_EU, 'nl' => REGION_EU, 'pl' => REGION_EU, 'sa' => REGION_EU, + 'se' => REGION_EU, 'tr' => REGION_EU + }.freeze + + DEFAULT_ENDPOINT = 'na' + # Seconds to read or write on an open connection. + DEFAULT_TIMEOUT = 60 + # Seconds to open a connection. + DEFAULT_OPEN_TIMEOUT = 10 + DEFAULT_USER_AGENT = "amazon_sp_clients/#{VERSION} (Language=Ruby/#{RUBY_VERSION})".freeze + SANDBOX_PREFIX = 'sandbox.' + + # @param endpoint [String] region or country code ('na', 'eu', 'fe', 'de', ...) + # @param sandbox [Boolean] send requests to the sandbox host + # @param timeout [Integer] read/write timeout in seconds + # @param open_timeout [Integer] connect timeout in seconds + # @param client_id [String, nil] LWA app client id + # @param client_secret [String, nil] LWA app client secret + # @param user_agent [String, nil] nil selects the default + # @raise [ArgumentError] on an unknown endpoint code + def initialize(endpoint: DEFAULT_ENDPOINT, sandbox: false, timeout: DEFAULT_TIMEOUT, + open_timeout: DEFAULT_OPEN_TIMEOUT, client_id: nil, client_secret: nil, + user_agent: DEFAULT_USER_AGENT) + ENDPOINT_REGIONS.fetch(endpoint) do + raise ArgumentError, "unknown endpoint #{endpoint.inspect}" + end + + super(endpoint: endpoint, sandbox: sandbox, timeout: timeout, open_timeout: open_timeout, + client_id: client_id, client_secret: client_secret, + user_agent: user_agent || DEFAULT_USER_AGENT) + end + + # @return [String] AWS region of the endpoint, e.g. 'us-east-1' + def region = ENDPOINT_REGIONS.fetch(endpoint) + + # @return [String] SP-API host, with the sandbox prefix when enabled + def host + "#{SANDBOX_PREFIX if sandbox}#{REGIONS.fetch(region)}" + end + + # @return [String] base URL of every API request + def base_url = "https://#{host}" + end + end +end diff --git a/lib/amazon_sp_clients/v2/error_mapper.rb b/lib/amazon_sp_clients/v2/error_mapper.rb new file mode 100644 index 0000000..dc1c6c0 --- /dev/null +++ b/lib/amazon_sp_clients/v2/error_mapper.rb @@ -0,0 +1,198 @@ +# frozen_string_literal: true + +require 'json' +require 'uri' +require 'faraday' +require 'httpclient' +require 'amazon_sp_clients/api_error' +require 'amazon_sp_clients/v2/errors' + +module AmazonSpClients + module V2 + # Turns a Faraday response or a transport exception into the V2 + # error for it. One mapper per service, because the three services + # V2 talks to fail in different shapes: + # + # :api SP-API; body {"errors": [{code, message, details}]} + # :lwa token endpoint; body {"error", "error_description"} + # :documents presigned S3 urls; the url carries the credential + class ErrorMapper + SERVICES = %i[api lwa documents].freeze + + # Exceptions the HTTPClient adapter lets out of a request: Faraday's + # own, plus the ones it re-raises untouched. Nothing else is + # wrapped, so an exception delivered by Thread#raise passes through. + TRANSPORT_ERRORS = [ + Faraday::Error, HTTPClient::KeepAliveDisconnected, SystemCallError, IOError, SocketError + ].freeze + + STATUS_ERRORS = { + 400 => BadRequestError, + 401 => UnauthorizedError, + 403 => ForbiddenError, + 404 => NotFoundError, + 429 => ThrottledError + }.freeze + CLIENT_ERROR_STATUSES = (400...500) + SERVER_ERROR_STATUSES = (500...600) + + LWA_ERRORS = { + 'invalid_grant' => InvalidGrantError, + 'invalid_client' => InvalidClientError + }.freeze + + REQUEST_ID_HEADER = 'x-amzn-RequestId' + RATE_LIMIT_HEADER = 'x-amzn-RateLimit-Limit' + + # The error ends up in consumer logs; keep secrets out of it. + FILTERED = '[FILTERED]' + SENSITIVE_HEADERS = %w[authorization x-amz-access-token x-amz-security-token].freeze + + # @param service [Symbol] one of SERVICES + # @raise [ArgumentError] on an unknown service + def initialize(service) + raise ArgumentError, "unknown service #{service.inspect}" unless SERVICES.include?(service) + + @service = service + end + + # @param response [Faraday::Response] + # @return [Faraday::Response] the same response, when it is a 2xx + # @raise [Error] the mapped error otherwise + def check!(response) + env = response.env + raise ConnectionError.new('no status in response', **context(env)) if env.status.nil? + return response if response.success? + + raise error_for(env) + end + + # Wraps an exception raised by the transport. Call it inside the + # rescue, so Ruby records the original exception as +cause+. + # + # @param exception [Exception] + # @param method [Symbol] HTTP method of the failed request + # @param url [String] full url of the failed request + # @return [ConnectionError] + def transport_error(exception, method:, url:) + klass = exception.is_a?(Faraday::TimeoutError) ? TimeoutError : ConnectionError + + klass.new("#{exception.class}: #{exception.message}", + request: { method: method, url: redacted_url(url), path: URI(url).path }) + end + + private + + def error_for(env) + case @service + when :api then api_error(env) + when :lwa then lwa_error(env) + else document_error(env) + end + end + + def api_error(env) + parsed = parse_json(env.body) + errors = parsed ? ApiError.new(parsed).errors : [] + messages = parsed && errors.map { |e| describe(e) } + klass = STATUS_ERRORS.fetch(env.status) { generic_class(env.status) } + + klass.new("#{env.status} #{summary(env.body, messages)}", + errors: errors, rate_limit: rate_limit(env), **context(env)) + end + + def lwa_error(env) + return lwa_server_error(env) if SERVER_ERROR_STATUSES.cover?(env.status) + + parsed = parse_json(env.body) + parsed = nil unless parsed.is_a?(Hash) + code = parsed&.fetch(:error, nil) + description = parsed&.fetch(:error_description, nil) + messages = parsed && [[code, description].compact.join(': ')].reject(&:empty?) + + LWA_ERRORS.fetch(code, AuthError) + .new("#{env.status} #{summary(env.body, messages)}", + code: code, description: description, **context(env)) + end + + def lwa_server_error(env) + ServerError.new("#{env.status} #{summary(env.body, [])}", **context(env)) + end + + def document_error(env) + DocumentError.new("#{env.status} #{env.reason_phrase}".strip, **context(env)) + end + + # Status text: the parsed error messages, or why there are none. + # +messages+ is nil when the body was not JSON. + def summary(body, messages) + return '(no body)' if body.nil? || body.empty? + return '(body is not JSON)' if messages.nil? + return '(no error details)' if messages.empty? + + messages.join('; ') + end + + def describe(error) + text = "#{error.code}: #{error.message}" + return text if error.details.to_s.empty? + + "#{text} (#{error.details})" + end + + def generic_class(status) + return ClientError if CLIENT_ERROR_STATUSES.cover?(status) + return ServerError if SERVER_ERROR_STATUSES.cover?(status) + + ResponseError + end + + def parse_json(body) + return nil if body.nil? || body.empty? + + JSON.parse(body, symbolize_names: true) + rescue JSON::ParserError + nil + end + + def context(env) + { + status: env.status, + request_id: env.response_headers&.[](REQUEST_ID_HEADER), + request: request_details(env), + response: { status: env.status, headers: env.response_headers, body: env.body } + } + end + + def request_details(env) + { + method: env.method, + url: redacted_url(env.url.to_s), + path: env.url.path, + headers: redacted_headers(env.request_headers), + body: @service == :lwa ? FILTERED : env.request_body + } + end + + # A copy that keeps Faraday's case-insensitive lookup. + def redacted_headers(headers) + redacted = Faraday::Utils::Headers.new(headers || {}) + SENSITIVE_HEADERS.each do |name| + redacted[name] = FILTERED unless redacted[name].nil? + end + redacted + end + + # Presigned S3 urls carry their credential in the query string. + def redacted_url(url) + return url unless @service == :documents + + URI(url).tap { |uri| uri.query = nil }.to_s + end + + def rate_limit(env) + env.response_headers&.[](RATE_LIMIT_HEADER)&.to_f + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/errors.rb b/lib/amazon_sp_clients/v2/errors.rb new file mode 100644 index 0000000..d54c6f8 --- /dev/null +++ b/lib/amazon_sp_clients/v2/errors.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module AmazonSpClients + module V2 + # Base class of every error V2 raises. + # + # Match on the class and on +code+, never on the message. Rescue + # subclasses before their parents: ThrottledError, UnauthorizedError, + # ForbiddenError and NotFoundError before ClientError; TimeoutError + # before ConnectionError. The exception that caused a transport + # error is available as +cause+. + class Error < StandardError + # @return [Integer, nil] HTTP status, when a response was received + attr_reader :status + # @return [String, nil] Amazon's request id (x-amzn-RequestId) + attr_reader :request_id + # @return [Hash, nil] method, url, path, headers and body of the + # request; secrets redacted + attr_reader :request + # @return [Hash, nil] status, headers and body of the response + attr_reader :response + + # @param message [String, nil] + def initialize(message = nil, status: nil, request_id: nil, request: nil, response: nil) + super(message) + @status = status + @request_id = request_id + @request = request + @response = response + end + end + + # The request got no usable response: connection refused, DNS or + # SSL failure, a dropped keep-alive socket, a malformed response, a + # response without status. + class ConnectionError < Error; end + + # The request timed out while connecting, reading or writing. + class TimeoutError < ConnectionError; end + + # A 2xx response whose body is not valid JSON. + class ParseError < Error; end + + # The LWA token endpoint rejected the request (4xx). + class AuthError < Error + # @return [String, nil] LWA error code, e.g. 'invalid_grant' + attr_reader :code + # @return [String, nil] LWA error description + attr_reader :description + + # @param message [String, nil] + # @param code [String, nil] + # @param description [String, nil] + def initialize(message = nil, code: nil, description: nil, **context) + super(message, **context) + @code = code + @description = description + end + end + + # The refresh token is revoked or invalid (LWA +invalid_grant+). + class InvalidGrantError < AuthError; end + + # The app credentials are wrong (LWA +invalid_client+). + class InvalidClientError < AuthError; end + + # SP-API answered with a non-2xx status. + class ResponseError < Error + # @return [Array] parsed SP-API + # errors (code, message, details); empty when the body had none + attr_reader :errors + # @return [Float, nil] x-amzn-RateLimit-Limit header, when present + attr_reader :rate_limit + + # @param message [String, nil] + # @param errors [Array] + # @param rate_limit [Float, nil] + def initialize(message = nil, errors: [], rate_limit: nil, **context) + super(message, **context) + @errors = errors + @rate_limit = rate_limit + end + + # @return [String, nil] code of the first SP-API error + def code = errors.first&.code + end + + # 429: the request was throttled. Kept out of ClientError on + # purpose, so a +rescue ClientError+ cannot swallow it. + class ThrottledError < ResponseError; end + + # Any 4xx other than 429. + class ClientError < ResponseError; end + + # 400. + class BadRequestError < ClientError; end + + # 401. + class UnauthorizedError < ClientError; end + + # 403. + class ForbiddenError < ClientError; end + + # 404. + class NotFoundError < ClientError; end + + # 5xx. + class ServerError < ResponseError; end + + # A presigned S3 upload or download failed. + class DocumentError < Error; end + end +end diff --git a/lib/amazon_sp_clients/v2/token.rb b/lib/amazon_sp_clients/v2/token.rb new file mode 100644 index 0000000..7232a71 --- /dev/null +++ b/lib/amazon_sp_clients/v2/token.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module AmazonSpClients + module V2 + # An access token with its expiry, as returned by LWA or by the + # Tokens API (restricted data tokens). Frozen: a refresh swaps the + # whole object, so a reader never sees a token paired with another + # exchange's expiry. + Token = Data.define(:access_token, :token_type, :expires_in, :expires_at, :refresh_token) + + class Token + # Seconds before the real expiry at which the token counts as + # expired, so a request started just before it never carries a + # dead token. + EXPIRY_SKEW = 60 + + # @param now [Time] + # @return [Boolean] true within EXPIRY_SKEW of expiry, or when + # the token has no expiry at all + def expired?(now = Time.now.utc) + return true if expires_at.nil? + + now >= expires_at - EXPIRY_SKEW + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/config_spec.rb b/spec/amazon_sp_clients/v2/config_spec.rb new file mode 100644 index 0000000..f24b610 --- /dev/null +++ b/spec/amazon_sp_clients/v2/config_spec.rb @@ -0,0 +1,73 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::Config do + describe 'defaults' do + subject(:config) { described_class.new } + + it 'points at the NA production host' do + expect(config.endpoint).to eq('na') + expect(config.region).to eq('us-east-1') + expect(config.base_url).to eq('https://sellingpartnerapi-na.amazon.com') + end + + it 'sets timeouts and no credentials' do + expect(config.timeout).to eq(60) + expect(config.open_timeout).to eq(10) + expect(config.client_id).to be_nil + expect(config.client_secret).to be_nil + end + + it 'names the gem and Ruby in the user agent' do + expect(config.user_agent).to eq( + "amazon_sp_clients/#{AmazonSpClients::VERSION} (Language=Ruby/#{RUBY_VERSION})" + ) + end + + it 'falls back to the default user agent when given nil' do + expect(described_class.new(user_agent: nil).user_agent).to eq(config.user_agent) + end + end + + describe 'endpoint' do + { + 'eu' => ['eu-west-1', 'sellingpartnerapi-eu.amazon.com'], + 'fe' => ['us-west-2', 'sellingpartnerapi-fe.amazon.com'], + 'de' => ['eu-west-1', 'sellingpartnerapi-eu.amazon.com'], + 'jp' => ['us-west-2', 'sellingpartnerapi-fe.amazon.com'], + 'us' => ['us-east-1', 'sellingpartnerapi-na.amazon.com'] + }.each do |code, (region, host)| + it "maps #{code} to #{region}" do + config = described_class.new(endpoint: code) + + expect(config.region).to eq(region) + expect(config.base_url).to eq("https://#{host}") + end + end + + it 'rejects an unknown code' do + expect { described_class.new(endpoint: 'zz') } + .to raise_error(ArgumentError, /unknown endpoint "zz"/) + end + end + + it 'prefixes the host in sandbox mode' do + config = described_class.new(endpoint: 'eu', sandbox: true) + + expect(config.base_url).to eq('https://sandbox.sellingpartnerapi-eu.amazon.com') + end + + it 'is frozen and builds variants with #with' do + config = described_class.new(client_id: 'ID') + variant = config.with(sandbox: true) + + expect(config).to be_frozen + expect(config.sandbox).to be(false) + expect(variant.sandbox).to be(true) + expect(variant.client_id).to eq('ID') + end + + it 'rejects unknown settings' do + expect { described_class.new(region: 'us-east-1') }.to raise_error(ArgumentError) + end +end diff --git a/spec/amazon_sp_clients/v2/error_mapper_spec.rb b/spec/amazon_sp_clients/v2/error_mapper_spec.rb new file mode 100644 index 0000000..b356be9 --- /dev/null +++ b/spec/amazon_sp_clients/v2/error_mapper_spec.rb @@ -0,0 +1,252 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::ErrorMapper do + v2 = AmazonSpClients::V2 + + let(:base_url) { 'https://api.example.test' } + let(:conn) { Faraday.new(url: base_url) } + + def mapper(service) + described_class.new(service) + end + + # Stubs one response, runs the request through a bare connection and + # returns the V2 error the mapper raises for it (nil when it passes). + def error_for(service, status:, body: '', response_headers: {}, request_headers: {}, + method: :get, path: '/thing', request_body: nil) + stub_request(method, "#{base_url}#{path}") + .to_return(status: status, body: body, headers: response_headers) + response = conn.run_request(method, path, request_body, request_headers) + + mapper(service).check!(response) + nil + rescue AmazonSpClients::V2::Error => e + e + end + + # Raises +exception+, wraps it the way the client does, and returns + # the wrapper so specs can look at its cause. + def wrapped(exception, service: :api, url: "#{base_url}/thing") + raise exception + rescue StandardError => e + begin + raise mapper(service).transport_error(e, method: :get, url: url) + rescue AmazonSpClients::V2::Error => wrapper + wrapper + end + end + + describe 'constructor' do + it 'accepts only the services V2 uses' do + expect(described_class::SERVICES).to eq(%i[api lwa documents]) + expect { described_class.new(:bogus) }.to raise_error(ArgumentError, /bogus/) + end + end + + describe '#check! for the API service' do + { + 400 => v2::BadRequestError, + 401 => v2::UnauthorizedError, + 403 => v2::ForbiddenError, + 404 => v2::NotFoundError, + 429 => v2::ThrottledError, + 418 => v2::ClientError, + 500 => v2::ServerError, + 503 => v2::ServerError + }.each do |status, klass| + it "raises #{klass} on #{status}" do + expect(error_for(:api, status: status)).to be_an_instance_of(klass) + end + end + + it 'returns the response on 2xx' do + stub_request(:get, "#{base_url}/thing").to_return(status: 200, body: 'ok') + response = conn.get('/thing') + + expect(mapper(:api).check!(response)).to be(response) + end + + it 'formats the message from the SP-API error body' do + body = '{"errors":[{"code":"InvalidInput","message":"Invalid Input"}]}' + + err = error_for(:api, status: 400, body: body) + + expect(err.message).to eq('400 InvalidInput: Invalid Input') + expect(err.code).to eq('InvalidInput') + expect(err.errors.map(&:message)).to eq(['Invalid Input']) + end + + it 'joins several errors and keeps details' do + body = + '{"errors":[{"code":"QuotaExceeded","message":"slow down"},' \ + '{"code":"InvalidInput","message":"bad asin","details":"asin B0"}]}' + + err = error_for(:api, status: 429, body: body) + + expect(err.message).to eq('429 QuotaExceeded: slow down; InvalidInput: bad asin (asin B0)') + expect(err.errors.size).to eq(2) + end + + it 'says so when the body is empty or not JSON' do + expect(error_for(:api, status: 500, body: '').message).to eq('500 (no body)') + expect(error_for(:api, status: 502, body: '').message).to eq('502 (body is not JSON)') + end + + it 'reads the request id and rate limit headers in any case' do + err = error_for( + :api, status: 429, + response_headers: { 'x-amzn-requestid' => 'req-1', 'x-amzn-ratelimit-limit' => '0.5' } + ) + + expect(err.status).to eq(429) + expect(err.request_id).to eq('req-1') + expect(err.rate_limit).to eq(0.5) + end + + it 'has no rate limit when the header is absent' do + expect(error_for(:api, status: 400).rate_limit).to be_nil + end + + # Consumers log these errors; tokens must not leak through them. + it 'keeps the response and a redacted copy of the request' do + err = error_for( + :api, status: 400, body: 'oops', method: :post, path: '/orders/v0/orders', + request_body: 'req', + request_headers: { + 'x-amz-access-token' => 'SECRET', 'authorization' => 'AWS secret', + 'x-amz-security-token' => 'STS', 'X-Custom' => 'kept' + } + ) + + expect(err.response).to include(status: 400, body: 'oops') + expect(err.request).to include(method: :post, path: '/orders/v0/orders', body: 'req') + headers = err.request[:headers] + expect(headers['x-amz-access-token']).to eq('[FILTERED]') + expect(headers['authorization']).to eq('[FILTERED]') + expect(headers['X-Amz-Security-Token']).to eq('[FILTERED]') + expect(headers['x-custom']).to eq('kept') + end + + it 'keeps the query string in the request url' do + err = error_for(:api, status: 400, path: '/orders?MarketplaceIds=ATVPDKIKX0DER') + + expect(err.request[:url]).to eq("#{base_url}/orders?MarketplaceIds=ATVPDKIKX0DER") + end + + it 'treats a response without status as a connection error' do + env = Faraday::Env.from( + method: :get, url: URI("#{base_url}/thing"), status: nil, + request_headers: Faraday::Utils::Headers.new, response_headers: Faraday::Utils::Headers.new + ) + + expect { mapper(:api).check!(Faraday::Response.new(env)) } + .to raise_error(v2::ConnectionError, /no status/) + end + end + + describe '#check! for the LWA service' do + let(:token_path) { '/auth/o2/token' } + + it 'maps invalid_grant to InvalidGrantError with code and description' do + body = '{"error":"invalid_grant",' \ + '"error_description":"The request has an invalid grant parameter : refresh_token"}' + + err = error_for(:lwa, status: 400, body: body, method: :post, path: token_path) + + expect(err).to be_an_instance_of(v2::InvalidGrantError) + expect(err.code).to eq('invalid_grant') + expect(err.description).to eq('The request has an invalid grant parameter : refresh_token') + expect(err.message) + .to eq('400 invalid_grant: The request has an invalid grant parameter : refresh_token') + end + + it 'maps invalid_client to InvalidClientError' do + err = error_for(:lwa, status: 401, body: fixture('token_error.json'), method: :post, + path: token_path) + + expect(err).to be_an_instance_of(v2::InvalidClientError) + expect(err.message).to eq('401 invalid_client: Client authentication failed') + end + + it 'maps other 4xx codes to AuthError' do + body = '{"error":"unauthorized_client","error_description":"no"}' + + err = error_for(:lwa, status: 400, body: body, method: :post, path: token_path) + + expect(err).to be_an_instance_of(v2::AuthError) + expect(err.code).to eq('unauthorized_client') + end + + it 'maps 5xx to ServerError' do + expect(error_for(:lwa, status: 500, method: :post, path: token_path)) + .to be_an_instance_of(v2::ServerError) + end + + # The token request body carries client_secret and refresh_token. + it 'filters the request body' do + err = error_for(:lwa, status: 400, body: '{"error":"invalid_grant"}', method: :post, + path: token_path, request_body: 'client_secret=SECRET') + + expect(err.request[:body]).to eq('[FILTERED]') + end + end + + describe '#check! for the documents service' do + # Presigned S3 urls carry their credential in the query string. + it 'raises DocumentError with the status and reason, query stripped' do + err = error_for(:documents, status: [403, 'Forbidden'], path: '/doc?X-Amz-Signature=SECRET') + + expect(err).to be_an_instance_of(v2::DocumentError) + expect(err.message).to eq('403 Forbidden') + expect(err.request[:url]).to eq("#{base_url}/doc") + expect(err.request[:path]).to eq('/doc') + end + + it 'reports only the status when there is no reason phrase' do + expect(error_for(:documents, status: 500).message).to eq('500') + end + end + + describe '#transport_error' do + it 'wraps timeouts as TimeoutError and keeps the cause' do + err = wrapped(Faraday::TimeoutError.new('slow')) + + expect(err).to be_an_instance_of(v2::TimeoutError) + expect(err.cause).to be_a(Faraday::TimeoutError) + expect(err.message).to eq('Faraday::TimeoutError: slow') + expect(err.request).to eq(method: :get, url: "#{base_url}/thing", path: '/thing') + end + + it 'wraps the other transport failures as ConnectionError' do + [ + Faraday::ConnectionFailed.new('refused'), + Faraday::ClientError.new('bad response'), + HTTPClient::KeepAliveDisconnected.new, + Errno::EHOSTUNREACH.new, + SocketError.new('dns') + ].each do |exception| + expect(wrapped(exception)).to be_an_instance_of(v2::ConnectionError) + end + end + + it 'strips the query from document urls' do + url = "#{base_url}/doc?X-Amz-Signature=SECRET" + + err = wrapped(Faraday::ConnectionFailed.new('x'), service: :documents, url: url) + + expect(err.request[:url]).to eq("#{base_url}/doc") + end + + # beagle_worker cancels a task by raising into the cart's thread; a + # blanket rescue would turn that into a connection error. + it 'names only transport exceptions, never StandardError' do + list = described_class::TRANSPORT_ERRORS + + expect(list).to include(Faraday::Error, HTTPClient::KeepAliveDisconnected, + SystemCallError, IOError, SocketError) + expect(list).not_to include(StandardError) + expect(list.any? { |klass| klass >= RuntimeError }).to be(false) + end + end +end diff --git a/spec/amazon_sp_clients/v2/errors_spec.rb b/spec/amazon_sp_clients/v2/errors_spec.rb new file mode 100644 index 0000000..1380ea4 --- /dev/null +++ b/spec/amazon_sp_clients/v2/errors_spec.rb @@ -0,0 +1,66 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::Error do + v2 = AmazonSpClients::V2 + + it 'is a StandardError carrying request context' do + err = described_class.new( + 'boom', status: 400, request_id: 'req-1', request: { path: '/x' }, response: { body: '' } + ) + + expect(err).to be_a(StandardError) + expect(err.message).to eq('boom') + expect(err.status).to eq(400) + expect(err.request_id).to eq('req-1') + expect(err.request).to eq(path: '/x') + expect(err.response).to eq(body: '') + end + + it 'hangs the top-level branches off Error' do + [v2::ConnectionError, v2::ParseError, v2::AuthError, v2::ResponseError, v2::DocumentError] + .each { |klass| expect(klass.superclass).to be(described_class) } + end + + it 'nests the tree as documented' do + expect(v2::TimeoutError.superclass).to be(v2::ConnectionError) + expect(v2::InvalidGrantError.superclass).to be(v2::AuthError) + expect(v2::InvalidClientError.superclass).to be(v2::AuthError) + expect(v2::ClientError.superclass).to be(v2::ResponseError) + expect(v2::ServerError.superclass).to be(v2::ResponseError) + [v2::BadRequestError, v2::UnauthorizedError, v2::ForbiddenError, v2::NotFoundError] + .each { |klass| expect(klass.superclass).to be(v2::ClientError) } + end + + # A migrated `rescue V2::ClientError` must not swallow throttling. + it 'keeps throttling outside the client error branch' do + expect(v2::ThrottledError.superclass).to be(v2::ResponseError) + expect(v2::ThrottledError.ancestors).not_to include(v2::ClientError) + end + + it 'exposes the parsed SP-API errors on response errors' do + errors = [AmazonSpClients::ApiError::Error.new('InvalidInput', 'bad', nil)] + err = v2::ResponseError.new('400 InvalidInput: bad', status: 400, errors: errors, + rate_limit: 0.5) + + expect(err.errors).to eq(errors) + expect(err.code).to eq('InvalidInput') + expect(err.rate_limit).to eq(0.5) + end + + it 'has no code when the body carried no errors' do + err = v2::ServerError.new('500 (no body)', status: 500) + + expect(err.errors).to eq([]) + expect(err.code).to be_nil + end + + it 'exposes the LWA error code and description on auth errors' do + err = v2::AuthError.new( + '400 invalid_grant: nope', status: 400, code: 'invalid_grant', description: 'nope' + ) + + expect(err.code).to eq('invalid_grant') + expect(err.description).to eq('nope') + end +end diff --git a/spec/amazon_sp_clients/v2/token_spec.rb b/spec/amazon_sp_clients/v2/token_spec.rb new file mode 100644 index 0000000..cd49dcc --- /dev/null +++ b/spec/amazon_sp_clients/v2/token_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::Token do + let(:now) { Time.utc(2026, 9, 3, 12, 0, 0) } + + before { Timecop.freeze(now) } + + def token(expires_at) + described_class.new( + access_token: 'Atza|x', token_type: 'bearer', expires_in: 3600, + expires_at: expires_at, refresh_token: nil + ) + end + + it 'is fresh well before expiry' do + expect(token(now + 3600)).not_to be_expired + end + + it 'counts as expired 60 seconds early' do + expect(token(now + 60)).to be_expired + expect(token(now + 61)).not_to be_expired + end + + it 'counts a token without expiry as expired' do + expect(token(nil)).to be_expired + end + + it 'is frozen' do + expect(token(now + 3600)).to be_frozen + end +end From 988ded89dbe4956f788b42bf5295de853547a2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:59:10 +0200 Subject: [PATCH 41/83] Add the V2 LWA client Exchanges a refresh token for an access token against Login with Amazon, with the app credentials taken from the client's Config instead of a global. Returns a frozen Token with an absolute expiry. Failures come back as typed errors: InvalidGrantError for a revoked refresh token, ParseError for a broken body, TimeoutError or ConnectionError for transport failures. Consumers call it directly where they used TokenExchangeAuth today. --- lib/amazon_sp_clients/v2.rb | 1 + lib/amazon_sp_clients/v2/lwa.rb | 101 +++++++++++++++++++++++++ spec/amazon_sp_clients/v2/lwa_spec.rb | 104 ++++++++++++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 lib/amazon_sp_clients/v2/lwa.rb create mode 100644 spec/amazon_sp_clients/v2/lwa_spec.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index 725a2e4..1fa81b7 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -9,6 +9,7 @@ require 'amazon_sp_clients/v2/config' require 'amazon_sp_clients/v2/token' require 'amazon_sp_clients/v2/error_mapper' +require 'amazon_sp_clients/v2/lwa' # Ruby clients for the Amazon Selling Partner API. module AmazonSpClients diff --git a/lib/amazon_sp_clients/v2/lwa.rb b/lib/amazon_sp_clients/v2/lwa.rb new file mode 100644 index 0000000..b004bc8 --- /dev/null +++ b/lib/amazon_sp_clients/v2/lwa.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +require 'json' +require 'faraday' +require 'amazon_sp_clients/adapter_loader' +require 'amazon_sp_clients/v2/config' +require 'amazon_sp_clients/v2/errors' +require 'amazon_sp_clients/v2/error_mapper' +require 'amazon_sp_clients/v2/token' + +module AmazonSpClients + module V2 + # Login with Amazon: exchanges a refresh token for an access token. + # + # token = LWA.new(config).exchange(refresh_token: stored_refresh_token) + # token.access_token # => "Atza|..." + # token.expires_at # => Time + # + # Needs the app credentials on the config. Consumers that keep their + # own token store call this directly; RefreshToken credentials call + # it for the client. + class LWA + TOKEN_HOST = 'https://api.amazon.com' + TOKEN_PATH = '/auth/o2/token' + REFRESH_GRANT = 'refresh_token' + + # @param config [Config] with client_id and client_secret set + # @raise [ArgumentError] when the app credentials are missing + def initialize(config) + if config.client_id.nil? || config.client_secret.nil? + raise ArgumentError, 'config needs client_id and client_secret' + end + + @config = config + @errors = ErrorMapper.new(:lwa) + @conn = build_connection + end + + # @param refresh_token [String] + # @return [Token] + # @raise [AuthError] when LWA rejects the grant (e.g. InvalidGrantError) + # @raise [ConnectionError, ParseError, ServerError] + def exchange(refresh_token:) + form = { + grant_type: REFRESH_GRANT, + client_id: @config.client_id, + client_secret: @config.client_secret, + refresh_token: refresh_token + } + + build_token(post(form)) + end + + private + + def build_connection + options = { timeout: @config.timeout, open_timeout: @config.open_timeout } + headers = { 'User-Agent' => @config.user_agent } + + Faraday.new(url: TOKEN_HOST, request: options, headers: headers) do |conn| + conn.request :url_encoded + conn.adapter Faraday::Adapter::HTTPClient + end + end + + def post(form) + response = @conn.post(TOKEN_PATH, form) + + @errors.check!(response) + rescue *ErrorMapper::TRANSPORT_ERRORS => e + raise @errors.transport_error(e, method: :post, url: "#{TOKEN_HOST}#{TOKEN_PATH}") + end + + def build_token(response) + body = parse(response) + expires_in = body[:expires_in] + + Token.new( + access_token: body[:access_token], + token_type: body[:token_type], + expires_in: expires_in, + expires_at: expires_in && (Time.now.utc + expires_in), + refresh_token: body[:refresh_token] + ) + end + + def parse(response) + body = JSON.parse(response.body, symbolize_names: true) + return body if body.is_a?(Hash) && body[:access_token] + + raise ParseError.new('LWA response has no access_token', **parse_context(response)) + rescue JSON::ParserError => e + raise ParseError.new("LWA response is not JSON: #{e.message}", **parse_context(response)) + end + + def parse_context(response) + { status: response.status, response: { status: response.status, body: response.body } } + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/lwa_spec.rb b/spec/amazon_sp_clients/v2/lwa_spec.rb new file mode 100644 index 0000000..6131e0c --- /dev/null +++ b/spec/amazon_sp_clients/v2/lwa_spec.rb @@ -0,0 +1,104 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::LWA do + v2 = AmazonSpClients::V2 + + let(:token_url) { 'https://api.amazon.com/auth/o2/token' } + let(:now) { Time.utc(2026, 9, 3, 12, 0, 0) } + let(:config) do + v2::Config.new(client_id: 'CLIENT_ID', client_secret: 'CLIENT_SECRET', + timeout: 7, open_timeout: 3) + end + let(:lwa) { described_class.new(config) } + + before { Timecop.freeze(now) } + + it 'needs the app credentials' do + expect { described_class.new(v2::Config.new) } + .to raise_error(ArgumentError, /client_id and client_secret/) + end + + describe '#exchange' do + it 'posts the refresh token grant as a form' do + stub = + stub_request(:post, token_url) + .with( + body: { + 'grant_type' => 'refresh_token', + 'client_id' => 'CLIENT_ID', + 'client_secret' => 'CLIENT_SECRET', + 'refresh_token' => 'REFRESH_TOKEN' + }, + headers: { + 'Content-Type' => 'application/x-www-form-urlencoded', + 'User-Agent' => config.user_agent + } + ) + .to_return(status: 200, body: fixture('token_success.json')) + + lwa.exchange(refresh_token: 'REFRESH_TOKEN') + + expect(stub).to have_been_requested + end + + it 'returns a frozen Token with the response fields and an absolute expiry' do + stub_request(:post, token_url).to_return(status: 200, body: fixture('token_success.json')) + + token = lwa.exchange(refresh_token: 'REFRESH_TOKEN') + + expect(token).to be_a(v2::Token).and be_frozen + expect(token.access_token).to eq('Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE') + expect(token.token_type).to eq('bearer') + expect(token.expires_in).to eq(3600) + expect(token.expires_at).to eq(now + 3600) + expect(token.refresh_token).to eq('Atzr|IQEBLzAtAhRPpMJxdwVz2Nn6f2y-tpJX2DeXEXAMPLE') + end + + it 'raises the typed auth error with the request body filtered' do + stub_request(:post, token_url).to_return(status: 400, body: fixture('token_error.json')) + + expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') } + .to raise_error(v2::InvalidClientError) do |err| + expect(err.code).to eq('invalid_client') + expect(err.request[:body]).to eq('[FILTERED]') + end + end + + it 'raises ParseError on a 2xx body that is not JSON' do + stub_request(:post, token_url).to_return(status: 200, body: '') + + expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') } + .to raise_error(v2::ParseError) { |err| expect(err.status).to eq(200) } + end + + it 'raises ParseError on a 2xx body without an access token' do + stub_request(:post, token_url).to_return(status: 200, body: '{"token_type":"bearer"}') + + expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') } + .to raise_error(v2::ParseError, /access_token/) + end + + it 'wraps a timeout as TimeoutError' do + stub_request(:post, token_url).to_timeout + + expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') } + .to raise_error(v2::TimeoutError) do |err| + expect(err.request[:path]).to eq('/auth/o2/token') + end + end + + it 'wraps a refused connection as ConnectionError' do + stub_request(:post, token_url).to_raise(Errno::ECONNREFUSED) + + expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') }.to raise_error(v2::ConnectionError) + end + end + + it 'applies the config timeouts to its connection' do + conn = lwa.instance_variable_get(:@conn) + + expect(conn.options.timeout).to eq(7) + expect(conn.options.open_timeout).to eq(3) + end +end From 631eef6a5a910a1cee5d0e30631e4449164f76c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:01:55 +0200 Subject: [PATCH 42/83] Add V2 credentials Two token sources behind one message, access_token. Callback asks a block before every request; this is the production path, where the host refreshes tokens out of band. RefreshToken exchanges through LWA and caches the Token until it expires; the expiry check runs again under a lock, so many threads hitting an expired token cause one exchange, not one each. The token is returned to the caller and never read back from a shared field, which removes the cross-thread read v1 has. A rotated refresh token is used on the next exchange and can be read back for persisting. --- lib/amazon_sp_clients/v2.rb | 1 + lib/amazon_sp_clients/v2/credentials.rb | 83 +++++++++++++ spec/amazon_sp_clients/v2/credentials_spec.rb | 113 ++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 lib/amazon_sp_clients/v2/credentials.rb create mode 100644 spec/amazon_sp_clients/v2/credentials_spec.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index 1fa81b7..3591096 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -10,6 +10,7 @@ require 'amazon_sp_clients/v2/token' require 'amazon_sp_clients/v2/error_mapper' require 'amazon_sp_clients/v2/lwa' +require 'amazon_sp_clients/v2/credentials' # Ruby clients for the Amazon Selling Partner API. module AmazonSpClients diff --git a/lib/amazon_sp_clients/v2/credentials.rb b/lib/amazon_sp_clients/v2/credentials.rb new file mode 100644 index 0000000..0807839 --- /dev/null +++ b/lib/amazon_sp_clients/v2/credentials.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require 'amazon_sp_clients/v2/token' + +module AmazonSpClients + module V2 + # Where the client gets the access token for each request. Every + # kind answers one message, +access_token+, and returns the value to + # the caller: the token is never parked on a shared object and read + # back in a second step, so a request cannot carry another thread's + # token. + module Credentials + # Asks a block for the current token before every request. This + # is the production path: the host refreshes tokens out of band + # and the block returns whatever it holds now, so a client that + # runs for hours keeps sending fresh tokens. + # + # Credentials::Callback.new { store.access_token } + # + # The block's value goes on the wire as it is; a missing token + # surfaces as Amazon's own 401 or 403. + class Callback + # @yieldreturn [String] the current access token + def initialize(&block) + raise ArgumentError, 'a block returning the access token is required' unless block + + @block = block + end + + # @return [String] + def access_token = @block.call + end + + # Exchanges a refresh token with LWA and caches the result until it + # expires. One exchange per expiry, even when many threads ask at + # once: the expiry check runs again under the lock. + class RefreshToken + # @param lwa [LWA] anything answering +exchange(refresh_token:)+ with a Token + # @param refresh_token [String] the refresh token to start from + def initialize(lwa, refresh_token) + @lwa = lwa + @initial_refresh_token = refresh_token + @token = nil + @mutex = Mutex.new + end + + # @return [String] a fresh access token, exchanging when needed + def access_token + token = @token + return token.access_token if token && !token.expired? + + @mutex.synchronize do + token = @token + return token.access_token if token && !token.expired? + + token = exchange + @token = token + token.access_token + end + end + + # The refresh token the next exchange will send: the latest one + # LWA returned, else the initial one. Persist it if it changes. + # + # @return [String] + def refresh_token + @token&.refresh_token || @initial_refresh_token + end + + private + + # LWA may leave refresh_token out of the response; keep the one + # we have, so the stored Token always knows what to send next. + def exchange + token = @lwa.exchange(refresh_token: refresh_token) + return token if token.refresh_token + + token.with(refresh_token: refresh_token) + end + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/credentials_spec.rb b/spec/amazon_sp_clients/v2/credentials_spec.rb new file mode 100644 index 0000000..3944ed1 --- /dev/null +++ b/spec/amazon_sp_clients/v2/credentials_spec.rb @@ -0,0 +1,113 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::Credentials do + v2 = AmazonSpClients::V2 + + let(:now) { Time.utc(2026, 9, 3, 12, 0, 0) } + + before { Timecop.freeze(now) } + + # A stand-in for LWA: counts exchanges, records the refresh tokens it + # was given, and can be slowed down to widen race windows. + def fake_lwa(rotate: true, delay: 0) + Class.new do + attr_reader :calls, :seen_refresh_tokens + + def initialize(rotate, delay) + @rotate = rotate + @delay = delay + @calls = 0 + @seen_refresh_tokens = [] + @mutex = Mutex.new + end + + def exchange(refresh_token:) + n = @mutex.synchronize do + @calls += 1 + @seen_refresh_tokens << refresh_token + @calls + end + sleep(@delay) if @delay.positive? + + AmazonSpClients::V2::Token.new( + access_token: "TOKEN_#{n}", token_type: 'bearer', expires_in: 3600, + expires_at: Time.now.utc + 3600, refresh_token: @rotate ? "RT#{n}" : nil + ) + end + end.new(rotate, delay) + end + + describe v2::Credentials::Callback do + it 'asks the block for the token on every call' do + tokens = %w[first second] + calls = 0 + creds = described_class.new do + calls += 1 + tokens.shift + end + + expect(creds.access_token).to eq('first') + expect(creds.access_token).to eq('second') + expect(calls).to eq(2) + end + + it 'needs a block' do + expect { described_class.new }.to raise_error(ArgumentError, /block/) + end + end + + describe v2::Credentials::RefreshToken do + let(:lwa) { fake_lwa } + let(:creds) { described_class.new(lwa, 'RT0') } + + it 'exchanges on first use and reuses the token while it is fresh' do + expect(creds.access_token).to eq('TOKEN_1') + expect(creds.access_token).to eq('TOKEN_1') + expect(lwa.calls).to eq(1) + end + + it 'exchanges again once the token counts as expired' do + creds.access_token + Timecop.freeze(now + 3600 - 60) + + expect(creds.access_token).to eq('TOKEN_2') + expect(lwa.calls).to eq(2) + end + + it 'exchanges once when many threads hit an expired token' do + slow_lwa = fake_lwa(delay: 0.02) + creds = described_class.new(slow_lwa, 'RT0') + + tokens = Array.new(8) { Thread.new { creds.access_token } }.map(&:value) + + expect(slow_lwa.calls).to eq(1) + expect(tokens.uniq).to eq(['TOKEN_1']) + end + + it 'sends the rotated refresh token on the next exchange' do + creds.access_token + Timecop.freeze(now + 3600) + creds.access_token + + expect(lwa.seen_refresh_tokens).to eq(%w[RT0 RT1]) + expect(creds.refresh_token).to eq('RT2') + end + + it 'keeps the previous refresh token when the response omits it' do + lwa = fake_lwa(rotate: false) + creds = described_class.new(lwa, 'RT0') + + creds.access_token + Timecop.freeze(now + 3600) + creds.access_token + + expect(lwa.seen_refresh_tokens).to eq(%w[RT0 RT0]) + expect(creds.refresh_token).to eq('RT0') + end + + it 'reports the initial refresh token before any exchange' do + expect(creds.refresh_token).to eq('RT0') + end + end +end From 7fa6640acb2c94a092ea270ab7164b37ce4d874e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:06:44 +0200 Subject: [PATCH 43/83] Add the V2 client, API base and RDT Client owns one Faraday connection per merchant, asks its credentials for the token on every request, and returns the same ApiResponse v1 returns, also for responses without a body. The middleware stack is left to build on the first request, so beagle_event_logger's hook still fires. Transport failures are wrapped only when they are one of the named transport exceptions; anything else passes through. Restricted data tokens become an rdt: argument. Resources are value objects, so the cache keys by value where v1 keyed by the caller's Hash and never hit for report documents. The cache holds its lock while it fetches, which is the dedup; lock order is cache, then credentials, and the tokens request itself never re-enters the cache. Api is the base class the generated V2 classes will inherit. --- lib/amazon_sp_clients/v2.rb | 3 + lib/amazon_sp_clients/v2/api.rb | 43 +++ lib/amazon_sp_clients/v2/client.rb | 167 +++++++++++ lib/amazon_sp_clients/v2/rdt.rb | 85 ++++++ spec/amazon_sp_clients/v2/api_spec.rb | 74 +++++ spec/amazon_sp_clients/v2/client_spec.rb | 350 +++++++++++++++++++++++ spec/amazon_sp_clients/v2/rdt_spec.rb | 133 +++++++++ 7 files changed, 855 insertions(+) create mode 100644 lib/amazon_sp_clients/v2/api.rb create mode 100644 lib/amazon_sp_clients/v2/client.rb create mode 100644 lib/amazon_sp_clients/v2/rdt.rb create mode 100644 spec/amazon_sp_clients/v2/api_spec.rb create mode 100644 spec/amazon_sp_clients/v2/client_spec.rb create mode 100644 spec/amazon_sp_clients/v2/rdt_spec.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index 3591096..de7a1f1 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -11,6 +11,9 @@ require 'amazon_sp_clients/v2/error_mapper' require 'amazon_sp_clients/v2/lwa' require 'amazon_sp_clients/v2/credentials' +require 'amazon_sp_clients/v2/rdt' +require 'amazon_sp_clients/v2/api' +require 'amazon_sp_clients/v2/client' # Ruby clients for the Amazon Selling Partner API. module AmazonSpClients diff --git a/lib/amazon_sp_clients/v2/api.rb b/lib/amazon_sp_clients/v2/api.rb new file mode 100644 index 0000000..c90da16 --- /dev/null +++ b/lib/amazon_sp_clients/v2/api.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'uri' + +module AmazonSpClients + module V2 + # Base class of the generated API classes. Holds the client and the + # small helpers the generated methods use to shape a request. + # + # class OrdersV0 < Api + # def get_order(order_id, rdt: nil) + # request(:get, "/orders/v0/orders/#{encode(order_id)}", rdt: rdt) + # end + # end + class Api + # @param client [Client] + def initialize(client) + @client = client + end + + private + + # @see Client#request + def request(method, path, query: {}, headers: {}, body: nil, rdt: nil) + @client.request(method, path, query: query, headers: headers, body: body, rdt: rdt) + end + + # Array parameters travel comma-separated (collectionFormat csv). + # nil stays nil so the parameter is left out; an empty array sends + # an empty value, as v1 did. + def csv(value) + return nil if value.nil? + + Array(value).join(',') + end + + # Percent-encodes one path segment; SKUs can hold spaces and slashes. + def encode(value) + URI.encode_uri_component(value.to_s) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb new file mode 100644 index 0000000..2333d8c --- /dev/null +++ b/lib/amazon_sp_clients/v2/client.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +require 'json' +require 'faraday' +require 'amazon_sp_clients/adapter_loader' +require 'amazon_sp_clients/api_response' +require 'amazon_sp_clients/v2/config' +require 'amazon_sp_clients/v2/credentials' +require 'amazon_sp_clients/v2/errors' +require 'amazon_sp_clients/v2/error_mapper' +require 'amazon_sp_clients/v2/lwa' +require 'amazon_sp_clients/v2/rdt' +require 'amazon_sp_clients/v2/token' + +module AmazonSpClients + module V2 + # One client per merchant. Owns the connection, the token source and + # the restricted-token cache, and hands out one instance of each API + # class. Safe to share across threads. + # + # client = Client.new(config) { store.access_token } + # client.orders_v0.get_orders(marketplace_ids, created_after: since) + class Client + # Tokens API operation that issues restricted data tokens. + TOKENS_PATH = '/tokens/2021-03-01/restrictedDataToken' + # Carries the access token (or the restricted data token). + ACCESS_TOKEN_HEADER = 'x-amz-access-token' + # Request timestamp Amazon asks for on every call. + DATE_HEADER = 'x-amz-date' + # Format of DATE_HEADER. + DATE_FORMAT = '%Y%m%dT%H%M%SZ' + # Request and response media type of every SP-API operation. + JSON_TYPE = 'application/json' + + # @return [Config] + attr_reader :config + + # @param config [Config] + # @param credentials [#access_token, nil] the token source; or pass a block + # @yieldreturn [String] the current access token (see Credentials::Callback) + # @raise [ArgumentError] unless exactly one token source is given + def initialize(config, credentials: nil, &token) + if credentials.nil? == token.nil? + raise ArgumentError, 'give credentials: or a block returning the access token' + end + + @config = config + @credentials = credentials || Credentials::Callback.new(&token) + @errors = ErrorMapper.new(:api) + @api = build_connection + @rdt = RDT::Cache.new + @apis = {} + @apis_mutex = Mutex.new + end + + # A client that exchanges +refresh_token+ through LWA itself, using + # the app credentials on +config+. + # + # @param config [Config] with client_id and client_secret + # @param refresh_token [String] + # @return [Client] + def self.with_refresh_token(config, refresh_token) + new(config, credentials: Credentials::RefreshToken.new(LWA.new(config), refresh_token)) + end + + # One instance of each API class per client, so they all share the + # connection. + # + # @param klass [Class] an Api subclass + # @return [Api] + def api(klass) + @apis_mutex.synchronize { @apis[klass] ||= klass.new(self) } + end + + # Sends one request and returns the parsed response. The generated + # API classes call this; consumers use them. + # + # @param method [Symbol] :get, :post, :put, :patch, :delete + # @param path [String] request path, already percent-encoded + # @param query [Hash] query parameters; nil values are left out + # @param headers [Hash] extra request headers + # @param body [Hash, Array, String, nil] JSON-encoded unless already a String + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + # @raise [Error] a ResponseError subclass on a non-2xx status, ConnectionError or + # TimeoutError when no response arrived, ParseError on a non-JSON body + def request(method, path, query: {}, headers: {}, body: nil, rdt: nil) + token = rdt ? restricted_token(rdt) : @credentials.access_token + response = send_request(method, path, query, headers.merge(auth_headers(token)), body) + + ApiResponse.new(parse(response), response) + end + + private + + def build_connection + options = { timeout: @config.timeout, open_timeout: @config.open_timeout } + headers = { + 'User-Agent' => @config.user_agent, 'Content-Type' => JSON_TYPE, 'Accept' => JSON_TYPE + } + + Faraday.new(url: @config.base_url, request: options, headers: headers) do |conn| + conn.adapter Faraday::Adapter::HTTPClient + end + end + + def auth_headers(token) + { ACCESS_TOKEN_HEADER => token, DATE_HEADER => Time.now.utc.strftime(DATE_FORMAT) } + end + + def send_request(method, path, query, headers, body) + response = @api.run_request(method, path, encode(body), headers) do |req| + req.params.update(query.compact) + end + + @errors.check!(response) + rescue *ErrorMapper::TRANSPORT_ERRORS => e + raise @errors.transport_error(e, method: method, url: "#{@config.base_url}#{path}") + end + + def encode(body) + return body if body.nil? || body.is_a?(String) + + JSON.generate(body) + end + + def parse(response) + body = response.body + return {} if body.nil? || body.empty? + + parsed = JSON.parse(body, symbolize_names: true) + parsed.is_a?(Hash) ? parsed : { payload: parsed } + rescue JSON::ParserError => e + raise ParseError.new("response body is not JSON: #{e.message}", **parse_context(response)) + end + + def parse_context(response) + { + status: response.status, + response: { status: response.status, headers: response.headers, body: response.body } + } + end + + # The Tokens API call inside the fetch goes out with the normal + # access token (no rdt:), so it never comes back to the cache lock + # that is held around it. Lock order is cache, then credentials. + def restricted_token(resources) + @rdt.fetch(resources) { fetch_restricted_token(resources) } + end + + def fetch_restricted_token(resources) + body = { restrictedResources: Array(resources).map(&:to_request) } + response = request(:post, TOKENS_PATH, body: body) + payload = response.payload + token = payload[:restrictedDataToken] + unless token + raise ParseError.new('token response has no restrictedDataToken', + **parse_context(response.response)) + end + + expires_in = payload[:expiresIn] + Token.new(access_token: token, token_type: nil, expires_in: expires_in, + expires_at: expires_in && (Time.now.utc + expires_in), refresh_token: nil) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/rdt.rb b/lib/amazon_sp_clients/v2/rdt.rb new file mode 100644 index 0000000..739cbff --- /dev/null +++ b/lib/amazon_sp_clients/v2/rdt.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +require 'amazon_sp_clients/v2/token' + +module AmazonSpClients + module V2 + # Restricted data tokens (RDT). The Tokens API issues a short-lived + # token for named restricted resources; a call that returns PII sends + # that token instead of the normal access token. + # + # client.orders_v0.get_orders(ids, rdt: RDT::ORDERS_AND_ITEMS) + # client.reports_2021.get_report_document(id, rdt: [RDT.resource('GET', path)]) + module RDT + # One restricted resource: HTTP method, path template and the PII + # data elements wanted. A value object, so equal resources make + # equal cache keys. + Resource = Data.define(:http_method, :path, :data_elements) + + class Resource + # @return [Hash] the shape the Tokens API expects + def to_request + { method: http_method, path: path, dataElements: data_elements }.compact + end + end + + # Orders with buyer info and shipping address (v1's :orders). + ORDERS = [ + Resource.new(http_method: 'GET', path: '/orders/v0/orders', + data_elements: %w[buyerInfo shippingAddress].freeze) + ].freeze + + # ORDERS plus order items with buyer info (v1's :orders_and_items). + ORDERS_AND_ITEMS = [ + *ORDERS, + Resource.new(http_method: 'GET', path: '/orders/v0/orders/{orderId}/orderItems', + data_elements: %w[buyerInfo].freeze) + ].freeze + + # @param http_method [String] e.g. 'GET' + # @param path [String] path template, e.g. '/orders/v0/orders/{orderId}' + # @param data_elements [Array, nil] PII fields wanted + # @return [Resource] + def self.resource(http_method, path, data_elements = nil) + Resource.new(http_method: http_method, path: path, data_elements: data_elements) + end + + # Restricted tokens per resource list, with expiry. One lock, held + # while a missing token is fetched, so concurrent callers for the + # same resources cause one Tokens API call. The fetch block runs + # inside the lock and must not come back to this cache. + class Cache + def initialize + @entries = {} + @mutex = Mutex.new + end + + # @param resources [Array] + # @yieldreturn [Token] a fresh restricted token, asked for on a miss + # @return [String] the restricted data token + def fetch(resources) + key = Array(resources).freeze + + @mutex.synchronize do + entry = @entries[key] + return entry.access_token if entry && !entry.expired? + + sweep + token = yield + @entries[key] = token + token.access_token + end + end + + # @return [Integer] cached tokens, expired ones included until the next miss + def size = @mutex.synchronize { @entries.size } + + private + + def sweep + @entries.delete_if { |_, token| token.expired? } + end + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/api_spec.rb b/spec/amazon_sp_clients/v2/api_spec.rb new file mode 100644 index 0000000..7a4672d --- /dev/null +++ b/spec/amazon_sp_clients/v2/api_spec.rb @@ -0,0 +1,74 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +# The base class every generated API class inherits. Exercised through a +# hand-written subclass shaped like the generator's output. +RSpec.describe AmazonSpClients::V2::Api do + v2 = AmazonSpClients::V2 + + let(:base_url) { 'https://sellingpartnerapi-na.amazon.com' } + let(:client) { v2::Client.new(v2::Config.new) { 'ACCESS' } } + let(:things_api) do + Class.new(described_class) do + def list_things(ids, next_token: nil, details: nil, rdt: nil) + query = { 'Ids' => csv(ids), 'NextToken' => next_token, 'details' => details } + + request(:get, '/things/v1/things', query: query, rdt: rdt) + end + + def get_thing(thing_id, body, x_amzn_idempotency_token:, rdt: nil) + headers = { 'x-amzn-idempotency-token' => x_amzn_idempotency_token } + path = "/things/v1/things/#{encode(thing_id)}" + + request(:post, path, headers: headers, body: body, rdt: rdt) + end + end + end + let(:api) { things_api.new(client) } + + it 'sends only the query keys that have a value, joining arrays with commas' do + stub = stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => 'A,B', 'details' => 'false' }) + .to_return(status: 200, body: '{"payload":{"things":[]}}') + + response = api.list_things(%w[A B], details: false) + + expect(stub).to have_been_requested + expect(response.payload).to eq(things: []) + end + + it 'sends an empty value for an empty array, as v1 did' do + stub = stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => '' }) + .to_return(status: 200, body: '{}') + + api.list_things([]) + + expect(stub).to have_been_requested + end + + it 'percent-encodes path parameters and passes header params and the JSON body' do + stub = stub_request(:post, "#{base_url}/things/v1/things/a%20b%2Fc") + .with(body: '{"name":"x"}', headers: { 'x-amzn-idempotency-token' => 'IDEMP' }) + .to_return(status: 204, body: '') + + response = api.get_thing('a b/c', { name: 'x' }, x_amzn_idempotency_token: 'IDEMP') + + expect(stub).to have_been_requested + expect(response).to be_a(AmazonSpClients::ApiResponse) + end + + it 'passes rdt through to the client' do + resources = [v2::RDT.resource('GET', '/things/v1/things')] + tokens = stub_request(:post, "#{base_url}/tokens/2021-03-01/restrictedDataToken") + .to_return(status: 200, body: '{"restrictedDataToken":"RDT","expiresIn":3600}') + things = stub_request(:get, "#{base_url}/things/v1/things") + .with(headers: { 'x-amz-access-token' => 'RDT' }) + .to_return(status: 200, body: '{}') + + api.list_things(nil, rdt: resources) + + expect(tokens).to have_been_requested + expect(things).to have_been_requested + end +end diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb new file mode 100644 index 0000000..761797e --- /dev/null +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -0,0 +1,350 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::Client do + v2 = AmazonSpClients::V2 + + let(:base_url) { 'https://sellingpartnerapi-na.amazon.com' } + let(:orders_url) { "#{base_url}/orders/v0/orders" } + let(:tokens_url) { "#{base_url}/tokens/2021-03-01/restrictedDataToken" } + let(:lwa_url) { 'https://api.amazon.com/auth/o2/token' } + let(:now) { Time.utc(2026, 9, 3, 12, 0, 0) } + let(:config) { v2::Config.new } + let(:client) { described_class.new(config) { 'ACCESS' } } + + before { Timecop.freeze(now) } + + def rdt_body(token = 'RDT', expires_in: 3600) + %({"restrictedDataToken":"#{token}","expiresIn":#{expires_in}}) + end + + describe 'construction' do + it 'takes a block as the token source' do + stub = stub_request(:get, orders_url).with(headers: { 'x-amz-access-token' => 'ACCESS' }) + .to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders') + + expect(stub).to have_been_requested + end + + it 'takes explicit credentials' do + creds = v2::Credentials::Callback.new { 'FROM_CREDS' } + stub = stub_request(:get, orders_url).with(headers: { 'x-amz-access-token' => 'FROM_CREDS' }) + .to_return(status: 200, body: '{}') + + described_class.new(config, credentials: creds).request(:get, '/orders/v0/orders') + + expect(stub).to have_been_requested + end + + it 'needs exactly one token source' do + creds = v2::Credentials::Callback.new { 'X' } + + expect { described_class.new(config) }.to raise_error(ArgumentError, /credentials/) + expect { described_class.new(config, credentials: creds) { 'X' } } + .to raise_error(ArgumentError, /credentials/) + end + + it 'exposes its config' do + expect(client.config).to be(config) + end + + # beagle_event_logger injects its middleware when the stack is + # locked, which must still happen at the first request, not at + # construction. + it 'leaves the middleware stack unlocked until the first request' do + conn = client.instance_variable_get(:@api) + + expect(conn.builder.locked?).to be(false) + end + + it 'applies the config timeouts to the connection' do + client = described_class.new(v2::Config.new(timeout: 7, open_timeout: 3)) { 'X' } + conn = client.instance_variable_get(:@api) + + expect(conn.options.timeout).to eq(7) + expect(conn.options.open_timeout).to eq(3) + end + end + + describe '.with_refresh_token' do + let(:config) { v2::Config.new(client_id: 'ID', client_secret: 'SECRET') } + + it 'exchanges through LWA once and sends the access token' do + lwa = stub_request(:post, lwa_url) + .with(body: hash_including('grant_type' => 'refresh_token', 'refresh_token' => 'RT')) + .to_return(status: 200, body: fixture('token_success.json')) + access_token = 'Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE' + orders = stub_request(:get, orders_url) + .with(headers: { 'x-amz-access-token' => access_token }) + .to_return(status: 200, body: '{}') + + client = described_class.with_refresh_token(config, 'RT') + 2.times { client.request(:get, '/orders/v0/orders') } + + expect(lwa).to have_been_requested.once + expect(orders).to have_been_requested.twice + end + end + + describe '#request' do + it 'sends the standard headers and a JSON body' do + stub = stub_request(:post, orders_url) + .with( + body: '{"a":1}', + headers: { + 'x-amz-access-token' => 'ACCESS', + 'x-amz-date' => '20260903T120000Z', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'User-Agent' => config.user_agent + } + ) + .to_return(status: 200, body: '{}') + + client.request(:post, '/orders/v0/orders', body: { a: 1 }) + + expect(stub).to have_been_requested + end + + it 'sends a String body as it is' do + stub = stub_request(:put, orders_url).with(body: 'raw').to_return(status: 200, body: '{}') + + client.request(:put, '/orders/v0/orders', body: 'raw') + + expect(stub).to have_been_requested + end + + it 'drops nil query values and sends false' do + stub = stub_request(:get, orders_url) + .with(query: { 'MarketplaceIds' => 'A', 'IsISPU' => 'false' }) + .to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders', + query: { 'MarketplaceIds' => 'A', 'NextToken' => nil, 'IsISPU' => false }) + + expect(stub).to have_been_requested + end + + it 'merges per-request headers' do + stub = stub_request(:get, orders_url).with(headers: { 'x-custom' => 'yes' }) + .to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders', headers: { 'x-custom' => 'yes' }) + + expect(stub).to have_been_requested + end + + it 'returns an ApiResponse with symbol keys, pagination and the rate limit' do + stub_request(:get, orders_url).to_return( + status: 200, + body: '{"payload":{"Orders":[{"AmazonOrderId":"1"}]},"pagination":{"nextToken":"N"}}', + headers: { 'x-amzn-RateLimit-Limit' => '0.0167' } + ) + + response = client.request(:get, '/orders/v0/orders') + + expect(response).to be_a(AmazonSpClients::ApiResponse) + expect(response.payload).to eq(Orders: [{ AmazonOrderId: '1' }]) + expect(response.pagination).to eq(nextToken: 'N') + expect(response.reported_rate_limit).to eq(0.0167) + end + + it 'returns an ApiResponse for an empty body' do + stub_request(:post, orders_url).to_return(status: 204, body: '', + headers: { 'x-amzn-RateLimit-Limit' => '2' }) + + response = client.request(:post, '/orders/v0/orders') + + expect(response.payload).to eq({}) + expect(response.reported_rate_limit).to eq(2.0) + end + + it 'wraps a non-object JSON body as the payload' do + stub_request(:get, orders_url).to_return(status: 200, body: '[1,2]') + + expect(client.request(:get, '/orders/v0/orders').payload).to eq([1, 2]) + end + + it 'raises ParseError on a 2xx body that is not JSON' do + stub_request(:get, orders_url).to_return(status: 200, body: '') + + expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::ParseError) + end + + it 'raises the mapped error on a non-2xx response' do + stub_request(:get, orders_url).to_return( + status: 403, body: '{"errors":[{"code":"Unauthorized","message":"Access denied"}]}' + ) + + expect { client.request(:get, '/orders/v0/orders') } + .to raise_error(v2::ForbiddenError, '403 Unauthorized: Access denied') do |err| + expect(err.request[:path]).to eq('/orders/v0/orders') + expect(err.request[:headers]['x-amz-access-token']).to eq('[FILTERED]') + end + end + + it 'wraps a timeout as TimeoutError' do + stub_request(:get, orders_url).to_timeout + + expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::TimeoutError) + end + + it 'wraps a refused connection as ConnectionError' do + stub_request(:get, orders_url).to_raise(Errno::ECONNREFUSED) + + expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::ConnectionError) + end + + # beagle_worker cancels a task by raising into the cart's thread. + it 'lets a foreign exception from the transport through unwrapped' do + cancel = Class.new(StandardError) + stub_request(:get, orders_url).to_raise(cancel.new('cancelled')) + + expect { client.request(:get, '/orders/v0/orders') }.to raise_error(cancel, 'cancelled') + end + + it 'sends each thread its own callback token' do + client = described_class.new(config) { Thread.current[:token] } + stub_request(:get, orders_url).to_return do |request| + { status: 200, body: %({"echo":"#{request.headers['X-Amz-Access-Token']}"}) } + end + + echoes = Array.new(8) do |i| + Thread.new do + Thread.current[:token] = "T#{i}" + [Thread.current[:token], client.request(:get, '/orders/v0/orders').payload[:echo]] + end + end.map(&:value) + + echoes.each { |token, echo| expect(echo).to eq(token) } + end + end + + describe '#request with rdt:' do + let(:resources) { v2::RDT::ORDERS_AND_ITEMS } + + it 'fetches a restricted token with the normal token, then uses it' do + tokens = stub_request(:post, tokens_url) + .with( + headers: { 'x-amz-access-token' => 'ACCESS' }, + body: { + restrictedResources: [ + { method: 'GET', path: '/orders/v0/orders', + dataElements: %w[buyerInfo shippingAddress] }, + { method: 'GET', path: '/orders/v0/orders/{orderId}/orderItems', + dataElements: %w[buyerInfo] } + ] + }.to_json + ) + .to_return(status: 200, body: rdt_body) + orders = stub_request(:get, orders_url).with(headers: { 'x-amz-access-token' => 'RDT' }) + .to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders', rdt: resources) + + expect(tokens).to have_been_requested + expect(orders).to have_been_requested + end + + it 'reuses the restricted token while it is fresh' do + tokens = stub_request(:post, tokens_url).to_return(status: 200, body: rdt_body) + stub_request(:get, orders_url).to_return(status: 200, body: '{}') + + 3.times { client.request(:get, '/orders/v0/orders', rdt: resources) } + + expect(tokens).to have_been_requested.once + end + + it 'fetches again once the restricted token counts as expired' do + tokens = stub_request(:post, tokens_url) + .to_return(status: 200, body: rdt_body(expires_in: 100)) + stub_request(:get, orders_url).to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders', rdt: resources) + Timecop.freeze(now + 100) + client.request(:get, '/orders/v0/orders', rdt: resources) + + expect(tokens).to have_been_requested.twice + end + + it 'keeps one token per document resource' do + tokens = stub_request(:post, tokens_url).to_return(status: 200, body: rdt_body) + stub_request(:get, %r{#{base_url}/reports/2021-06-30/documents/}) + .to_return(status: 200, body: '{}') + + %w[D1 D2 D1].each do |doc| + path = "/reports/2021-06-30/documents/#{doc}" + client.request(:get, path, rdt: [v2::RDT.resource('GET', path)]) + end + + expect(tokens).to have_been_requested.twice + end + + it 'fetches once when many threads need the same restricted token' do + fetches = 0 + lock = Mutex.new + stub_request(:post, tokens_url).to_return do + lock.synchronize { fetches += 1 } + sleep(0.02) + { status: 200, body: rdt_body } + end + stub_request(:get, orders_url).to_return(status: 200, body: '{}') + + Array.new(6) { Thread.new { client.request(:get, '/orders/v0/orders', rdt: resources) } } + .each(&:join) + + expect(fetches).to eq(1) + end + + it 'raises the mapped error when the token request fails' do + stub_request(:post, tokens_url) + .to_return(status: 403, body: '{"errors":[{"code":"Unauthorized","message":"no"}]}') + + expect { client.request(:get, '/orders/v0/orders', rdt: resources) } + .to raise_error(v2::ForbiddenError) do |err| + expect(err.request[:path]).to eq('/tokens/2021-03-01/restrictedDataToken') + end + end + + it 'raises ParseError when the token response has no token' do + stub_request(:post, tokens_url).to_return(status: 200, body: '{"expiresIn":3600}') + + expect { client.request(:get, '/orders/v0/orders', rdt: resources) } + .to raise_error(v2::ParseError, /restrictedDataToken/) + end + + # The cache lock is held while the token request runs, and that + # request asks the credentials for the LWA token. Both locks nest in + # that order only, so an expired LWA token on an RDT miss must not + # deadlock. + it 'refreshes an expired LWA token inside a restricted token fetch' do + config = v2::Config.new(client_id: 'ID', client_secret: 'SECRET') + lwa = stub_request(:post, lwa_url).to_return(status: 200, body: fixture('token_success.json')) + tokens = stub_request(:post, tokens_url).to_return(status: 200, body: rdt_body) + stub_request(:get, orders_url).to_return(status: 200, body: '{}') + + client = described_class.with_refresh_token(config, 'RT') + client.request(:get, '/orders/v0/orders', rdt: resources) + + expect(lwa).to have_been_requested.once + expect(tokens).to have_been_requested.once + end + end + + describe '#api' do + let(:api_class) { Class.new(v2::Api) } + + it 'builds one instance per class and reuses it' do + expect(client.api(api_class)).to be_a(api_class) + expect(client.api(api_class)).to be(client.api(api_class)) + end + + it 'returns the same instance to every thread' do + instances = Array.new(8) { Thread.new { client.api(api_class) } }.map(&:value) + + expect(instances.uniq.size).to eq(1) + end + end +end diff --git a/spec/amazon_sp_clients/v2/rdt_spec.rb b/spec/amazon_sp_clients/v2/rdt_spec.rb new file mode 100644 index 0000000..5d93f0b --- /dev/null +++ b/spec/amazon_sp_clients/v2/rdt_spec.rb @@ -0,0 +1,133 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +RSpec.describe AmazonSpClients::V2::RDT do + v2 = AmazonSpClients::V2 + + let(:now) { Time.utc(2026, 9, 3, 12, 0, 0) } + + before { Timecop.freeze(now) } + + def token(value, expires_in: 3600) + AmazonSpClients::V2::Token.new(access_token: value, token_type: nil, expires_in: expires_in, + expires_at: Time.now.utc + expires_in, refresh_token: nil) + end + + describe '.resource' do + it 'builds a frozen value object' do + resource = described_class.resource('GET', '/reports/2021-06-30/documents/DOC1') + + expect(resource).to be_frozen + expect(resource.http_method).to eq('GET') + expect(resource.path).to eq('/reports/2021-06-30/documents/DOC1') + expect(resource.data_elements).to be_nil + end + + it 'compares by value' do + a = described_class.resource('GET', '/x', %w[buyerInfo]) + b = described_class.resource('GET', '/x', %w[buyerInfo]) + + expect(a).to eq(b) + expect(a.hash).to eq(b.hash) + end + + it 'renders the Tokens API shape, leaving out empty data elements' do + expect(described_class.resource('GET', '/x', %w[buyerInfo]).to_request) + .to eq(method: 'GET', path: '/x', dataElements: %w[buyerInfo]) + expect(described_class.resource('GET', '/x').to_request).to eq(method: 'GET', path: '/x') + end + end + + describe 'presets' do + it 'match the v1 RESTRICTED_OPS' do + expect(described_class::ORDERS.map(&:to_request)).to eq( + [{ method: 'GET', path: '/orders/v0/orders', dataElements: %w[buyerInfo shippingAddress] }] + ) + expect(described_class::ORDERS_AND_ITEMS.map(&:to_request)).to eq( + [ + { method: 'GET', path: '/orders/v0/orders', dataElements: %w[buyerInfo shippingAddress] }, + { method: 'GET', path: '/orders/v0/orders/{orderId}/orderItems', + dataElements: %w[buyerInfo] } + ] + ) + end + + it 'are frozen' do + expect(described_class::ORDERS).to be_frozen + expect(described_class::ORDERS_AND_ITEMS).to be_frozen + end + end + + describe described_class::Cache do + let(:cache) { described_class.new } + let(:orders) { v2::RDT::ORDERS } + + it 'fetches once and reuses the token while it is fresh' do + fetches = 0 + + first = cache.fetch(orders) do + fetches += 1 + token('RDT1') + end + second = cache.fetch(orders) do + fetches += 1 + token('RDT2') + end + + expect([first, second]).to eq(%w[RDT1 RDT1]) + expect(fetches).to eq(1) + end + + it 'keys by value, so equal resource lists share an entry' do + cache.fetch([v2::RDT.resource('GET', '/reports/2021-06-30/documents/D1')]) { token('RDT1') } + + value = cache.fetch([v2::RDT.resource('GET', '/reports/2021-06-30/documents/D1')]) do + token('RDT2') + end + + expect(value).to eq('RDT1') + end + + it 'keeps separate tokens for different resource lists' do + cache.fetch(orders) { token('RDT1') } + + value = cache.fetch(v2::RDT::ORDERS_AND_ITEMS) { token('RDT2') } + + expect(value).to eq('RDT2') + end + + it 'fetches again once the token counts as expired' do + cache.fetch(orders) { token('RDT1') } + Timecop.freeze(now + 3600 - 60) + + expect(cache.fetch(orders) { token('RDT2') }).to eq('RDT2') + end + + it 'drops expired entries on a miss' do + cache.fetch([v2::RDT.resource('GET', '/documents/D1')]) { token('RDT1', expires_in: 100) } + Timecop.freeze(now + 200) + + cache.fetch([v2::RDT.resource('GET', '/documents/D2')]) { token('RDT2') } + + expect(cache.size).to eq(1) + end + + it 'fetches once when many threads miss at the same time' do + fetches = 0 + lock = Mutex.new + + values = Array.new(6) do + Thread.new do + cache.fetch(orders) do + lock.synchronize { fetches += 1 } + sleep(0.02) + token('RDT1') + end + end + end.map(&:value) + + expect(fetches).to eq(1) + expect(values.uniq).to eq(['RDT1']) + end + end +end From 6cfcc78e8d21341d9f1b6b4163f1d2a9223f16e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:10:19 +0200 Subject: [PATCH 44/83] Add V2 document helpers Feed upload, feed result download and report download against the presigned S3 urls, on the client's own connection with its timeouts and without the access token. Report documents come back UTF-8 tagged when gzipped: Zlib.gunzip returns binary, and active_cart's own gunzip gives UTF-8, so a consumer that stops inflating itself sees the same strings. Feed results keep the string-keyed Hash consumers dig into. Three examples talk to a real local socket, because WebMock hides how the adapter writes the body and what it raises when the server drops the connection. --- lib/amazon_sp_clients/v2.rb | 1 + lib/amazon_sp_clients/v2/client.rb | 31 +++ lib/amazon_sp_clients/v2/documents.rb | 100 ++++++++++ spec/amazon_sp_clients/v2/documents_spec.rb | 207 ++++++++++++++++++++ 4 files changed, 339 insertions(+) create mode 100644 lib/amazon_sp_clients/v2/documents.rb create mode 100644 spec/amazon_sp_clients/v2/documents_spec.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index de7a1f1..0eaed2d 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -12,6 +12,7 @@ require 'amazon_sp_clients/v2/lwa' require 'amazon_sp_clients/v2/credentials' require 'amazon_sp_clients/v2/rdt' +require 'amazon_sp_clients/v2/documents' require 'amazon_sp_clients/v2/api' require 'amazon_sp_clients/v2/client' diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb index 2333d8c..3028afc 100644 --- a/lib/amazon_sp_clients/v2/client.rb +++ b/lib/amazon_sp_clients/v2/client.rb @@ -6,6 +6,7 @@ require 'amazon_sp_clients/api_response' require 'amazon_sp_clients/v2/config' require 'amazon_sp_clients/v2/credentials' +require 'amazon_sp_clients/v2/documents' require 'amazon_sp_clients/v2/errors' require 'amazon_sp_clients/v2/error_mapper' require 'amazon_sp_clients/v2/lwa' @@ -48,6 +49,7 @@ def initialize(config, credentials: nil, &token) @credentials = credentials || Credentials::Callback.new(&token) @errors = ErrorMapper.new(:api) @api = build_connection + @documents = Documents.new(config) @rdt = RDT::Cache.new @apis = {} @apis_mutex = Mutex.new @@ -91,6 +93,35 @@ def request(method, path, query: {}, headers: {}, body: nil, rdt: nil) ApiResponse.new(parse(response), response) end + # Uploads feed content to the presigned url of a feed document. + # + # @param document [Hash] payload of createFeedDocument + # @param content_type [String] the one given to createFeedDocument + # @param body [String] feed content + # @return [nil] + # @see Documents#upload + def upload_feed_document(document, content_type, body) + @documents.upload(document, content_type, body) + end + + # Downloads and parses the processing report of a feed. + # + # @param document [Hash] payload of getFeedDocument + # @return [Hash] string-keyed + # @see Documents#download_feed_result + def download_feed_result(document) + @documents.download_feed_result(document) + end + + # Downloads a report document, inflating it when gzipped. + # + # @param document [Hash] payload of getReportDocument + # @return [String] + # @see Documents#download_report_document + def download_report_document(document) + @documents.download_report_document(document) + end + private def build_connection diff --git a/lib/amazon_sp_clients/v2/documents.rb b/lib/amazon_sp_clients/v2/documents.rb new file mode 100644 index 0000000..b20675c --- /dev/null +++ b/lib/amazon_sp_clients/v2/documents.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +require 'json' +require 'zlib' +require 'faraday' +require 'multi_xml' +require 'amazon_sp_clients/adapter_loader' +require 'amazon_sp_clients/v2/config' +require 'amazon_sp_clients/v2/errors' +require 'amazon_sp_clients/v2/error_mapper' + +module AmazonSpClients + module V2 + # Feed and report documents live on presigned S3 urls: outside the + # SP-API host, without the access token. A feed goes out in three + # steps (create the document, PUT the content to its url, create the + # feed); feed results and reports come back by GET, gzipped when the + # document says so. + # + # Every +document+ argument is the payload Hash the Feeds or Reports + # API returned for it (+:url+, +:compressionAlgorithm+). + class Documents + # Value of +compressionAlgorithm+ for gzipped documents. + GZIP = 'GZIP' + CONTENT_TYPE_HEADER = 'Content-Type' + JSON_TYPES = /json/i + + # @param config [Config] timeouts and user agent + def initialize(config) + @config = config + @errors = ErrorMapper.new(:documents) + @conn = build_connection + end + + # @param document [Hash] payload of createFeedDocument + # @param content_type [String] the one given to createFeedDocument + # @param body [String] feed content + # @return [nil] + # @raise [DocumentError, ConnectionError] + def upload(document, content_type, body) + send_request(:put, document.fetch(:url), body, CONTENT_TYPE_HEADER => content_type) + + nil + end + + # @param document [Hash] payload of getFeedDocument + # @return [Hash] the processing report, string-keyed; JSON or XML by content type + # @raise [DocumentError, ConnectionError] + def download_feed_result(document) + response = fetch(document) + + parse(inflate(response.body, document), response.headers[CONTENT_TYPE_HEADER]) + end + + # @param document [Hash] payload of getReportDocument + # @return [String] the report; UTF-8 tagged when it was gzipped, + # otherwise as delivered + # @raise [DocumentError, ConnectionError] + def download_report_document(document) + inflate(fetch(document).body, document) + end + + private + + def build_connection + options = { timeout: @config.timeout, open_timeout: @config.open_timeout } + headers = { 'User-Agent' => @config.user_agent } + + Faraday.new(request: options, headers: headers) do |conn| + conn.adapter Faraday::Adapter::HTTPClient + end + end + + def fetch(document) + send_request(:get, document.fetch(:url), nil, {}) + end + + def send_request(method, url, body, headers) + response = @conn.run_request(method, url, body, headers) + + @errors.check!(response) + rescue *ErrorMapper::TRANSPORT_ERRORS => e + raise @errors.transport_error(e, method: method, url: url) + end + + # Zlib.gunzip returns binary; the documents are text. + def inflate(body, document) + return body unless document[:compressionAlgorithm].to_s.casecmp?(GZIP) + + Zlib.gunzip(body).force_encoding(Encoding::UTF_8) + end + + def parse(body, content_type) + return JSON.parse(body) if content_type.to_s.match?(JSON_TYPES) + + MultiXml.parse(body) + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/documents_spec.rb b/spec/amazon_sp_clients/v2/documents_spec.rb new file mode 100644 index 0000000..e265732 --- /dev/null +++ b/spec/amazon_sp_clients/v2/documents_spec.rb @@ -0,0 +1,207 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' +require 'socket' +require 'zlib' + +RSpec.describe AmazonSpClients::V2::Documents do + v2 = AmazonSpClients::V2 + + let(:config) { v2::Config.new(timeout: 5, open_timeout: 2) } + let(:documents) { described_class.new(config) } + let(:url) { 'https://tortuga-prod-na.s3.amazonaws.com/doc?X-Amz-Signature=SECRET' } + let(:document) { { url: url, feedDocumentId: 'amzn1.tortuga.3.x' } } + + describe '#upload' do + it 'PUTs the body to the presigned url with the content type' do + stub = stub_request(:put, url) + .with(body: '', headers: { 'Content-Type' => 'text/xml; charset=UTF-8' }) + .to_return(status: 200, body: '') + + expect(documents.upload(document, 'text/xml; charset=UTF-8', '')).to be_nil + expect(stub).to have_been_requested + end + + it 'raises DocumentError with the credential stripped from the url' do + stub_request(:put, url).to_return(status: [403, 'Forbidden'], body: '') + + expect { documents.upload(document, 'text/xml', '') } + .to raise_error(v2::DocumentError, '403 Forbidden') do |err| + expect(err.request[:url]).not_to include('SECRET') + end + end + end + + describe '#download_feed_result' do + it 'parses a JSON document into a string-keyed Hash' do + stub_request(:get, url).to_return( + status: 200, body: '{"header":{"sellerId":"A1"},"issues":[]}', + headers: { 'Content-Type' => 'application/json' } + ) + + expect(documents.download_feed_result(document)) + .to eq('header' => { 'sellerId' => 'A1' }, 'issues' => []) + end + + it 'parses an XML document' do + xml = '' + stub_request(:get, url).to_return(status: 200, body: xml, + headers: { 'Content-Type' => 'text/xml' }) + + result = documents.download_feed_result(document) + + expect(result.dig('AmazonEnvelope', 'Message')).to have_key('ProcessingReport') + end + + it 'inflates a gzipped document first' do + stub_request(:get, url).to_return(status: 200, body: Zlib.gzip('{"ok":true}'), + headers: { 'Content-Type' => 'application/json' }) + + result = documents.download_feed_result(document.merge(compressionAlgorithm: 'GZIP')) + + expect(result).to eq('ok' => true) + end + end + + describe '#download_report_document' do + it 'returns an uncompressed body as delivered' do + stub_request(:get, url).to_return(status: 200, body: "sku\tqty\nA\t1\n") + + expect(documents.download_report_document(document)).to eq("sku\tqty\nA\t1\n") + end + + it 'inflates a gzipped body and tags it UTF-8' do + stub_request(:get, url).to_return(status: 200, body: Zlib.gzip("sku\nCAFÉ-1\n")) + + result = documents.download_report_document(document.merge(compressionAlgorithm: 'GZIP')) + + expect(result).to eq("sku\nCAFÉ-1\n") + expect(result.encoding).to eq(Encoding::UTF_8) + expect(result).to be_valid_encoding + end + + it 'raises DocumentError on a failed download' do + stub_request(:get, url).to_return(status: 404, body: '') + + expect { documents.download_report_document(document) }.to raise_error(v2::DocumentError) + end + + it 'wraps a timeout as TimeoutError' do + stub_request(:get, url).to_timeout + + expect { documents.download_report_document(document) }.to raise_error(v2::TimeoutError) + end + end + + # WebMock hides how the adapter puts bytes on the wire, so these talk + # to a real local socket. + describe 'on a real socket' do + around do |example| + WebMock.disable_net_connect!(allow_localhost: true) + example.run + ensure + WebMock.disable_net_connect! + end + + # Serves exactly one connection with +handler+, then yields the base url. + def with_server(handler) + server = TCPServer.new('127.0.0.1', 0) + thread = Thread.new do + socket = server.accept + begin + handler.call(socket) + ensure + socket.close + end + end + + yield "http://127.0.0.1:#{server.addr[1]}" + thread.join(2) + ensure + server.close + end + + def read_request(socket) + head = +'' + head << socket.readpartial(4096) until head.include?("\r\n\r\n") + headers, body = head.split("\r\n\r\n", 2) + length = headers[/^Content-Length: (\d+)/i, 1].to_i + body << socket.read(length - body.bytesize) if body.bytesize < length + [headers, body] + end + + it 'sends the upload body and headers intact' do + seen = nil + handler = lambda do |socket| + seen = read_request(socket) + socket.write("HTTP/1.1 200 OK\r\nContent-Length: 0\r\nConnection: close\r\n\r\n") + end + + with_server(handler) do |base| + documents.upload({ url: "#{base}/doc?sig=1" }, 'text/xml; charset=UTF-8', "é\n") + end + + headers, body = seen + expect(headers).to start_with('PUT /doc?sig=1 HTTP/1.1') + expect(headers).to include("\r\nContent-Type: text/xml; charset=UTF-8\r\n") + expect(headers).to include("\r\nContent-Length: 10\r\n") + expect(body.b).to eq("é\n".b) + end + + # Runs one download against a server driven by +handler+ and returns + # the V2 error it raised. + def download_error(handler) + with_server(handler) do |base| + documents.download_report_document({ url: "#{base}/doc" }) + rescue AmazonSpClients::V2::Error => e + return e + end + nil + end + + it 'wraps a connection the server drops before answering' do + err = download_error(->(_socket) {}) + + expect(err).to be_a(v2::ConnectionError) + expect(v2::ErrorMapper::TRANSPORT_ERRORS.any? { |klass| err.cause.is_a?(klass) }).to be(true) + end + + it 'wraps a response cut off inside the headers' do + handler = lambda do |socket| + read_request(socket) + socket.write("HTTP/1.1 200 OK\r\nX-A: 1\r\n") + end + + err = download_error(handler) + + expect(err).to be_a(v2::ConnectionError) + expect(err.status).to be_nil + expect(err.cause).to be_a(Faraday::ClientError) + end + end +end + +RSpec.describe AmazonSpClients::V2::Client, 'documents' do + let(:client) { described_class.new(AmazonSpClients::V2::Config.new) { 'ACCESS' } } + let(:url) { 'https://tortuga-prod-na.s3.amazonaws.com/doc?X-Amz-Signature=SECRET' } + + it 'uploads, downloads feed results and downloads report documents' do + put = stub_request(:put, url).with(body: 'feed').to_return(status: 200, body: '') + stub_request(:get, url).to_return(status: 200, body: '{"a":1}', + headers: { 'Content-Type' => 'application/json' }) + + client.upload_feed_document({ url: url }, 'text/xml', 'feed') + + expect(put).to have_been_requested + expect(client.download_feed_result({ url: url })).to eq('a' => 1) + expect(client.download_report_document({ url: url })).to eq('{"a":1}') + end + + it 'does not send the access token to S3' do + stub = stub_request(:get, url).with { |req| !req.headers.key?('X-Amz-Access-Token') } + .to_return(status: 200, body: '') + + client.download_report_document({ url: url }) + + expect(stub).to have_been_requested + end +end From 4de94043ac71d216b6a8b9b771109ee2a12df58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:20:43 +0200 Subject: [PATCH 45/83] Add the V2 template set to the generator Each config entry now lists its template sets. v1 output is unchanged; V2 renders one class per module under lib/amazon_sp_clients/v2/apis/, plus an entry file with an autoload and a Client accessor per module. Required parameters stay positional in v1 order, optional ones become keywords, and every method takes rdt:. nil keywords are left off the wire, as v1 did. A name guard fails generation when Amazon introduces a name Ruby or the V2 signature already uses, and the generator now refuses to run while tracked generated files belong to no configured module. The templates are pinned by a spec that renders a small fixture and loads the result. --- .rubocop.yml | 3 + codegen-config.yml | 14 ++ lib/generator.rb | 59 ++++++- lib/generator/api_module.rb | 78 +++++++-- lib/generator/names.rb | 63 +++++++ lib/generator/naming.rb | 5 + lib/generator/operation.rb | 70 +++++++- lib/generator/param.rb | 27 +++ lib/generator/templates/v2_api_class.erb | 18 ++ lib/generator/templates/v2_apis.erb | 24 +++ lib/generator/templates/v2_operation.erb | 27 +++ spec/fixtures/generator/things.json | 110 ++++++++++++ spec/generator/v2_spec.rb | 210 +++++++++++++++++++++++ 13 files changed, 686 insertions(+), 22 deletions(-) create mode 100644 lib/generator/names.rb create mode 100644 lib/generator/templates/v2_api_class.erb create mode 100644 lib/generator/templates/v2_apis.erb create mode 100644 lib/generator/templates/v2_operation.erb create mode 100644 spec/fixtures/generator/things.json create mode 100644 spec/generator/v2_spec.rb diff --git a/.rubocop.yml b/.rubocop.yml index 999b74a..5b8ba34 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,6 +13,9 @@ AllCops: - gemfiles/**/* # Autogenerated require shims; the Rakefile writes them. - lib/amazon_sp_clients/sp_*.rb + # Generated V2 API classes and their entry file; the generator writes them. + - lib/amazon_sp_clients/v2/apis/**/* + - lib/amazon_sp_clients/v2/apis.rb # Start permissive on the handwritten code; tighten later. Metrics: diff --git a/codegen-config.yml b/codegen-config.yml index c29070c..dc14efe 100644 --- a/codegen-config.yml +++ b/codegen-config.yml @@ -6,42 +6,56 @@ list_of_apis: - name: fba_inventory path: fba-inventory-api-model/fbaInventory.json + templates: [v1, v2] - name: feeds_2021 path: feeds-api-model/feeds_2021-06-30.json + templates: [v1, v2] - name: fulfillment_outbound_2020 path: fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json + templates: [v1, v2] - name: listings_items_2021 path: listings-items-api-model/listingsItems_2021-08-01.json + templates: [v1, v2] - name: orders_v0 path: orders-api-model/ordersV0.json + templates: [v1, v2] - name: reports_2021 path: reports-api-model/reports_2021-06-30.json + templates: [v1, v2] - name: tokens_2021 path: tokens-api-model/tokens_2021-03-01.json + templates: [v1, v2] - name: vdf_inventory_v1 path: vendor-direct-fulfillment-inventory-api-model/vendorDirectFulfillmentInventoryV1.json + templates: [v1, v2] - name: vdf_orders_v1 path: vendor-direct-fulfillment-orders-api-model/vendorDirectFulfillmentOrdersV1.json + templates: [v1, v2] - name: vdf_shipping_v1 path: vendor-direct-fulfillment-shipping-api-model/vendorDirectFulfillmentShippingV1.json + templates: [v1, v2] - name: vendor_invoices path: vendor-invoices-api-model/vendorInvoices.json + templates: [v1, v2] - name: vendor_orders path: vendor-orders-api-model/vendorOrders.json + templates: [v1, v2] - name: vendor_transaction_status path: vendor-transaction-status-api-model/vendorTransactionStatus.json + templates: [v1, v2] - name: vendors_shipments path: vendor-shipments-api-model/vendorShipments.json + templates: [v1, v2] diff --git a/lib/generator.rb b/lib/generator.rb index a51df47..ca30082 100644 --- a/lib/generator.rb +++ b/lib/generator.rb @@ -1,17 +1,31 @@ # frozen_string_literal: true +require 'erb' require 'logger' +require 'open3' require 'yaml' -# Regenerates the committed API clients under vendor/ from Amazon's -# OpenAPI specs, checked out at the revision pinned in -# selling-partner-api-models.sha. Pure Ruby + ERB; no Java. +# Regenerates the committed API clients from Amazon's OpenAPI specs, +# checked out at the revision pinned in selling-partner-api-models.sha. +# Pure Ruby + ERB; no Java. Two template sets: v1 writes vendor/ and the +# sp_*.rb shims, V2 writes lib/amazon_sp_clients/v2/apis/. # # Not shipped with the gem. Entry points are the rake tasks: # `generate`, `generate:setup`, `generate:update`, `generate:verify`. module Generator BASE_PATH = File.expand_path('..', __dir__) CONFIG_FILE = File.join(BASE_PATH, 'codegen-config.yml') + V2_APIS_DIR = File.join(BASE_PATH, 'lib', 'amazon_sp_clients', 'v2', 'apis') + V2_APIS_FILE = File.join(BASE_PATH, 'lib', 'amazon_sp_clients', 'v2', 'apis.rb') + + # Everything tracked under these paths is generated output, and every + # file there must belong to a module in codegen-config.yml. + GENERATED_ROOTS = %w[ + vendor + lib/amazon_sp_clients/sp_*.rb + lib/amazon_sp_clients/v2/apis + lib/amazon_sp_clients/v2/apis.rb + ].freeze require_relative 'generator/specs' require_relative 'generator/api_module' @@ -27,19 +41,29 @@ def setup def generate setup + check_owned! api_modules.each(&:generate) + File.write(V2_APIS_FILE, render_v2_apis(api_modules)) logger.info("Generated #{api_modules.size} API modules") end # Paths the generator owns; `rake generate:verify` checks that # regeneration leaves them identical to the committed tree. def generated_paths - api_modules.flat_map(&:owned_paths) + api_modules.flat_map(&:owned_paths) + [relative(V2_APIS_FILE)] + end + + # Source of lib/amazon_sp_clients/v2/apis.rb: an autoload per V2 + # class and a Client accessor per module. + def render_v2_apis(modules) + template = File.read(File.join(__dir__, 'generator', 'templates', 'v2_apis.erb')) + ERB.new(template, trim_mode: '-').result_with_hash(modules: modules.select(&:v2?)) end def api_modules @api_modules ||= config.fetch('list_of_apis').map do |entry| - ApiModule.new(name: entry.fetch('name'), spec_path: entry.fetch('path')) + ApiModule.new(name: entry.fetch('name'), spec_path: entry.fetch('path'), + templates: entry.fetch('templates')) end end @@ -48,5 +72,30 @@ def api_modules def config YAML.load_file(CONFIG_FILE) end + + # A module removed from the config leaves its output behind, tracked + # but never regenerated or verified. Abort before writing anything. + def check_owned! + owned = generated_paths + stale = tracked_files.reject do |file| + owned.any? { |path| file == path || file.start_with?("#{path}/") } + end + return if stale.empty? + + raise "Generated files no module in codegen-config.yml owns:\n #{stale.join("\n ")}\n" \ + 'Remove them with git rm, or add the module back.' + end + + def tracked_files + stdout, stderr, status = Open3.capture3('git', '-C', BASE_PATH, 'ls-files', '--', + *GENERATED_ROOTS) + raise "git ls-files failed: #{stderr}" unless status.success? + + stdout.split("\n") + end + + def relative(path) + path.delete_prefix("#{BASE_PATH}/") + end end end diff --git a/lib/generator/api_module.rb b/lib/generator/api_module.rb index 579bc55..0fb2304 100644 --- a/lib/generator/api_module.rb +++ b/lib/generator/api_module.rb @@ -4,29 +4,79 @@ require 'fileutils' require 'json' +require_relative 'names' require_relative 'naming' require_relative 'operation' require_relative 'specs' module Generator - # One entry from codegen-config.yml: a vendored API module generated - # from one Amazon OpenAPI spec file. Owns three kinds of files: + # One entry from codegen-config.yml: an API module generated from one + # Amazon OpenAPI spec file, in one or both template sets. # + # v1 (the swagger-codegen shape, one class per spec tag): # vendor//lib/sp_.rb entry file (requires the APIs) - # vendor//lib/sp_/api/*.rb one class per spec tag + # vendor//lib/sp_/api/*.rb API classes # lib/amazon_sp_clients/sp_.rb require shim for the main gem + # + # v2 (AmazonSpClients::V2, one class per module): + # lib/amazon_sp_clients/v2/apis/.rb class ApiModule - attr_reader :name, :spec_path + TEMPLATES = %w[v1 v2].freeze + + attr_reader :name, :spec_path, :templates + + def initialize(name:, spec_path:, templates:, models_dir: Specs.models_dir) + unknown = templates - TEMPLATES + raise ArgumentError, "unknown templates #{unknown.inspect} for #{name}" unless unknown.empty? + raise ArgumentError, "no templates listed for #{name}" if templates.empty? - def initialize(name:, spec_path:) @name = name @spec_path = spec_path + @templates = templates + @models_dir = models_dir end def gem_name = "sp_#{name}" def module_name = "Sp#{Naming.camelize(name)}" + def v2_class_name = Naming.camelize(name) + def v1? = templates.include?('v1') + def v2? = templates.include?('v2') + + # The spec title, for the V2 entry file. + def title = spec.fetch('info').fetch('title').strip def generate + generate_v1 if v1? + generate_v2 if v2? + + Generator.logger.info("Generated #{name} (#{templates.join(', ')})") + end + + # Relative paths checked by `rake generate:verify`. + def owned_paths + paths = [] + paths.push(entry_path, api_dir, shim_path) if v1? + paths << v2_path if v2? + paths.map { |p| p.delete_prefix("#{BASE_PATH}/") } + end + + # Source of the V2 class: every operation of the spec in one class, + # sorted by method name. + def render_v2 + Names.check_module!(name) + Names.check_unique!(operations.map(&:operation_id), what: 'operationId') + + render('v2_api_class.erb', + title: title, + description: Naming.oneline(spec.fetch('info')['description']), + version: spec.fetch('info').fetch('version'), + class_name: v2_class_name, + operations: operations.map(&:render_v2).join("\n")) + end + + private + + def generate_v1 FileUtils.rm_rf(api_dir) FileUtils.mkdir_p(api_dir) @@ -43,19 +93,15 @@ def generate File.write(entry_path, render('vendor_entry.erb', header_locals.merge(api_requires: api_requires))) File.write(shim_path, render('shim.erb', name: name, gem_name: gem_name)) - - Generator.logger.info("Generated #{name} (#{classes.size} classes)") end - # Relative paths checked by `rake generate:verify`. - def owned_paths - [entry_path, api_dir, shim_path].map { |p| p.delete_prefix("#{BASE_PATH}/") } + def generate_v2 + FileUtils.mkdir_p(File.dirname(v2_path)) + File.write(v2_path, render_v2) end - private - def spec - @spec ||= JSON.parse(File.read(File.join(Specs.models_dir, spec_path))) + @spec ||= JSON.parse(File.read(File.join(@models_dir, spec_path))) end # Operations grouped into classes by their first tag (first-seen tag @@ -82,6 +128,11 @@ def classes end end + # Every operation of the spec, tags merged. + def operations + classes.values.flatten.sort_by(&:method_name) + end + def api_requires classes.keys.map { |class_name| "#{gem_name}/api/#{Naming.underscore(class_name)}" }.sort end @@ -104,5 +155,6 @@ def vendor_lib = File.join(BASE_PATH, 'vendor', name, 'lib') def api_dir = File.join(vendor_lib, gem_name, 'api') def entry_path = File.join(vendor_lib, "#{gem_name}.rb") def shim_path = File.join(BASE_PATH, 'lib', 'amazon_sp_clients', "#{gem_name}.rb") + def v2_path = File.join(Generator::V2_APIS_DIR, "#{name}.rb") end end diff --git a/lib/generator/names.rb b/lib/generator/names.rb new file mode 100644 index 0000000..8d49cfb --- /dev/null +++ b/lib/generator/names.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +require 'amazon_sp_clients/v2/api' +require 'amazon_sp_clients/v2/client' +require_relative 'naming' + +module Generator + # Guards the names the V2 templates emit. Amazon renames parameters + # and operations over time; a bad name must fail generation, not the + # first production call. + module Names + RUBY_KEYWORDS = %w[ + BEGIN END alias and begin break case class def defined? do else elsif end ensure + false for if in module next nil not or redo rescue retry return self super then + true undef unless until when while yield __FILE__ __LINE__ __ENCODING__ + ].freeze + + # Every generated method already takes these. + SIGNATURE_NAMES = %w[rdt body].freeze + + # The generated accessors live here; they are not collisions. + APIS_FILE = %r{/v2/apis\.rb\z} + + module_function + + # A parameter that is not the body: positional or keyword. + def check_param!(name, operation:) + return unless RUBY_KEYWORDS.include?(name) || SIGNATURE_NAMES.include?(name) + + raise "Parameter #{name.inspect} of #{operation} cannot be a method argument" + end + + def check_method!(name) + taken = RUBY_KEYWORDS.include?(name) || methods_of(AmazonSpClients::V2::Api).include?(name) + return unless taken + + raise "Operation #{name.inspect} collides with a Ruby or Api method" + end + + def check_module!(name) + return unless methods_of(AmazonSpClients::V2::Client).include?(name) + + raise "Module #{name.inspect} collides with a Client method" + end + + # @param raw_names [Array] names as the spec spells them + def check_unique!(raw_names, what:) + raw_names.group_by { |raw| Naming.underscore(raw) }.each do |snake, group| + next if group.size == 1 + + raise "#{what} names #{group.join(', ')} all become #{snake}" + end + end + + # Public and private instance method names, except the accessors the + # generator itself writes into Client. + def methods_of(klass) + (klass.instance_methods + klass.private_instance_methods).map(&:to_s).reject do |name| + klass.instance_method(name).source_location&.first&.match?(APIS_FILE) + end + end + end +end diff --git a/lib/generator/naming.rb b/lib/generator/naming.rb index e6118d6..bfc4770 100644 --- a/lib/generator/naming.rb +++ b/lib/generator/naming.rb @@ -35,5 +35,10 @@ def escape(str) def flatten(str) str.to_s.tr("\n", ' ').gsub('"', '\"') end + + # Doc text for the V2 templates: one line, nothing escaped. + def oneline(str) + str.to_s.split(/\s*\n\s*/).join(' ').strip + end end end diff --git a/lib/generator/operation.rb b/lib/generator/operation.rb index 55e06dc..61d6f40 100644 --- a/lib/generator/operation.rb +++ b/lib/generator/operation.rb @@ -2,18 +2,20 @@ require 'erb' +require_relative 'names' require_relative 'naming' require_relative 'param' module Generator - # One API operation. Renders the convenience method plus the + # One API operation. For v1 it renders the convenience method plus the # `_with_http_info` variant through templates/operation.erb, matching - # the layout swagger-codegen used to emit. + # the layout swagger-codegen used to emit. For V2 it renders one + # method through templates/v2_operation.erb. class Operation HTTP_VERBS = %w[get put post delete patch head options].freeze INDENT = ' ' - attr_reader :class_name, :method_name, :http_method + attr_reader :class_name, :method_name, :http_method, :operation_id, :verb def self.template @template ||= ERB.new( @@ -21,13 +23,20 @@ def self.template ) end + def self.v2_template + @v2_template ||= ERB.new( + File.read(File.join(__dir__, 'templates', 'v2_operation.erb')), trim_mode: '-' + ) + end + def initialize(class_name:, path:, verb:, spec:, root:) @class_name = class_name @path = path @verb = verb @spec = spec @root = root - @method_name = Naming.underscore(spec.fetch('operationId')) + @operation_id = spec.fetch('operationId') + @method_name = Naming.underscore(@operation_id) @http_method = verb.upcase end @@ -35,6 +44,17 @@ def render self.class.template.result(binding) end + # The V2 method: required params positional in v1 order, the rest + # keywords, plus rdt:. Names that would not survive as Ruby + # arguments fail here. + def render_v2 + Names.check_method!(method_name) + Names.check_unique!(params.map(&:name), what: 'parameter') + params.reject(&:body?).each { |p| Names.check_param!(p.name, operation: method_name) } + + self.class.v2_template.result(binding) + end + private def params @@ -222,6 +242,48 @@ def optional_enum_guard(param, values) RUBY end + # -- V2 template pieces -------------------------------------------------- + + def v2_params = all_params + + def v2_signature + parts = signature_params.map(&:name) + parts += optional_params.map { |p| "#{p.name}: nil" } + parts << 'rdt: nil' + parts.join(', ') + end + + def query_params = params.select { |p| p.location == 'query' } + def header_params = params.select { |p| p.location == 'header' } + def path_params = params.select { |p| p.location == 'path' } + + def v2_value_expr(param) + param.array? ? "csv(#{param.name})" : param.name + end + + # '/orders/v0/orders/{orderId}' => "/orders/v0/orders/#{encode(order_id)}" + def v2_path_expr + return "'#{@path}'" if path_params.empty? + + expr = path_params.reduce(@path) do |acc, p| + acc.sub("{#{p.base_name}}", "\#{encode(#{p.name})}") + end + "\"#{expr}\"" + end + + def v2_request_args + args = [] + args << 'query: query' if query_params.any? + args << 'headers: headers' if header_params.any? + args << 'body: body' if body_param + args << 'rdt: rdt' + args.join(', ') + end + + def v2_summary + Naming.oneline(@spec['summary'] || @spec['description']) + end + # -- small helpers ----------------------------------------------------- def value_expr(param) diff --git a/lib/generator/param.rb b/lib/generator/param.rb index 96a8409..1bd8a79 100644 --- a/lib/generator/param.rb +++ b/lib/generator/param.rb @@ -8,6 +8,11 @@ module Generator class Param COLLECTION_FORMATS = %w[csv ssv tsv pipes multi].freeze + # YARD types the V2 templates emit per Swagger primitive. + V2_TYPES = { + 'string' => 'String', 'integer' => 'Integer', 'boolean' => 'Boolean', 'number' => 'Float' + }.freeze + def initialize(spec) @spec = spec validate! @@ -47,6 +52,22 @@ def doc_type primitive_type(@spec) end + # YARD type for the V2 templates; bodies are plain Hashes. + def v2_doc_type + return 'Hash' if body? + return "Array<#{v2_primitive(@spec.fetch('items'))}>" if array? + + v2_primitive(@spec) + end + + # One line, unescaped; a body param names its schema. + def v2_description + text = Naming.oneline(@spec['description']) + return text unless body? + + "#{text} (#{ref_name(@spec['schema'])})".strip + end + private # Fail loudly on spec constructs the generator does not understand, @@ -73,6 +94,12 @@ def primitive_type(spec) end end + def v2_primitive(spec) + V2_TYPES.fetch(spec['type']) do + raise "Unsupported parameter type #{spec['type'].inspect} for #{base_name}" + end + end + def ref_name(schema) ref = schema && schema['$ref'] raise "Body parameter #{base_name} has no $ref schema" unless ref diff --git a/lib/generator/templates/v2_api_class.erb b/lib/generator/templates/v2_api_class.erb new file mode 100644 index 0000000..b846ec0 --- /dev/null +++ b/lib/generator/templates/v2_api_class.erb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # <%= title %> + # + # <%= description %> + # + # OpenAPI spec version: <%= version %> + class <%= class_name %> < Api +<%= operations -%> + end + end +end diff --git a/lib/generator/templates/v2_apis.erb b/lib/generator/templates/v2_apis.erb new file mode 100644 index 0000000..6326641 --- /dev/null +++ b/lib/generator/templates/v2_apis.erb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/client' + +module AmazonSpClients + module V2 +<%- modules.each do |m| -%> + autoload :<%= m.v2_class_name %>, 'amazon_sp_clients/v2/apis/<%= m.name %>' +<%- end -%> + + class Client +<%- modules.each_with_index do |m, i| -%> +<%- unless i.zero? -%> + +<%- end -%> + # <%= m.title %> + # @return [<%= m.v2_class_name %>] + def <%= m.name %> = api(<%= m.v2_class_name %>) +<%- end -%> + end + end +end diff --git a/lib/generator/templates/v2_operation.erb b/lib/generator/templates/v2_operation.erb new file mode 100644 index 0000000..2d0fb13 --- /dev/null +++ b/lib/generator/templates/v2_operation.erb @@ -0,0 +1,27 @@ + # <%= v2_summary %> + # +<%- v2_params.each do |p| -%> + # <%= "@param #{p.name} [#{p.v2_doc_type}#{', nil' unless p.required?}] #{p.v2_description}".strip %> +<%- end -%> + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def <%= method_name %>(<%= v2_signature %>) +<%- if query_params.any? -%> + query = { +<%- query_params.each_with_index do |p, i| -%> + '<%= p.base_name %>' => <%= v2_value_expr(p) %><%= ',' unless i == query_params.size - 1 %> +<%- end -%> + } +<%- end -%> +<%- if header_params.any? -%> + headers = { +<%- header_params.each_with_index do |p, i| -%> + '<%= p.base_name %>' => <%= p.name %><%= ',' unless i == header_params.size - 1 %> +<%- end -%> + } +<%- end -%> +<%- if query_params.any? || header_params.any? -%> + +<%- end -%> + request(:<%= verb %>, <%= v2_path_expr %>, <%= v2_request_args %>) + end diff --git a/spec/fixtures/generator/things.json b/spec/fixtures/generator/things.json new file mode 100644 index 0000000..fe4dea0 --- /dev/null +++ b/spec/fixtures/generator/things.json @@ -0,0 +1,110 @@ +{ + "swagger": "2.0", + "info": { + "title": "Selling Partner API for Things", + "description": "Manage things.\nSecond line.", + "version": "v1" + }, + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/things/v1/things": { + "get": { + "tags": ["things"], + "operationId": "listThings", + "description": "Returns things. **Usage Plan:** see the `x-amzn-RateLimit-Limit` header.", + "parameters": [ + { + "name": "Ids", + "in": "query", + "required": true, + "type": "array", + "items": { "type": "string" }, + "description": "Thing ids." + }, + { + "name": "NextToken", + "in": "query", + "required": false, + "type": "string", + "description": "Pagination token." + }, + { + "name": "details", + "in": "query", + "required": false, + "type": "boolean", + "description": "Include details." + }, + { + "name": "MaxResults", + "in": "query", + "required": false, + "type": "integer", + "description": "Page size." + } + ], + "responses": { + "200": { "description": "Success.", "schema": { "$ref": "#/definitions/ListThingsResponse" } } + } + } + }, + "/things/v1/things/{thingId}": { + "post": { + "tags": ["things"], + "operationId": "createThing", + "description": "Creates a thing.", + "parameters": [ + { + "name": "thingId", + "in": "path", + "required": true, + "type": "string", + "description": "The thing id." + }, + { + "name": "createThingRequestBody", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/CreateThingRequest" }, + "description": "The request." + }, + { + "name": "x-amzn-idempotency-token", + "in": "header", + "required": true, + "type": "string", + "description": "Idempotency token." + } + ], + "responses": { + "200": { "description": "Success.", "schema": { "$ref": "#/definitions/CreateThingResponse" } } + } + } + }, + "/things/v1/things/{thingId}/cancel": { + "delete": { + "tags": ["other"], + "operationId": "cancelThing", + "description": "Cancels a thing.", + "parameters": [ + { + "name": "thingId", + "in": "path", + "required": true, + "type": "string", + "description": "The thing id." + } + ], + "responses": { + "200": { "description": "Success." } + } + } + } + }, + "definitions": { + "ListThingsResponse": { "type": "object" }, + "CreateThingRequest": { "type": "object" }, + "CreateThingResponse": { "type": "object" } + } +} diff --git a/spec/generator/v2_spec.rb b/spec/generator/v2_spec.rb new file mode 100644 index 0000000..b16106f --- /dev/null +++ b/spec/generator/v2_spec.rb @@ -0,0 +1,210 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' +require_relative '../../lib/generator' + +# The V2 template set, rendered from a small fixture spec and loaded +# for real, so the generated calling convention is pinned here and the +# committed output only has to match `rake generate:verify`. +RSpec.describe 'V2 code generation' do + v2 = AmazonSpClients::V2 + fixtures = File.expand_path('../fixtures/generator', __dir__) + + let(:api_module) do + Generator::ApiModule.new(name: 'things_v1', spec_path: 'things.json', + templates: %w[v2], models_dir: fixtures) + end + let(:source) { api_module.render_v2 } + + # Loads the generated class once for the whole group. + def things_class + namespace = AmazonSpClients::V2 + return namespace::ThingsV1 if namespace.const_defined?(:ThingsV1) + + Object.class_eval(source) + namespace::ThingsV1 + end + + describe 'module config' do + it 'requires a template list with known names' do + expect { Generator::ApiModule.new(name: 'x', spec_path: 'x.json', templates: %w[v3]) } + .to raise_error(ArgumentError, /v3/) + expect { Generator::ApiModule.new(name: 'x', spec_path: 'x.json', templates: []) } + .to raise_error(ArgumentError) + end + + it 'names the V2 class and file after the module' do + expect(api_module.v2_class_name).to eq('ThingsV1') + expect(api_module.owned_paths).to eq(['lib/amazon_sp_clients/v2/apis/things_v1.rb']) + end + + it 'owns the v1 paths too when v1 is listed' do + both = Generator::ApiModule.new(name: 'things_v1', spec_path: 'things.json', + templates: %w[v1 v2], models_dir: fixtures) + + expect(both.owned_paths).to eq( + %w[ + vendor/things_v1/lib/sp_things_v1.rb + vendor/things_v1/lib/sp_things_v1/api + lib/amazon_sp_clients/sp_things_v1.rb + lib/amazon_sp_clients/v2/apis/things_v1.rb + ] + ) + end + end + + describe 'rendered class' do + it 'is one Api subclass per module, with every tag merged and sorted' do + klass = things_class + + expect(klass.superclass).to be(v2::Api) + expect(klass.public_instance_methods(false).sort) + .to eq(%i[cancel_thing create_thing list_things]) + expect(source.index('def cancel_thing')).to be < source.index('def create_thing') + expect(source.index('def create_thing')).to be < source.index('def list_things') + end + + it 'keeps required params positional in v1 order and makes the rest keywords' do + expect(things_class.instance_method(:list_things).parameters).to eq( + [%i[req ids], %i[key next_token], %i[key details], %i[key max_results], %i[key rdt]] + ) + expect(things_class.instance_method(:create_thing).parameters).to eq( + [%i[req body], %i[req thing_id], %i[req x_amzn_idempotency_token], %i[key rdt]] + ) + end + + it 'documents every method for YARD, once and unescaped' do + expect(source).to include('# @param ids [Array] Thing ids.') + expect(source).to include('# @param details [Boolean, nil] Include details.') + expect(source).to include('# @param max_results [Integer, nil] Page size.') + expect(source).to include('# @param body [Hash] The request. (CreateThingRequest)') + expect(source).to include('# @param rdt [Array, nil]') + expect(source).to include('# @return [AmazonSpClients::ApiResponse]') + expect(source).to include('see the `x-amzn-RateLimit-Limit` header') + expect(source).not_to include('=begin') + expect(source).not_to include('`') + expect(source).to include("# Manage things. Second line.\n") + end + + it 'starts with the generated-file notice and no v1 references' do + expect(source).to start_with("# frozen_string_literal: true\n\n# Generated by lib/generator") + expect(source).not_to include('ApiClient') + expect(source).not_to include('auth_names') + end + end + + describe 'generated methods on the wire' do + let(:base_url) { 'https://sellingpartnerapi-na.amazon.com' } + let(:client) { v2::Client.new(v2::Config.new) { 'ACCESS' } } + let(:api) { things_class.new(client) } + + it 'sends required and given optional params, joining arrays and dropping nils' do + stub = stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => 'A,B', 'details' => 'false' }) + .to_return(status: 200, body: '{"payload":{"things":[]}}') + + response = api.list_things(%w[A B], details: false) + + expect(stub).to have_been_requested + expect(response.payload).to eq(things: []) + end + + it 'sends no optional params when none are given' do + stub = stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => 'A' }) + .to_return(status: 200, body: '{}') + + api.list_things(['A']) + + expect(stub).to have_been_requested + end + + it 'encodes path params and sends header params and the JSON body' do + stub = stub_request(:post, "#{base_url}/things/v1/things/x%20y") + .with(body: '{"name":"n"}', headers: { 'x-amzn-idempotency-token' => 'TOKEN' }) + .to_return(status: 200, body: '{}') + + api.create_thing({ name: 'n' }, 'x y', 'TOKEN') + + expect(stub).to have_been_requested + end + + it 'returns an ApiResponse for an operation without a response schema' do + stub_request(:delete, "#{base_url}/things/v1/things/T1/cancel") + .to_return(status: 204, body: '', headers: { 'x-amzn-RateLimit-Limit' => '1' }) + + response = api.cancel_thing('T1') + + expect(response).to be_a(AmazonSpClients::ApiResponse) + expect(response.reported_rate_limit).to eq(1.0) + end + + it 'passes rdt through' do + tokens = stub_request(:post, "#{base_url}/tokens/2021-03-01/restrictedDataToken") + .to_return(status: 200, body: '{"restrictedDataToken":"RDT","expiresIn":3600}') + stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => 'A' }, headers: { 'x-amz-access-token' => 'RDT' }) + .to_return(status: 200, body: '{}') + + api.list_things(['A'], rdt: [v2::RDT.resource('GET', '/things/v1/things')]) + + expect(tokens).to have_been_requested + end + + it 'rejects option keys that are not parameters' do + expect { api.list_things(['A'], order_status: 'Shipped') } + .to raise_error(ArgumentError, /order_status/) + end + end + + describe 'name guard' do + names = Generator::Names + + it 'rejects parameter names Ruby or the V2 signature already use' do + expect { names.check_param!('end', operation: 'op') }.to raise_error(/end/) + expect { names.check_param!('rdt', operation: 'op') }.to raise_error(/rdt/) + expect { names.check_param!('body', operation: 'op') }.to raise_error(/body/) + expect { names.check_param!('next_token', operation: 'op') }.not_to raise_error + end + + it 'rejects method names that collide with Ruby, Object or the Api base' do + expect { names.check_method!('class') }.to raise_error(/class/) + expect { names.check_method!('freeze') }.to raise_error(/freeze/) + expect { names.check_method!('request') }.to raise_error(/request/) + expect { names.check_method!('csv') }.to raise_error(/csv/) + expect { names.check_method!('get_orders') }.not_to raise_error + end + + it 'rejects module names that collide with Client methods' do + expect { names.check_module!('request') }.to raise_error(/request/) + expect { names.check_module!('api') }.to raise_error(/api/) + expect { names.check_module!('orders_v0') }.not_to raise_error + end + + it 'rejects duplicates after snake_casing' do + expect { names.check_unique!(%w[getThing GetThing], what: 'operationId') } + .to raise_error(/get_thing/) + expect { names.check_unique!(%w[NextToken nextToken], what: 'parameter') } + .to raise_error(/next_token/) + expect { names.check_unique!(%w[a b], what: 'parameter') }.not_to raise_error + end + end + + describe 'apis entry file' do + let(:entry) { Generator.render_v2_apis([api_module]) } + + it 'autoloads each class and gives Client an accessor per module' do + expect(entry).to include("autoload :ThingsV1, 'amazon_sp_clients/v2/apis/things_v1'") + expect(entry).to include('def things_v1 = api(ThingsV1)') + expect(entry).to include("# Selling Partner API for Things\n") + end + + it 'loads and hands out the memoized API instance' do + things_class + Object.class_eval(entry) + client = v2::Client.new(v2::Config.new) { 'ACCESS' } + + expect(client.things_v1).to be_a(v2::ThingsV1) + expect(client.things_v1).to be(client.things_v1) + end + end +end From 130cb288b2477eab4f269751a7e7ea75ae65ec36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:21:53 +0200 Subject: [PATCH 46/83] Enforce YARD on the V2 surface Every public object under lib/amazon_sp_clients/v2 must carry a doc comment. `rake yard:verify` runs `yard stats` (scoped by .yardopts) and fails unless it reports 100% documented, since the command itself exits 0 at any coverage. CI runs it in a new docs job. The generated V2 classes are in scope, so their templates emit YARD comments too. yard joins the development dependencies; all three lockfiles are re-locked in this commit so CI's frozen install keeps working. --- .github/workflows/ci.yml | 12 ++++++++++++ .yardopts | 4 ++++ Gemfile.lock | 2 ++ Rakefile | 19 +++++++++++++++++++ amazon_sp_clients.gemspec | 3 ++- gemfiles/faraday_1.gemfile.lock | 3 +++ gemfiles/faraday_2.gemfile.lock | 3 +++ lib/amazon_sp_clients/v2/config.rb | 3 +++ lib/amazon_sp_clients/v2/documents.rb | 2 ++ lib/amazon_sp_clients/v2/error_mapper.rb | 9 +++++++++ lib/amazon_sp_clients/v2/lwa.rb | 3 +++ 11 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .yardopts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f4efdc..923c8cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,18 @@ jobs: bundler-cache: true - run: bundle exec rspec + # Every public object under lib/amazon_sp_clients/v2 must carry a + # doc comment; .yardopts scopes the check. + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + - run: bundle exec rake yard:verify + # Regenerates vendor/ at the pinned Amazon spec revision and fails # if the committed files drift from what the generator produces. verify-generated: diff --git a/.yardopts b/.yardopts new file mode 100644 index 0000000..0d36655 --- /dev/null +++ b/.yardopts @@ -0,0 +1,4 @@ +--no-private +--list-undoc +lib/amazon_sp_clients/v2.rb +lib/amazon_sp_clients/v2/**/*.rb diff --git a/Gemfile.lock b/Gemfile.lock index eea8040..25c7120 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,6 +101,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + yard (0.9.45) PLATFORMS ruby @@ -114,6 +115,7 @@ DEPENDENCIES rubocop (~> 1.86) timecop webmock + yard BUNDLED WITH 2.3.14 diff --git a/Rakefile b/Rakefile index 7a6b3e7..95de82d 100644 --- a/Rakefile +++ b/Rakefile @@ -48,3 +48,22 @@ namespace :generate do end end end + +# The line `yard stats` prints when nothing public is undocumented. +YARD_FULLY_DOCUMENTED = '100.00% documented' + +namespace :yard do + desc 'Fail unless every public V2 object has a doc comment (.yardopts scopes it)' + task :verify do + require 'open3' + require 'rbconfig' + + # `yard stats` exits 0 whatever the coverage; the percentage is the signal. + yard = Gem.bin_path('yard', 'yard') + out, status = Open3.capture2e(RbConfig.ruby, yard, 'stats', '--no-save') + puts out + abort 'yard stats failed' unless status.success? + abort 'YARD verification failed: undocumented public objects in V2.' unless + out.include?(YARD_FULLY_DOCUMENTED) + end +end diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 87a8a50..7afd211 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features|amzn-models|gemfiles)/|^lib/generator}) + f.match(%r{^(test|spec|features|amzn-models|gemfiles)/|^lib/generator|^\.yardopts}) end end spec.bindir = 'exe' @@ -42,4 +42,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.86' spec.add_development_dependency 'timecop' spec.add_development_dependency 'webmock' + spec.add_development_dependency 'yard' end diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index e4fe02c..86ce264 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -101,6 +101,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + yard (0.9.45) PLATFORMS arm64-darwin-24 @@ -115,6 +116,7 @@ DEPENDENCIES rubocop (~> 1.86) timecop webmock + yard CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af @@ -166,6 +168,7 @@ CHECKSUMS unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d + yard (0.9.45) BUNDLED WITH 4.0.11 diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index 9993bb2..3f5a12a 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -90,6 +90,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + yard (0.9.45) PLATFORMS arm64-darwin-24 @@ -104,6 +105,7 @@ DEPENDENCIES rubocop (~> 1.86) timecop webmock + yard CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af @@ -149,6 +151,7 @@ CHECKSUMS unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d + yard (0.9.45) BUNDLED WITH 4.0.11 diff --git a/lib/amazon_sp_clients/v2/config.rb b/lib/amazon_sp_clients/v2/config.rb index bd73319..74bc3e8 100644 --- a/lib/amazon_sp_clients/v2/config.rb +++ b/lib/amazon_sp_clients/v2/config.rb @@ -29,12 +29,15 @@ class Config 'se' => REGION_EU, 'tr' => REGION_EU }.freeze + # North America, where every consumer started. DEFAULT_ENDPOINT = 'na' # Seconds to read or write on an open connection. DEFAULT_TIMEOUT = 60 # Seconds to open a connection. DEFAULT_OPEN_TIMEOUT = 10 + # Names the gem and Ruby version, as Amazon asks. DEFAULT_USER_AGENT = "amazon_sp_clients/#{VERSION} (Language=Ruby/#{RUBY_VERSION})".freeze + # Host prefix of the SP-API sandbox. SANDBOX_PREFIX = 'sandbox.' # @param endpoint [String] region or country code ('na', 'eu', 'fe', 'de', ...) diff --git a/lib/amazon_sp_clients/v2/documents.rb b/lib/amazon_sp_clients/v2/documents.rb index b20675c..67b7209 100644 --- a/lib/amazon_sp_clients/v2/documents.rb +++ b/lib/amazon_sp_clients/v2/documents.rb @@ -22,7 +22,9 @@ module V2 class Documents # Value of +compressionAlgorithm+ for gzipped documents. GZIP = 'GZIP' + # Set on uploads; read on downloads to pick the parser. CONTENT_TYPE_HEADER = 'Content-Type' + # Content types parsed as JSON; anything else is parsed as XML. JSON_TYPES = /json/i # @param config [Config] timeouts and user agent diff --git a/lib/amazon_sp_clients/v2/error_mapper.rb b/lib/amazon_sp_clients/v2/error_mapper.rb index dc1c6c0..749af11 100644 --- a/lib/amazon_sp_clients/v2/error_mapper.rb +++ b/lib/amazon_sp_clients/v2/error_mapper.rb @@ -17,6 +17,7 @@ module V2 # :lwa token endpoint; body {"error", "error_description"} # :documents presigned S3 urls; the url carries the credential class ErrorMapper + # The three services V2 talks to. SERVICES = %i[api lwa documents].freeze # Exceptions the HTTPClient adapter lets out of a request: Faraday's @@ -26,6 +27,8 @@ class ErrorMapper Faraday::Error, HTTPClient::KeepAliveDisconnected, SystemCallError, IOError, SocketError ].freeze + # SP-API statuses with their own error class; other 4xx and 5xx + # fall to ClientError and ServerError. STATUS_ERRORS = { 400 => BadRequestError, 401 => UnauthorizedError, @@ -33,19 +36,25 @@ class ErrorMapper 404 => NotFoundError, 429 => ThrottledError }.freeze + # Statuses mapped to ClientError when not in STATUS_ERRORS. CLIENT_ERROR_STATUSES = (400...500) + # Statuses mapped to ServerError. SERVER_ERROR_STATUSES = (500...600) + # LWA error codes with their own class; other codes raise AuthError. LWA_ERRORS = { 'invalid_grant' => InvalidGrantError, 'invalid_client' => InvalidClientError }.freeze + # Response header carrying Amazon's request id. REQUEST_ID_HEADER = 'x-amzn-RequestId' + # Response header carrying the usage plan rate, in requests per second. RATE_LIMIT_HEADER = 'x-amzn-RateLimit-Limit' # The error ends up in consumer logs; keep secrets out of it. FILTERED = '[FILTERED]' + # Request headers replaced by FILTERED on the error. SENSITIVE_HEADERS = %w[authorization x-amz-access-token x-amz-security-token].freeze # @param service [Symbol] one of SERVICES diff --git a/lib/amazon_sp_clients/v2/lwa.rb b/lib/amazon_sp_clients/v2/lwa.rb index b004bc8..501108b 100644 --- a/lib/amazon_sp_clients/v2/lwa.rb +++ b/lib/amazon_sp_clients/v2/lwa.rb @@ -20,8 +20,11 @@ module V2 # own token store call this directly; RefreshToken credentials call # it for the client. class LWA + # Login with Amazon lives outside the SP-API hosts. TOKEN_HOST = 'https://api.amazon.com' + # The OAuth 2 token endpoint. TOKEN_PATH = '/auth/o2/token' + # The grant type V2 uses; grantless (client_credentials) has no consumer. REFRESH_GRANT = 'refresh_token' # @param config [Config] with client_id and client_secret set From f5f2df850d0cf9529b01fedc382e603e487519b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:24:41 +0200 Subject: [PATCH 47/83] Generate the V2 API classes Output of `rake generate` with the V2 template set: one class per module under lib/amazon_sp_clients/v2/apis/ and the entry file with the autoloads and Client accessors. vendor/ is unchanged. The V2 entry file now requires the generated entry, so `require 'amazon_sp_clients/v2'` gives a client every API class. --- lib/amazon_sp_clients/v2.rb | 1 + lib/amazon_sp_clients/v2/apis.rb | 82 ++++++++ .../v2/apis/fba_inventory.rb | 80 ++++++++ lib/amazon_sp_clients/v2/apis/feeds_2021.rb | 86 ++++++++ .../v2/apis/fulfillment_outbound_2020.rb | 184 ++++++++++++++++++ .../v2/apis/listings_items_2021.rb | 144 ++++++++++++++ lib/amazon_sp_clients/v2/apis/orders_v0.rb | 165 ++++++++++++++++ lib/amazon_sp_clients/v2/apis/reports_2021.rb | 117 +++++++++++ lib/amazon_sp_clients/v2/apis/tokens_2021.rb | 25 +++ .../v2/apis/vdf_inventory_v1.rb | 26 +++ .../v2/apis/vdf_orders_v1.rb | 61 ++++++ .../v2/apis/vdf_shipping_v1.rb | 139 +++++++++++++ .../v2/apis/vendor_invoices.rb | 25 +++ .../v2/apis/vendor_orders.rb | 106 ++++++++++ .../v2/apis/vendor_transaction_status.rb | 25 +++ .../v2/apis/vendors_shipments.rb | 120 ++++++++++++ 16 files changed, 1386 insertions(+) create mode 100644 lib/amazon_sp_clients/v2/apis.rb create mode 100644 lib/amazon_sp_clients/v2/apis/fba_inventory.rb create mode 100644 lib/amazon_sp_clients/v2/apis/feeds_2021.rb create mode 100644 lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb create mode 100644 lib/amazon_sp_clients/v2/apis/listings_items_2021.rb create mode 100644 lib/amazon_sp_clients/v2/apis/orders_v0.rb create mode 100644 lib/amazon_sp_clients/v2/apis/reports_2021.rb create mode 100644 lib/amazon_sp_clients/v2/apis/tokens_2021.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vendor_invoices.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vendor_orders.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb create mode 100644 lib/amazon_sp_clients/v2/apis/vendors_shipments.rb diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index 0eaed2d..dc37072 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -15,6 +15,7 @@ require 'amazon_sp_clients/v2/documents' require 'amazon_sp_clients/v2/api' require 'amazon_sp_clients/v2/client' +require 'amazon_sp_clients/v2/apis' # Ruby clients for the Amazon Selling Partner API. module AmazonSpClients diff --git a/lib/amazon_sp_clients/v2/apis.rb b/lib/amazon_sp_clients/v2/apis.rb new file mode 100644 index 0000000..8f892d7 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/client' + +module AmazonSpClients + module V2 + autoload :FbaInventory, 'amazon_sp_clients/v2/apis/fba_inventory' + autoload :Feeds2021, 'amazon_sp_clients/v2/apis/feeds_2021' + autoload :FulfillmentOutbound2020, 'amazon_sp_clients/v2/apis/fulfillment_outbound_2020' + autoload :ListingsItems2021, 'amazon_sp_clients/v2/apis/listings_items_2021' + autoload :OrdersV0, 'amazon_sp_clients/v2/apis/orders_v0' + autoload :Reports2021, 'amazon_sp_clients/v2/apis/reports_2021' + autoload :Tokens2021, 'amazon_sp_clients/v2/apis/tokens_2021' + autoload :VdfInventoryV1, 'amazon_sp_clients/v2/apis/vdf_inventory_v1' + autoload :VdfOrdersV1, 'amazon_sp_clients/v2/apis/vdf_orders_v1' + autoload :VdfShippingV1, 'amazon_sp_clients/v2/apis/vdf_shipping_v1' + autoload :VendorInvoices, 'amazon_sp_clients/v2/apis/vendor_invoices' + autoload :VendorOrders, 'amazon_sp_clients/v2/apis/vendor_orders' + autoload :VendorTransactionStatus, 'amazon_sp_clients/v2/apis/vendor_transaction_status' + autoload :VendorsShipments, 'amazon_sp_clients/v2/apis/vendors_shipments' + + class Client + # Selling Partner API for FBA Inventory + # @return [FbaInventory] + def fba_inventory = api(FbaInventory) + + # Selling Partner API for Feeds + # @return [Feeds2021] + def feeds_2021 = api(Feeds2021) + + # Selling Partner APIs for Fulfillment Outbound + # @return [FulfillmentOutbound2020] + def fulfillment_outbound_2020 = api(FulfillmentOutbound2020) + + # Selling Partner API for Listings Items + # @return [ListingsItems2021] + def listings_items_2021 = api(ListingsItems2021) + + # Selling Partner API for Orders + # @return [OrdersV0] + def orders_v0 = api(OrdersV0) + + # Selling Partner API for Reports + # @return [Reports2021] + def reports_2021 = api(Reports2021) + + # Selling Partner API for Tokens + # @return [Tokens2021] + def tokens_2021 = api(Tokens2021) + + # Selling Partner API for Direct Fulfillment Inventory Updates + # @return [VdfInventoryV1] + def vdf_inventory_v1 = api(VdfInventoryV1) + + # Selling Partner API for Direct Fulfillment Orders + # @return [VdfOrdersV1] + def vdf_orders_v1 = api(VdfOrdersV1) + + # Selling Partner API for Direct Fulfillment Shipping + # @return [VdfShippingV1] + def vdf_shipping_v1 = api(VdfShippingV1) + + # Selling Partner API for Retail Procurement Payments + # @return [VendorInvoices] + def vendor_invoices = api(VendorInvoices) + + # Selling Partner API for Retail Procurement Orders + # @return [VendorOrders] + def vendor_orders = api(VendorOrders) + + # Selling Partner API for Retail Procurement Transaction Status + # @return [VendorTransactionStatus] + def vendor_transaction_status = api(VendorTransactionStatus) + + # Selling Partner API for Retail Procurement Shipments + # @return [VendorsShipments] + def vendors_shipments = api(VendorsShipments) + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/fba_inventory.rb b/lib/amazon_sp_clients/v2/apis/fba_inventory.rb new file mode 100644 index 0000000..659ba9b --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/fba_inventory.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for FBA Inventory + # + # The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. + # + # OpenAPI spec version: v1 + class FbaInventory < Api + # Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information. + # + # @param body [Hash] List of items to add to Sandbox inventory. (AddInventoryRequest) + # @param x_amzn_idempotency_token [String] A unique token/requestId provided with each call to ensure idempotency. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def add_inventory(body, x_amzn_idempotency_token, rdt: nil) + headers = { + 'x-amzn-idempotency-token' => x_amzn_idempotency_token + } + + request(:post, '/fba/inventory/v1/items/inventory', headers: headers, body: body, rdt: rdt) + end + + # Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information. + # + # @param body [Hash] CreateInventoryItem Request Body Parameter. (CreateInventoryItemRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_inventory_item(body, rdt: nil) + request(:post, '/fba/inventory/v1/items', body: body, rdt: rdt) + end + + # Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information. + # + # @param seller_sku [String] A single seller SKU used for querying the specified seller SKU inventory summaries. + # @param marketplace_id [String] The marketplace ID for the marketplace for which the sellerSku is to be deleted. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def delete_inventory_item(seller_sku, marketplace_id, rdt: nil) + query = { + 'marketplaceId' => marketplace_id + } + + request(:delete, "/fba/inventory/v1/items/#{encode(seller_sku)}", query: query, rdt: rdt) + end + + # Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits). + # + # @param granularity_type [String] The granularity type for the inventory aggregation level. + # @param granularity_id [String] The granularity ID for the inventory aggregation level. + # @param marketplace_ids [Array] The marketplace ID for the marketplace for which to return inventory summaries. + # @param details [Boolean, nil] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). + # @param start_date_time [String, nil] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected. + # @param seller_skus [Array, nil] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs. + # @param seller_sku [String, nil] A single seller SKU used for querying the specified seller SKU inventory summaries. + # @param next_token [String, nil] String token returned in the response of your previous request. The string token will expire 30 seconds after being created. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil, rdt: nil) + query = { + 'details' => details, + 'granularityType' => granularity_type, + 'granularityId' => granularity_id, + 'startDateTime' => start_date_time, + 'sellerSkus' => csv(seller_skus), + 'sellerSku' => seller_sku, + 'nextToken' => next_token, + 'marketplaceIds' => csv(marketplace_ids) + } + + request(:get, '/fba/inventory/v1/summaries', query: query, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/feeds_2021.rb b/lib/amazon_sp_clients/v2/apis/feeds_2021.rb new file mode 100644 index 0000000..a6d4bfa --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/feeds_2021.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Feeds + # + # The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. + # + # OpenAPI spec version: 2021-06-30 + class Feeds2021 < Api + # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def cancel_feed(feed_id, rdt: nil) + request(:delete, "/feeds/2021-06-30/feeds/#{encode(feed_id)}", rdt: rdt) + end + + # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#post-feeds2021-06-30feeds) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). + # + # @param body [Hash] Information required to create the feed. (CreateFeedSpecification) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_feed(body, rdt: nil) + request(:post, '/feeds/2021-06-30/feeds', body: body, rdt: rdt) + end + + # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Specifies the content type for the createFeedDocument operation. (CreateFeedDocumentSpecification) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_feed_document(body, rdt: nil) + request(:post, '/feeds/2021-06-30/documents', body: body, rdt: rdt) + end + + # Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_feed(feed_id, rdt: nil) + request(:get, "/feeds/2021-06-30/feeds/#{encode(feed_id)}", rdt: rdt) + end + + # Returns the information required for retrieving a feed document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param feed_document_id [String] The identifier of the feed document. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_feed_document(feed_document_id, rdt: nil) + request(:get, "/feeds/2021-06-30/documents/#{encode(feed_document_id)}", rdt: rdt) + end + + # Returns feed details for the feeds that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param feed_types [Array, nil] A list of feed types used to filter feeds. When feedTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either feedTypes or nextToken is required. + # @param marketplace_ids [Array, nil] A list of marketplace identifiers used to filter feeds. The feeds returned will match at least one of the marketplaces that you specify. + # @param page_size [Integer, nil] The maximum number of feeds to return in a single call. + # @param processing_statuses [Array, nil] A list of processing statuses used to filter feeds. + # @param created_since [String, nil] The earliest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days. + # @param created_until [String, nil] The latest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is now. + # @param next_token [String, nil] A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_feeds(feed_types: nil, marketplace_ids: nil, page_size: nil, processing_statuses: nil, created_since: nil, created_until: nil, next_token: nil, rdt: nil) + query = { + 'feedTypes' => csv(feed_types), + 'marketplaceIds' => csv(marketplace_ids), + 'pageSize' => page_size, + 'processingStatuses' => csv(processing_statuses), + 'createdSince' => created_since, + 'createdUntil' => created_until, + 'nextToken' => next_token + } + + request(:get, '/feeds/2021-06-30/feeds', query: query, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb b/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb new file mode 100644 index 0000000..f1468c4 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb @@ -0,0 +1,184 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner APIs for Fulfillment Outbound + # + # The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders. + # + # OpenAPI spec version: 2020-07-01 + class FulfillmentOutbound2020 < Api + # Requests that Amazon stop attempting to fulfill the fulfillment order indicated by the specified order identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the fulfillment order was created. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def cancel_fulfillment_order(seller_fulfillment_order_id, rdt: nil) + request(:put, "/fba/outbound/2020-07-01/fulfillmentOrders/#{encode(seller_fulfillment_order_id)}/cancel", rdt: rdt) + end + + # Requests that Amazon ship items from the seller's inventory in Amazon's fulfillment network to a destination address. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) + # + # @param body [Hash] CreateFulfillmentOrderRequest parameter (CreateFulfillmentOrderRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_fulfillment_order(body, rdt: nil) + request(:post, '/fba/outbound/2020-07-01/fulfillmentOrders', body: body, rdt: rdt) + end + + # Creates a fulfillment return. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] CreateFulfillmentReturnRequest parameter (CreateFulfillmentReturnRequest) + # @param seller_fulfillment_order_id [String] An identifier assigned by the seller to the fulfillment order at the time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value based on the buyer's request to return items. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_fulfillment_return(body, seller_fulfillment_order_id, rdt: nil) + request(:put, "/fba/outbound/2020-07-01/fulfillmentOrders/#{encode(seller_fulfillment_order_id)}/return", body: body, rdt: rdt) + end + + # Returns delivery options that include an estimated delivery date and offer expiration, based on criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] GetDeliveryOffersRequest parameter (GetDeliveryOffersRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def delivery_offers(body, rdt: nil) + request(:post, '/fba/outbound/2020-07-01/deliveryOffers', body: body, rdt: rdt) + end + + # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).. + # + # @param marketplace_id [String] The marketplace for which to return a list of the inventory that is eligible for the specified feature. + # @param feature_name [String] The name of the feature for which to return a list of eligible inventory. + # @param next_token [String, nil] A string token returned in the response to your previous request that is used to return the next response page. A value of null will return the first page. + # @param query_start_date [String, nil] A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format yyyy-MM-ddTHH:mm:ss.sssZ + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil, rdt: nil) + query = { + 'marketplaceId' => marketplace_id, + 'nextToken' => next_token, + 'queryStartDate' => query_start_date + } + + request(:get, "/fba/outbound/2020-07-01/features/inventory/#{encode(feature_name)}", query: query, rdt: rdt) + end + + # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified feature. Note that if the sellerSKU isn't eligible, the response will contain an empty skuInfo object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param marketplace_id [String] The marketplace for which to return the count. + # @param feature_name [String] The name of the feature. + # @param seller_sku [String] Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's `SellerId`, which is included with every operation that you submit. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_feature_sku(marketplace_id, feature_name, seller_sku, rdt: nil) + query = { + 'marketplaceId' => marketplace_id + } + + request(:get, "/fba/outbound/2020-07-01/features/inventory/#{encode(feature_name)}/#{encode(seller_sku)}", query: query, rdt: rdt) + end + + # Returns a list of features available for Multi-Channel Fulfillment orders in the marketplace you specify, and whether the seller for which you made the call is enrolled for each feature. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param marketplace_id [String] The marketplace for which to return the list of features. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_features(marketplace_id, rdt: nil) + query = { + 'marketplaceId' => marketplace_id + } + + request(:get, '/fba/outbound/2020-07-01/features', query: query, rdt: rdt) + end + + # Returns the fulfillment order indicated by the specified order identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the fulfillment order was created. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_fulfillment_order(seller_fulfillment_order_id, rdt: nil) + request(:get, "/fba/outbound/2020-07-01/fulfillmentOrders/#{encode(seller_fulfillment_order_id)}", rdt: rdt) + end + + # Returns a list of fulfillment order previews based on shipping criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] GetFulfillmentPreviewRequest parameter (GetFulfillmentPreviewRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_fulfillment_preview(body, rdt: nil) + request(:post, '/fba/outbound/2020-07-01/fulfillmentOrders/preview', body: body, rdt: rdt) + end + + # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param package_number [Integer] The unencrypted package identifier returned by the `getFulfillmentOrder` operation. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_package_tracking_details(package_number, rdt: nil) + query = { + 'packageNumber' => package_number + } + + request(:get, '/fba/outbound/2020-07-01/tracking', query: query, rdt: rdt) + end + + # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next token parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) + # + # @param query_start_date [String, nil] A date used to select fulfillment orders that were last updated after (or at) a specified time. An update is defined as any change in fulfillment order status, including the creation of a new fulfillment order. + # @param next_token [String, nil] A string token returned in the response to your previous request. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def list_all_fulfillment_orders(query_start_date: nil, next_token: nil, rdt: nil) + query = { + 'queryStartDate' => query_start_date, + 'nextToken' => next_token + } + + request(:get, '/fba/outbound/2020-07-01/fulfillmentOrders', query: query, rdt: rdt) + end + + # Returns a list of return reason codes for a seller SKU in a given marketplace. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_sku [String] The seller SKU for which return reason codes are required. + # @param marketplace_id [String, nil] The marketplace for which the seller wants return reason codes. + # @param seller_fulfillment_order_id [String, nil] The identifier assigned to the item by the seller when the fulfillment order was created. The service uses this value to determine the marketplace for which the seller wants return reason codes. + # @param language [String, nil] The language that the `TranslatedDescription` property of the `ReasonCodeDetails` response object should be translated into. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def list_return_reason_codes(seller_sku, marketplace_id: nil, seller_fulfillment_order_id: nil, language: nil, rdt: nil) + query = { + 'sellerSku' => seller_sku, + 'marketplaceId' => marketplace_id, + 'sellerFulfillmentOrderId' => seller_fulfillment_order_id, + 'language' => language + } + + request(:get, '/fba/outbound/2020-07-01/returnReasonCodes', query: query, rdt: rdt) + end + + # Requests that Amazon update the status of an order in the sandbox testing environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Fulfillment Outbound Dynamic Sandbox Guide](https://developer-docs.amazon.com/sp-api/docs/fulfillment-outbound-dynamic-sandbox-guide) and [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information. + # + # @param body [Hash] The identifier assigned to the item by the seller when the fulfillment order was created. (SubmitFulfillmentOrderStatusUpdateRequest) + # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the fulfillment order was created. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_fulfillment_order_status_update(body, seller_fulfillment_order_id, rdt: nil) + request(:put, "/fba/outbound/2020-07-01/fulfillmentOrders/#{encode(seller_fulfillment_order_id)}/status", body: body, rdt: rdt) + end + + # Updates and/or requests shipment for a fulfillment order with an order hold on it. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] UpdateFulfillmentOrderRequest parameter (UpdateFulfillmentOrderRequest) + # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the fulfillment order was created. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def update_fulfillment_order(body, seller_fulfillment_order_id, rdt: nil) + request(:put, "/fba/outbound/2020-07-01/fulfillmentOrders/#{encode(seller_fulfillment_order_id)}", body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb b/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb new file mode 100644 index 0000000..71c6a26 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Listings Items + # + # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). + # + # OpenAPI spec version: 2021-08-01 + class ListingsItems2021 < Api + # Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. + # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rdt: nil) + query = { + 'marketplaceIds' => csv(marketplace_ids), + 'issueLocale' => issue_locale + } + + request(:delete, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, rdt: rdt) + end + + # Returns details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. + # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `summaries`. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: nil, rdt: nil) + query = { + 'marketplaceIds' => csv(marketplace_ids), + 'issueLocale' => issue_locale, + 'includedData' => csv(included_data) + } + + request(:get, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, rdt: rdt) + end + + # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # + # @param body [Hash] The request body schema for the `patchListingsItem` operation. (ListingsItemPatchRequest) + # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. + # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `issues`. + # @param mode [String, nil] The mode of operation for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def patch_listings_item(body, marketplace_ids, seller_id, sku, included_data: nil, mode: nil, issue_locale: nil, rdt: nil) + query = { + 'marketplaceIds' => csv(marketplace_ids), + 'includedData' => csv(included_data), + 'mode' => mode, + 'issueLocale' => issue_locale + } + + request(:patch, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, body: body, rdt: rdt) + end + + # Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body schema for the `putListingsItem` operation. (ListingsItemPutRequest) + # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. + # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `issues`. + # @param mode [String, nil] The mode of operation for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def put_listings_item(body, marketplace_ids, seller_id, sku, included_data: nil, mode: nil, issue_locale: nil, rdt: nil) + query = { + 'marketplaceIds' => csv(marketplace_ids), + 'includedData' => csv(included_data), + 'mode' => mode, + 'issueLocale' => issue_locale + } + + request(:put, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, body: body, rdt: rdt) + end + + # Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. + # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param issue_locale [String, nil] A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". When a localization is not available in the specified locale, localized messages default to "en_US". + # @param included_data [Array, nil] A comma-delimited list of datasets that you want to include in the response. Default: `summaries`. + # @param identifiers [Array, nil] A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`. + # @param identifiers_type [String, nil] A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided. + # @param variation_parent_sku [String, nil] Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request. + # @param package_hierarchy_sku [String, nil] Filter results to include listing items that contain or are contained by the specified SKU. **Note**: You cannot use `packageHierarchySku` if you include `identifiers` or `variationParentSku` in your request. + # @param created_after [String, nil] A date-time that is used to filter listing items. The response includes listings items that were created at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. + # @param created_before [String, nil] A date-time that is used to filter listing items. The response includes listings items that were created at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. + # @param last_updated_after [String, nil] A date-time that is used to filter listing items. The response includes listings items that were last updated at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. + # @param last_updated_before [String, nil] A date-time that is used to filter listing items. The response includes listings items that were last updated at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. + # @param with_issue_severity [Array, nil] Filter results to include only listing items that have issues that match one or more of the specified severity levels. + # @param with_status [Array, nil] Filter results to include only listing items that have the specified status. + # @param without_status [Array, nil] Filter results to include only listing items that don't contain the specified statuses. + # @param sort_by [String, nil] An attribute by which to sort the returned listing items. + # @param sort_order [String, nil] The order in which to sort the result items. + # @param page_size [Integer, nil] The number of results that you want to include on each page. + # @param page_token [String, nil] A token that you can use to fetch a specific page when there are multiple pages of results. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def search_listings_items(seller_id, marketplace_ids, issue_locale: nil, included_data: nil, identifiers: nil, identifiers_type: nil, variation_parent_sku: nil, package_hierarchy_sku: nil, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, with_issue_severity: nil, with_status: nil, without_status: nil, sort_by: nil, sort_order: nil, page_size: nil, page_token: nil, rdt: nil) + query = { + 'marketplaceIds' => csv(marketplace_ids), + 'issueLocale' => issue_locale, + 'includedData' => csv(included_data), + 'identifiers' => csv(identifiers), + 'identifiersType' => identifiers_type, + 'variationParentSku' => variation_parent_sku, + 'packageHierarchySku' => package_hierarchy_sku, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'lastUpdatedAfter' => last_updated_after, + 'lastUpdatedBefore' => last_updated_before, + 'withIssueSeverity' => csv(with_issue_severity), + 'withStatus' => csv(with_status), + 'withoutStatus' => csv(without_status), + 'sortBy' => sort_by, + 'sortOrder' => sort_order, + 'pageSize' => page_size, + 'pageToken' => page_token + } + + request(:get, "/listings/2021-08-01/items/#{encode(seller_id)}", query: query, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/orders_v0.rb b/lib/amazon_sp_clients/v2/apis/orders_v0.rb new file mode 100644 index 0000000..3e46b5f --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/orders_v0.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Orders + # + # Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response). + # + # OpenAPI spec version: v0 + class OrdersV0 < Api + # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Request body of `confirmShipment`. (ConfirmShipmentRequest) + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def confirm_shipment(body, order_id, rdt: nil) + request(:post, "/orders/v0/orders/#{encode(order_id)}/shipmentConfirmation", body: body, rdt: rdt) + end + + # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order(order_id, rdt: nil) + request(:get, "/orders/v0/orders/#{encode(order_id)}", rdt: rdt) + end + + # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order_address(order_id, rdt: nil) + request(:get, "/orders/v0/orders/#{encode(order_id)}/address", rdt: rdt) + end + + # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order_buyer_info(order_id, rdt: nil) + request(:get, "/orders/v0/orders/#{encode(order_id)}/buyerInfo", rdt: rdt) + end + + # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param next_token [String, nil] A string token returned in the response of your previous request. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order_items(order_id, next_token: nil, rdt: nil) + query = { + 'NextToken' => next_token + } + + request(:get, "/orders/v0/orders/#{encode(order_id)}/orderItems", query: query, rdt: rdt) + end + + # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param next_token [String, nil] A string token returned in the response of your previous request. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order_items_buyer_info(order_id, next_token: nil, rdt: nil) + query = { + 'NextToken' => next_token + } + + request(:get, "/orders/v0/orders/#{encode(order_id)}/orderItems/buyerInfo", query: query, rdt: rdt) + end + + # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order_regulated_info(order_id, rdt: nil) + request(:get, "/orders/v0/orders/#{encode(order_id)}/regulatedInfo", rdt: rdt) + end + + # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # + # @param marketplace_ids [Array] A list of `MarketplaceId` values. Used to select orders that were placed in the specified marketplaces. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. + # @param created_after [String, nil] Use this date to select orders created after (or at) a specified time. Only orders placed after the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and `LastUpdatedBefore` cannot be set when `CreatedAfter` is set. + # @param created_before [String, nil] Use this date to select orders created before (or at) a specified time. Only orders placed before the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `CreatedBefore` is optional when `CreatedAfter` is set. If specified, `CreatedBefore` must be equal to or after the `CreatedAfter` date and at least two minutes before current time. + # @param last_updated_after [String, nil] Use this date to select orders that were last updated after (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `CreatedAfter` or `CreatedBefore` cannot be set when `LastUpdatedAfter` is set. + # @param last_updated_before [String, nil] Use this date to select orders that were last updated before (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: `LastUpdatedBefore` is optional when `LastUpdatedAfter` is set. But if specified, `LastUpdatedBefore` must be equal to or after the `LastUpdatedAfter` date and at least two minutes before current time. + # @param order_statuses [Array, nil] A list of `OrderStatus` values used to filter the results. **Possible values:** - `PendingAvailability` (This status is available for pre-orders only. The order has been placed, payment has not been authorized, and the release date of the item is in the future.) - `Pending` (The order has been placed but payment has not been authorized.) - `Unshipped` (Payment has been authorized and the order is ready for shipment, but no items in the order have been shipped.) - `PartiallyShipped` (One or more, but not all, items in the order have been shipped.) - `Shipped` (All items in the order have been shipped.) - `InvoiceUnconfirmed` (All items in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been shipped to the buyer.) - `Canceled` (The order has been canceled.) - `Unfulfillable` (The order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) + # @param fulfillment_channels [Array, nil] A list that indicates how an order was fulfilled. Filters the results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller). + # @param payment_methods [Array, nil] A list of payment method values. Use this field to select orders that were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS` (convenience store), `Other` (Any payment method other than COD or CVS). + # @param buyer_email [String, nil] The email address of a buyer. Used to select orders that contain the specified email address. + # @param seller_order_id [String, nil] An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified. + # @param max_results_per_page [Integer, nil] A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. + # @param easy_ship_shipment_statuses [Array, nil] A list of `EasyShipShipmentStatus` values. Used to select Easy Ship orders with statuses that match the specified values. If `EasyShipShipmentStatus` is specified, only Amazon Easy Ship orders are returned. **Possible values:** - `PendingSchedule` (The package is awaiting the schedule for pick-up.) - `PendingPickUp` (Amazon has not yet picked up the package from the seller.) - `PendingDropOff` (The seller will deliver the package to the carrier.) - `LabelCanceled` (The seller canceled the pickup.) - `PickedUp` (Amazon has picked up the package from the seller.) - `DroppedOff` (The package is delivered to the carrier by the seller.) - `AtOriginFC` (The packaged is at the origin fulfillment center.) - `AtDestinationFC` (The package is at the destination fulfillment center.) - `Delivered` (The package has been delivered.) - `RejectedByBuyer` (The package has been rejected by the buyer.) - `Undeliverable` (The package cannot be delivered.) - `ReturningToSeller` (The package was not delivered and is being returned to the seller.) - `ReturnedToSeller` (The package was not delivered and was returned to the seller.) - `Lost` (The package is lost.) - `OutForDelivery` (The package is out for delivery.) - `Damaged` (The package was damaged by the carrier.) + # @param electronic_invoice_statuses [Array, nil] A list of `ElectronicInvoiceStatus` values. Used to select orders with electronic invoice statuses that match the specified values. **Possible values:** - `NotRequired` (Electronic invoice submission is not required for this order.) - `NotFound` (The electronic invoice was not submitted for this order.) - `Processing` (The electronic invoice is being processed for this order.) - `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last submitted electronic invoice was submitted and accepted.) + # @param next_token [String, nil] A string token returned in the response of your previous request. + # @param amazon_order_ids [Array, nil] A list of `AmazonOrderId` values. An `AmazonOrderId` is an Amazon-defined order identifier, in 3-7-7 format. + # @param actual_fulfillment_supply_source_id [String, nil] The `sourceId` of the location from where you want the order fulfilled. + # @param is_ispu [Boolean, nil] When true, this order is marked to be picked up from a store rather than delivered. + # @param store_chain_store_id [String, nil] The store chain store identifier. Linked to a specific store in a store chain. + # @param earliest_delivery_date_before [String, nil] Use this date to select orders with a earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param earliest_delivery_date_after [String, nil] Use this date to select orders with a earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param latest_delivery_date_before [String, nil] Use this date to select orders with a latest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param latest_delivery_date_after [String, nil] Use this date to select orders with a latest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_orders(marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, order_statuses: nil, fulfillment_channels: nil, payment_methods: nil, buyer_email: nil, seller_order_id: nil, max_results_per_page: nil, easy_ship_shipment_statuses: nil, electronic_invoice_statuses: nil, next_token: nil, amazon_order_ids: nil, actual_fulfillment_supply_source_id: nil, is_ispu: nil, store_chain_store_id: nil, earliest_delivery_date_before: nil, earliest_delivery_date_after: nil, latest_delivery_date_before: nil, latest_delivery_date_after: nil, rdt: nil) + query = { + 'CreatedAfter' => created_after, + 'CreatedBefore' => created_before, + 'LastUpdatedAfter' => last_updated_after, + 'LastUpdatedBefore' => last_updated_before, + 'OrderStatuses' => csv(order_statuses), + 'MarketplaceIds' => csv(marketplace_ids), + 'FulfillmentChannels' => csv(fulfillment_channels), + 'PaymentMethods' => csv(payment_methods), + 'BuyerEmail' => buyer_email, + 'SellerOrderId' => seller_order_id, + 'MaxResultsPerPage' => max_results_per_page, + 'EasyShipShipmentStatuses' => csv(easy_ship_shipment_statuses), + 'ElectronicInvoiceStatuses' => csv(electronic_invoice_statuses), + 'NextToken' => next_token, + 'AmazonOrderIds' => csv(amazon_order_ids), + 'ActualFulfillmentSupplySourceId' => actual_fulfillment_supply_source_id, + 'IsISPU' => is_ispu, + 'StoreChainStoreId' => store_chain_store_id, + 'EarliestDeliveryDateBefore' => earliest_delivery_date_before, + 'EarliestDeliveryDateAfter' => earliest_delivery_date_after, + 'LatestDeliveryDateBefore' => latest_delivery_date_before, + 'LatestDeliveryDateAfter' => latest_delivery_date_after + } + + request(:get, '/orders/v0/orders', query: query, rdt: rdt) + end + + # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body for the `updateShipmentStatus` operation. (UpdateShipmentStatusRequest) + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def update_shipment_status(body, order_id, rdt: nil) + request(:post, "/orders/v0/orders/#{encode(order_id)}/shipment", body: body, rdt: rdt) + end + + # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body for the `updateVerificationStatus` operation. (UpdateVerificationStatusRequest) + # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def update_verification_status(body, order_id, rdt: nil) + request(:patch, "/orders/v0/orders/#{encode(order_id)}/regulatedInfo", body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/reports_2021.rb b/lib/amazon_sp_clients/v2/apis/reports_2021.rb new file mode 100644 index 0000000..d32968e --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/reports_2021.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Reports + # + # The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. + # + # OpenAPI spec version: 2021-06-30 + class Reports2021 < Api + # Cancels the report that you specify. Only reports with `processingStatus=IN_QUEUE` can be cancelled. Cancelled reports are returned in subsequent calls to the `getReport` and `getReports` operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_id [String] The identifier for the report. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def cancel_report(report_id, rdt: nil) + request(:delete, "/reports/2021-06-30/reports/#{encode(report_id)}", rdt: rdt) + end + + # Cancels the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def cancel_report_schedule(report_schedule_id, rdt: nil) + request(:delete, "/reports/2021-06-30/schedules/#{encode(report_schedule_id)}", rdt: rdt) + end + + # Creates a report. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Information required to create the report. (CreateReportSpecification) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_report(body, rdt: nil) + request(:post, '/reports/2021-06-30/reports', body: body, rdt: rdt) + end + + # Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it will be cancelled and replaced with this one. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Information required to create the report schedule. (CreateReportScheduleSpecification) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_report_schedule(body, rdt: nil) + request(:post, '/reports/2021-06-30/schedules', body: body, rdt: rdt) + end + + # Returns report details (including the `reportDocumentId`, if available) for the report that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_id [String] The identifier for the report. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_report(report_id, rdt: nil) + request(:get, "/reports/2021-06-30/reports/#{encode(report_id)}", rdt: rdt) + end + + # Returns the information required for retrieving a report document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_document_id [String] The identifier for the report document. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_report_document(report_document_id, rdt: nil) + request(:get, "/reports/2021-06-30/documents/#{encode(report_document_id)}", rdt: rdt) + end + + # Returns report schedule details for the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in combination with a seller ID. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_report_schedule(report_schedule_id, rdt: nil) + request(:get, "/reports/2021-06-30/schedules/#{encode(report_schedule_id)}", rdt: rdt) + end + + # Returns report schedule details that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_types [Array] A list of report types used to filter report schedules. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_report_schedules(report_types, rdt: nil) + query = { + 'reportTypes' => csv(report_types) + } + + request(:get, '/reports/2021-06-30/schedules', query: query, rdt: rdt) + end + + # Returns report details for the reports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param report_types [Array, nil] A list of report types used to filter reports. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required. + # @param processing_statuses [Array, nil] A list of processing statuses used to filter reports. + # @param marketplace_ids [Array, nil] A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. + # @param page_size [Integer, nil] The maximum number of reports to return in a single call. + # @param created_since [String, nil] The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days. + # @param created_until [String, nil] The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. + # @param next_token [String, nil] A string token returned in the response to your previous request. `nextToken` is returned when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the `getReports` operation and include this token as the only parameter. Specifying `nextToken` with any other parameters will cause the request to fail. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: nil, created_since: nil, created_until: nil, next_token: nil, rdt: nil) + query = { + 'reportTypes' => csv(report_types), + 'processingStatuses' => csv(processing_statuses), + 'marketplaceIds' => csv(marketplace_ids), + 'pageSize' => page_size, + 'createdSince' => created_since, + 'createdUntil' => created_until, + 'nextToken' => next_token + } + + request(:get, '/reports/2021-06-30/reports', query: query, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/tokens_2021.rb b/lib/amazon_sp_clients/v2/apis/tokens_2021.rb new file mode 100644 index 0000000..303c569 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/tokens_2021.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Tokens + # + # The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). + # + # OpenAPI spec version: 2021-03-01 + class Tokens2021 < Api + # Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The restricted data token request details. (CreateRestrictedDataTokenRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def create_restricted_data_token(body, rdt: nil) + request(:post, '/tokens/2021-03-01/restrictedDataToken', body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb b/lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb new file mode 100644 index 0000000..557079a --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Direct Fulfillment Inventory Updates + # + # The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates. + # + # OpenAPI spec version: v1 + class VdfInventoryV1 < Api + # Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body containing the inventory update data to submit. (SubmitInventoryUpdateRequest) + # @param warehouse_id [String] Identifier for the warehouse for which to update inventory. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_inventory_update(body, warehouse_id, rdt: nil) + request(:post, "/vendor/directFulfillment/inventory/v1/warehouses/#{encode(warehouse_id)}/items", body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb b/lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb new file mode 100644 index 0000000..1292de3 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Direct Fulfillment Orders + # + # The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data. + # + # OpenAPI spec version: v1 + class VdfOrdersV1 < Api + # Returns purchase order information for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param purchase_order_number [String] The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_order(purchase_order_number, rdt: nil) + request(:get, "/vendor/directFulfillment/orders/v1/purchaseOrders/#{encode(purchase_order_number)}", rdt: rdt) + end + + # Returns a list of purchase orders created during the time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param created_after [String] Purchase orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String] Purchase orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param ship_from_party_id [String, nil] The vendor warehouse identifier for the fulfillment warehouse. If not specified, the result will contain orders for all warehouses. + # @param status [String, nil] Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status. + # @param limit [Integer, nil] The limit to the number of purchase orders returned. + # @param sort_order [String, nil] Sort the list in ascending or descending order by order creation date. + # @param next_token [String, nil] Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call. + # @param include_details [String, nil] When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil, next_token: nil, include_details: nil, rdt: nil) + query = { + 'shipFromPartyId' => ship_from_party_id, + 'status' => status, + 'limit' => limit, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'sortOrder' => sort_order, + 'nextToken' => next_token, + 'includeDetails' => include_details + } + + request(:get, '/vendor/directFulfillment/orders/v1/purchaseOrders', query: query, rdt: rdt) + end + + # Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body containing the acknowledgement to an order. (SubmitAcknowledgementRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_acknowledgement(body, rdt: nil) + request(:post, '/vendor/directFulfillment/orders/v1/acknowledgements', body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb b/lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb new file mode 100644 index 0000000..051df4a --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb @@ -0,0 +1,139 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Direct Fulfillment Shipping + # + # The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data. + # + # OpenAPI spec version: v1 + class VdfShippingV1 < Api + # Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param purchase_order_number [String] Purchase order number of the shipment for which to return the invoice. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_customer_invoice(purchase_order_number, rdt: nil) + request(:get, "/vendor/directFulfillment/shipping/v1/customerInvoices/#{encode(purchase_order_number)}", rdt: rdt) + end + + # Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param created_after [String] Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String] Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param ship_from_party_id [String, nil] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses. + # @param limit [Integer, nil] The limit to the number of records returned + # @param sort_order [String, nil] Sort ASC or DESC by order creation date. + # @param next_token [String, nil] Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil, next_token: nil, rdt: nil) + query = { + 'shipFromPartyId' => ship_from_party_id, + 'limit' => limit, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'sortOrder' => sort_order, + 'nextToken' => next_token + } + + request(:get, '/vendor/directFulfillment/shipping/v1/customerInvoices', query: query, rdt: rdt) + end + + # Returns a packing slip based on the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param purchase_order_number [String] The purchaseOrderNumber for the packing slip you want. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_packing_slip(purchase_order_number, rdt: nil) + request(:get, "/vendor/directFulfillment/shipping/v1/packingSlips/#{encode(purchase_order_number)}", rdt: rdt) + end + + # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search must not be more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param created_after [String] Packing slips that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String] Packing slips that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param ship_from_party_id [String, nil] The vendor warehouseId for order fulfillment. If not specified the result will contain orders for all warehouses. + # @param limit [Integer, nil] The limit to the number of records returned + # @param sort_order [String, nil] Sort ASC or DESC by packing slip creation date. + # @param next_token [String, nil] Used for pagination when there are more packing slips than the specified result size limit. The token value is returned in the previous API call. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil, next_token: nil, rdt: nil) + query = { + 'shipFromPartyId' => ship_from_party_id, + 'limit' => limit, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'sortOrder' => sort_order, + 'nextToken' => next_token + } + + request(:get, '/vendor/directFulfillment/shipping/v1/packingSlips', query: query, rdt: rdt) + end + + # Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param purchase_order_number [String] The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_shipping_label(purchase_order_number, rdt: nil) + request(:get, "/vendor/directFulfillment/shipping/v1/shippingLabels/#{encode(purchase_order_number)}", rdt: rdt) + end + + # Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param created_after [String] Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String] Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format. + # @param ship_from_party_id [String, nil] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses. + # @param limit [Integer, nil] The limit to the number of records returned. + # @param sort_order [String, nil] Sort ASC or DESC by order creation date. + # @param next_token [String, nil] Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil, next_token: nil, rdt: nil) + query = { + 'shipFromPartyId' => ship_from_party_id, + 'limit' => limit, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'sortOrder' => sort_order, + 'nextToken' => next_token + } + + request(:get, '/vendor/directFulfillment/shipping/v1/shippingLabels', query: query, rdt: rdt) + end + + # Submits one or more shipment confirmations for vendor orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Request body containing the shipment confirmations data. (SubmitShipmentConfirmationsRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_shipment_confirmations(body, rdt: nil) + request(:post, '/vendor/directFulfillment/shipping/v1/shipmentConfirmations', body: body, rdt: rdt) + end + + # This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their order, when the package is outside of Amazon Network visibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Request body containing the shipment status update data. (SubmitShipmentStatusUpdatesRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_shipment_status_updates(body, rdt: nil) + request(:post, '/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates', body: body, rdt: rdt) + end + + # Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Request body containing one or more shipping labels data. (SubmitShippingLabelsRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_shipping_label_request(body, rdt: nil) + request(:post, '/vendor/directFulfillment/shipping/v1/shippingLabels', body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vendor_invoices.rb b/lib/amazon_sp_clients/v2/apis/vendor_invoices.rb new file mode 100644 index 0000000..1e67de0 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vendor_invoices.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Retail Procurement Payments + # + # The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data. + # + # OpenAPI spec version: v1 + class VendorInvoices < Api + # Submit new invoices to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] The request body containing the invoice data to submit. (SubmitInvoicesRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_invoices(body, rdt: nil) + request(:post, '/vendor/payments/v1/invoices', body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vendor_orders.rb b/lib/amazon_sp_clients/v2/apis/vendor_orders.rb new file mode 100644 index 0000000..d802200 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vendor_orders.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Retail Procurement Orders + # + # The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. + # + # OpenAPI spec version: v1 + class VendorOrders < Api + # Returns a purchase order based on the `purchaseOrderNumber` value that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param purchase_order_number [String] The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_purchase_order(purchase_order_number, rdt: nil) + request(:get, "/vendor/orders/v1/purchaseOrders/#{encode(purchase_order_number)}", rdt: rdt) + end + + # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param limit [Integer, nil] The limit to the number of records returned. Default value is 100 records. + # @param created_after [String, nil] Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String, nil] Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format. + # @param sort_order [String, nil] Sort in ascending or descending order by purchase order creation date. + # @param next_token [String, nil] Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call + # @param include_details [String, nil] When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true. + # @param changed_after [String, nil] Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param changed_before [String, nil] Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param po_item_state [String, nil] Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero. + # @param is_po_changed [String, nil] When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false. + # @param purchase_order_state [String, nil] Filters purchase orders based on the purchase order state. + # @param ordering_vendor_code [String, nil] Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_purchase_orders(limit: nil, created_after: nil, created_before: nil, sort_order: nil, next_token: nil, include_details: nil, changed_after: nil, changed_before: nil, po_item_state: nil, is_po_changed: nil, purchase_order_state: nil, ordering_vendor_code: nil, rdt: nil) + query = { + 'limit' => limit, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'sortOrder' => sort_order, + 'nextToken' => next_token, + 'includeDetails' => include_details, + 'changedAfter' => changed_after, + 'changedBefore' => changed_before, + 'poItemState' => po_item_state, + 'isPOChanged' => is_po_changed, + 'purchaseOrderState' => purchase_order_state, + 'orderingVendorCode' => ordering_vendor_code + } + + request(:get, '/vendor/orders/v1/purchaseOrders', query: query, rdt: rdt) + end + + # Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param limit [Integer, nil] The limit to the number of records returned. Default value is 100 records. + # @param sort_order [String, nil] Sort in ascending or descending order by purchase order creation date. + # @param next_token [String, nil] Used for pagination when there are more purchase orders than the specified result size limit. + # @param created_after [String, nil] Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param created_before [String, nil] Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param updated_after [String, nil] Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param updated_before [String, nil] Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format. + # @param purchase_order_number [String, nil] Provides purchase order status for the specified purchase order number. + # @param purchase_order_status [String, nil] Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses. + # @param item_confirmation_status [String, nil] Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included. + # @param item_receive_status [String, nil] Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included. + # @param ordering_vendor_code [String, nil] Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned. + # @param ship_to_party_id [String, nil] Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_purchase_orders_status(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil, updated_after: nil, updated_before: nil, purchase_order_number: nil, purchase_order_status: nil, item_confirmation_status: nil, item_receive_status: nil, ordering_vendor_code: nil, ship_to_party_id: nil, rdt: nil) + query = { + 'limit' => limit, + 'sortOrder' => sort_order, + 'nextToken' => next_token, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'updatedAfter' => updated_after, + 'updatedBefore' => updated_before, + 'purchaseOrderNumber' => purchase_order_number, + 'purchaseOrderStatus' => purchase_order_status, + 'itemConfirmationStatus' => item_confirmation_status, + 'itemReceiveStatus' => item_receive_status, + 'orderingVendorCode' => ordering_vendor_code, + 'shipToPartyId' => ship_to_party_id + } + + request(:get, '/vendor/orders/v1/purchaseOrdersStatus', query: query, rdt: rdt) + end + + # Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param body [Hash] Submits acknowledgements for one or more purchase orders from a vendor. (SubmitAcknowledgementRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_acknowledgement(body, rdt: nil) + request(:post, '/vendor/orders/v1/acknowledgements', body: body, rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb b/lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb new file mode 100644 index 0000000..0d76d4a --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Retail Procurement Transaction Status + # + # The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors. + # + # OpenAPI spec version: v1 + class VendorTransactionStatus < Api + # Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param transaction_id [String] The GUID provided by Amazon in the 'transactionId' field in response to the post request of a specific transaction. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_transaction(transaction_id, rdt: nil) + request(:get, "/vendor/transactions/v1/transactions/#{encode(transaction_id)}", rdt: rdt) + end + end + end +end diff --git a/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb b/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb new file mode 100644 index 0000000..30976db --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # Selling Partner API for Retail Procurement Shipments + # + # The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors. + # + # OpenAPI spec version: v1 + class VendorsShipments < Api + # GetShipmentDetails + # + # @param limit [Integer, nil] The limit to the number of records returned. Default value is 50 records. + # @param sort_order [String, nil] Sort in ascending or descending order by purchase order creation date. + # @param next_token [String, nil] Used for pagination when there are more shipments than the specified result size limit. + # @param created_after [String, nil] Get Shipment Details that became available after this timestamp will be included in the result. Must be in ISO 8601 format. + # @param created_before [String, nil] Get Shipment Details that became available before this timestamp will be included in the result. Must be in ISO 8601 format. + # @param shipment_confirmed_before [String, nil] Get Shipment Details by passing Shipment confirmed create Date Before. Must be in ISO 8601 format. + # @param shipment_confirmed_after [String, nil] Get Shipment Details by passing Shipment confirmed create Date After. Must be in ISO 8601 format. + # @param package_label_created_before [String, nil] Get Shipment Details by passing Package label create Date by buyer. Must be in ISO 8601 format. + # @param package_label_created_after [String, nil] Get Shipment Details by passing Package label create Date After by buyer. Must be in ISO 8601 format. + # @param shipped_before [String, nil] Get Shipment Details by passing Shipped Date Before. Must be in ISO 8601 format. + # @param shipped_after [String, nil] Get Shipment Details by passing Shipped Date After. Must be in ISO 8601 format. + # @param estimated_delivery_before [String, nil] Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. + # @param estimated_delivery_after [String, nil] Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. + # @param shipment_delivery_before [String, nil] Get Shipment Details by passing Shipment Delivery Date Before. Must be in ISO 8601 format. + # @param shipment_delivery_after [String, nil] Get Shipment Details by passing Shipment Delivery Date After. Must be in ISO 8601 format. + # @param requested_pick_up_before [String, nil] Get Shipment Details by passing Before Requested pickup date. Must be in ISO 8601 format. + # @param requested_pick_up_after [String, nil] Get Shipment Details by passing After Requested pickup date. Must be in ISO 8601 format. + # @param scheduled_pick_up_before [String, nil] Get Shipment Details by passing Before scheduled pickup date. Must be in ISO 8601 format. + # @param scheduled_pick_up_after [String, nil] Get Shipment Details by passing After Scheduled pickup date. Must be in ISO 8601 format. + # @param current_shipment_status [String, nil] Get Shipment Details by passing Current shipment status. + # @param vendor_shipment_identifier [String, nil] Get Shipment Details by passing Vendor Shipment ID + # @param buyer_reference_number [String, nil] Get Shipment Details by passing buyer Reference ID + # @param buyer_warehouse_code [String, nil] Get Shipping Details based on buyer warehouse code. This value should be same as 'shipToParty.partyId' in the Shipment. + # @param seller_warehouse_code [String, nil] Get Shipping Details based on vendor warehouse code. This value should be same as 'sellingParty.partyId' in the Shipment. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_shipment_details(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil, shipment_confirmed_before: nil, shipment_confirmed_after: nil, package_label_created_before: nil, package_label_created_after: nil, shipped_before: nil, shipped_after: nil, estimated_delivery_before: nil, estimated_delivery_after: nil, shipment_delivery_before: nil, shipment_delivery_after: nil, requested_pick_up_before: nil, requested_pick_up_after: nil, scheduled_pick_up_before: nil, scheduled_pick_up_after: nil, current_shipment_status: nil, vendor_shipment_identifier: nil, buyer_reference_number: nil, buyer_warehouse_code: nil, seller_warehouse_code: nil, rdt: nil) + query = { + 'limit' => limit, + 'sortOrder' => sort_order, + 'nextToken' => next_token, + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'shipmentConfirmedBefore' => shipment_confirmed_before, + 'shipmentConfirmedAfter' => shipment_confirmed_after, + 'packageLabelCreatedBefore' => package_label_created_before, + 'packageLabelCreatedAfter' => package_label_created_after, + 'shippedBefore' => shipped_before, + 'shippedAfter' => shipped_after, + 'estimatedDeliveryBefore' => estimated_delivery_before, + 'estimatedDeliveryAfter' => estimated_delivery_after, + 'shipmentDeliveryBefore' => shipment_delivery_before, + 'shipmentDeliveryAfter' => shipment_delivery_after, + 'requestedPickUpBefore' => requested_pick_up_before, + 'requestedPickUpAfter' => requested_pick_up_after, + 'scheduledPickUpBefore' => scheduled_pick_up_before, + 'scheduledPickUpAfter' => scheduled_pick_up_after, + 'currentShipmentStatus' => current_shipment_status, + 'vendorShipmentIdentifier' => vendor_shipment_identifier, + 'buyerReferenceNumber' => buyer_reference_number, + 'buyerWarehouseCode' => buyer_warehouse_code, + 'sellerWarehouseCode' => seller_warehouse_code + } + + request(:get, '/vendor/shipping/v1/shipments', query: query, rdt: rdt) + end + + # Returns small parcel shipment labels based on the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # + # @param limit [Integer, nil] The limit to the number of records returned. Default value is 50 records. + # @param sort_order [String, nil] Sort the list by shipment label creation date in ascending or descending order. + # @param next_token [String, nil] A token that is used to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. + # @param label_created_after [String, nil] Shipment labels created after this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. + # @param label_created_before [String, nil] Shipment labels created before this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. + # @param buyer_reference_number [String, nil] Get Shipment labels by passing buyer reference number. + # @param vendor_shipment_identifier [String, nil] Get Shipment labels by passing vendor shipment identifier. + # @param seller_warehouse_code [String, nil] Get Shipping labels based on vendor warehouse code. This value must be same as the `sellingParty.partyId` in the shipment. + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def get_shipment_labels(limit: nil, sort_order: nil, next_token: nil, label_created_after: nil, label_created_before: nil, buyer_reference_number: nil, vendor_shipment_identifier: nil, seller_warehouse_code: nil, rdt: nil) + query = { + 'limit' => limit, + 'sortOrder' => sort_order, + 'nextToken' => next_token, + 'labelCreatedAfter' => label_created_after, + 'labelCreatedBefore' => label_created_before, + 'buyerReferenceNumber' => buyer_reference_number, + 'vendorShipmentIdentifier' => vendor_shipment_identifier, + 'sellerWarehouseCode' => seller_warehouse_code + } + + request(:get, '/vendor/shipping/v1/transportLabels', query: query, rdt: rdt) + end + + # SubmitShipmentConfirmations + # + # @param body [Hash] A request to submit shipment confirmation. (SubmitShipmentConfirmationsRequest) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_shipment_confirmations(body, rdt: nil) + request(:post, '/vendor/shipping/v1/shipmentConfirmations', body: body, rdt: rdt) + end + + # SubmitShipments + # + # @param body [Hash] A request to submit shipment request. (SubmitShipments) + # @param rdt [Array, nil] send a restricted data token for these resources + # @return [AmazonSpClients::ApiResponse] + def submit_shipments(body, rdt: nil) + request(:post, '/vendor/shipping/v1/shipments', body: body, rdt: rdt) + end + end + end +end From 85efcc4cfaecbcc1e4628995fbf5cec283c7a7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:25:08 +0200 Subject: [PATCH 48/83] Pin the V2 API contract Two specs hold the generated surface still: every V2 class is an Api subclass the client hands out and offers exactly the operations of its v1 module, with request shapes checked on real generated methods; and `require 'amazon_sp_clients/v2'` loads all of V2 in a fresh process without loading v1. The console loads V2 too. --- bin/console | 1 + spec/amazon_sp_clients/v2/apis_spec.rb | 132 ++++++++++++++++++++++ spec/amazon_sp_clients/v2/loading_spec.rb | 36 ++++++ 3 files changed, 169 insertions(+) create mode 100644 spec/amazon_sp_clients/v2/apis_spec.rb create mode 100644 spec/amazon_sp_clients/v2/loading_spec.rb diff --git a/bin/console b/bin/console index 7b81bee..f09cfdb 100755 --- a/bin/console +++ b/bin/console @@ -2,6 +2,7 @@ require "bundler/setup" require "amazon_sp_clients" +require "amazon_sp_clients/v2" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. diff --git a/spec/amazon_sp_clients/v2/apis_spec.rb b/spec/amazon_sp_clients/v2/apis_spec.rb new file mode 100644 index 0000000..1c4c8fc --- /dev/null +++ b/spec/amazon_sp_clients/v2/apis_spec.rb @@ -0,0 +1,132 @@ +require 'spec_helper' +require 'amazon_sp_clients/v2' + +# The generated V2 API classes. Their contract: one class per module, +# reachable from the client, offering exactly the operations the v1 +# module offers. Request shapes are checked on real generated methods. +RSpec.describe 'V2 API classes' do + v2 = AmazonSpClients::V2 + + modules = %w[ + fba_inventory feeds_2021 fulfillment_outbound_2020 listings_items_2021 orders_v0 + reports_2021 tokens_2021 vdf_inventory_v1 vdf_orders_v1 vdf_shipping_v1 + vendor_invoices vendor_orders vendor_transaction_status vendors_shipments + ].freeze + + let(:base_url) { 'https://sellingpartnerapi-na.amazon.com' } + let(:client) { v2::Client.new(v2::Config.new) { 'ACCESS' } } + + def camelize(name) + name.split('_').map(&:capitalize).join + end + + # Operation names of the v1 module: every generated method except the + # _with_http_info twins and the api_client accessor. + def v1_operations(name) + require "amazon_sp_clients/sp_#{name}" + v1_module = AmazonSpClients.const_get("Sp#{camelize(name)}") + + v1_module.constants.flat_map do |klass_name| + v1_module.const_get(klass_name).public_instance_methods(false).map(&:to_s) + end.grep_v(/_with_http_info\z|\Aapi_client/).sort + end + + modules.each do |name| + describe name do + it 'is an Api subclass the client hands out' do + klass = v2.const_get(camelize(name)) + + expect(klass.superclass).to be(v2::Api) + expect(client.public_send(name)).to be_a(klass) + expect(client.public_send(name)).to be(client.public_send(name)) + end + + it 'offers the same operations as the v1 module' do + klass = v2.const_get(camelize(name)) + + expect(klass.public_instance_methods(false).map(&:to_s).sort).to eq(v1_operations(name)) + end + end + end + + it 'covers all 72 operations' do + total = modules.sum { |name| v2.const_get(camelize(name)).public_instance_methods(false).size } + + expect(total).to eq(72) + end + + describe 'request shapes' do + it 'sends required and given query params, joins arrays, drops nils' do + stub = stub_request(:get, "#{base_url}/orders/v0/orders") + .with(query: { 'MarketplaceIds' => 'A,B', 'CreatedAfter' => '2026-09-01T00:00:00Z' }) + .to_return(status: 200, body: '{"payload":{"Orders":[]}}') + + response = client.orders_v0.get_orders(%w[A B], created_after: '2026-09-01T00:00:00Z', + next_token: nil) + + expect(stub).to have_been_requested + expect(response.payload).to eq(Orders: []) + end + + it 'sends false and an empty array as v1 did' do + stub = stub_request(:get, "#{base_url}/fba/inventory/v1/summaries") + .with(query: { 'granularityType' => 'Marketplace', 'granularityId' => 'M', + 'marketplaceIds' => 'M', 'details' => 'false', 'sellerSkus' => '' }) + .to_return(status: 200, body: '{}') + + client.fba_inventory + .get_inventory_summaries('Marketplace', 'M', ['M'], details: false, seller_skus: []) + + expect(stub).to have_been_requested + end + + it 'encodes path params' do + stub = stub_request(:get, "#{base_url}/orders/v0/orders/111-222%2F3") + .to_return(status: 200, body: '{}') + + client.orders_v0.get_order('111-222/3') + + expect(stub).to have_been_requested + end + + it 'sends header params and the JSON body' do + stub = stub_request(:post, "#{base_url}/fba/inventory/v1/items/inventory") + .with(body: '{"inventoryItems":[]}', + headers: { 'x-amzn-idempotency-token' => 'IDEMP' }) + .to_return(status: 200, body: '{}') + + client.fba_inventory.add_inventory({ inventoryItems: [] }, 'IDEMP') + + expect(stub).to have_been_requested + end + + it 'returns an ApiResponse for an operation without a response body' do + stub_request(:post, "#{base_url}/orders/v0/orders/1/shipmentConfirmation") + .to_return(status: 204, body: '', headers: { 'x-amzn-RateLimit-Limit' => '2' }) + + response = client.orders_v0.confirm_shipment({ packageDetail: {} }, '1') + + expect(response).to be_a(AmazonSpClients::ApiResponse) + expect(response.reported_rate_limit).to eq(2.0) + end + + it 'takes rdt on every operation' do + tokens = stub_request(:post, "#{base_url}/tokens/2021-03-01/restrictedDataToken") + .to_return(status: 200, body: '{"restrictedDataToken":"RDT","expiresIn":3600}') + stub_request(:get, "#{base_url}/reports/2021-06-30/documents/D1") + .with(headers: { 'x-amz-access-token' => 'RDT' }) + .to_return(status: 200, body: '{"url":"https://s3/doc"}') + + path = '/reports/2021-06-30/documents/D1' + response = client.reports_2021.get_report_document('D1', rdt: [v2::RDT.resource('GET', path)]) + + expect(tokens).to have_been_requested + expect(response.payload).to eq(url: 'https://s3/doc') + end + + it 'rejects option keys that are not parameters' do + expect { client.orders_v0.get_orders(['A'], order_status: 'Shipped') } + .to raise_error(ArgumentError, /order_status/) + end + end +end diff --git a/spec/amazon_sp_clients/v2/loading_spec.rb b/spec/amazon_sp_clients/v2/loading_spec.rb new file mode 100644 index 0000000..77e40b6 --- /dev/null +++ b/spec/amazon_sp_clients/v2/loading_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' +require 'open3' +require 'rbconfig' + +# V2 shares only the dependency-free files with v1 (ApiResponse, +# ApiError, the marketplace tables, the adapter loader). This runs in a +# fresh process because the suite itself always has v1 loaded. +RSpec.describe 'require "amazon_sp_clients/v2"' do + it 'loads every V2 class without loading v1' do + script = <<~RUBY + require 'amazon_sp_clients/v2' + AmazonSpClients::V2.constants.each { |c| AmazonSpClients::V2.const_get(c) } + + v1_only = %i[Session ApiClient Configuration TokenExchangeAuth Uploader Downloader + AuthResponse Middlewares] + loaded_v1 = v1_only.select { |c| AmazonSpClients.const_defined?(c, false) } + loaded_v1 += AmazonSpClients.constants.grep(/\\ASp[A-Z]/) + vendor_dir = File.expand_path('vendor') + vendored = $LOADED_FEATURES.select { |f| f.start_with?("\#{vendor_dir}/") } + client = AmazonSpClients::V2::Client + accessors = client.instance_methods(false).count do |m| + client.instance_method(m).source_location.first.end_with?('/v2/apis.rb') + end + + puts loaded_v1.inspect + puts vendored.size + puts accessors + RUBY + + out, err, status = Open3.capture3(RbConfig.ruby, '-Ilib', '-e', script) + + expect(err).to eq('') + expect(status).to be_success + expect(out.lines.map(&:strip)).to eq(['[]', '0', '14']) + end +end From 711421f71ee857761c008e97755c1894c9af65a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:27:38 +0200 Subject: [PATCH 49/83] Document V2 and bump to 2.0.0 README gains the V2 section: setup, calls, restricted data tokens, the error table with the rescue order, document helpers, and the v1 to V2 migration table. CHANGELOG gets the 2.0.0 entry; the major marks the new namespace, the Faraday requirement is unchanged. CLAUDE.md describes the V2 files and the second generated-code contract. All three lockfiles are re-locked with the version bump. --- CHANGELOG.md | 30 +++++++++ CLAUDE.md | 47 ++++++++++++- Gemfile.lock | 2 +- README.md | 110 +++++++++++++++++++++++++++++-- gemfiles/faraday_1.gemfile.lock | 6 +- gemfiles/faraday_2.gemfile.lock | 6 +- lib/amazon_sp_clients/version.rb | 2 +- 7 files changed, 188 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7236500..0599e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,36 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. +## [2.0.0] - 2026-09-03 + +### Added + +- The `AmazonSpClients::V2` namespace (`require 'amazon_sp_clients/v2'`): + a per-merchant `Client` with an explicit, frozen `Config` instead of + the thread-local global; a thread-safe token source (a callback, or + LWA refresh with one exchange per expiry); restricted data tokens as + an `rdt:` argument with per-resource caching; typed errors under + `V2::Error`; and one generated class per API module, for the same 14 + modules. Responses are the same `ApiResponse`. The README has the + usage and the v1 to V2 migration table. +- Feed upload, feed result download and report download on the V2 + client. Report documents come back gunzipped and UTF-8 tagged. +- `rake yard:verify` and a CI job that fail when a public V2 object + has no doc comment. +- A second template set in the generator. Each `codegen-config.yml` + entry lists its template sets. Generation now refuses to run while + tracked generated files belong to no configured module, and fails on + names that Ruby or the V2 method signature already use. + +### Changed + +- The deprecated AWS IAM and logger settings stay as no-ops. They were + announced for removal in 2.0, but every consumer still sets them, so + they leave together with the v1 API in a later major. +- The Faraday requirement is unchanged (`>= 1.10, < 3`). The major + version marks the new namespace, not a dependency change. v1 is + unchanged. + ## [1.9.0] - 2026-09-01 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index 42eedeb..7a5b6ee 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,8 +6,10 @@ clients: hand-written core code plus generated output. ## Layout -- `lib/amazon_sp_clients/` — hand-written core. Edit here. -- `vendor//` — generated client per API. Committed, but never +- `lib/amazon_sp_clients/` — hand-written v1 core. Edit here. +- `lib/amazon_sp_clients/v2/` — hand-written V2 core (see below), except + `apis.rb` and `apis/`, which are generated. +- `vendor//` — generated v1 client per API. Committed, but never edit by hand. It is overwritten on every regeneration. - `lib/generator/` — the code generator (pure Ruby + ERB, no Java). Not shipped with the gem. Templates live in `lib/generator/templates/`. @@ -37,10 +39,33 @@ clients: hand-written core code plus generated output. and redacts auth headers from the error payload. - `sp_*.rb` — autogenerated one-line requires that point into `vendor/`. Do not edit; the generator writes them. +- `marketplaces.rb` — region and marketplace tables, shared with V2. + +## V2 (lib/amazon_sp_clients/v2) + +`require 'amazon_sp_clients/v2'` loads V2 without v1. It shares only +`ApiResponse`, `ApiError`, `marketplaces.rb` and `adapter_loader.rb`. +Every public object must have a YARD comment (`rake yard:verify`). + +- `config.rb` — frozen `Config` (Data): endpoint, sandbox, timeouts, + user agent, optional LWA app credentials. No global. +- `client.rb` — one `Client` per merchant: the connection, `request`, + the RDT cache, `api(klass)` factory, document helpers. +- `credentials.rb` — `Callback` (block per request) and `RefreshToken` + (LWA, mutex, one exchange per expiry). Tokens are returned, never + stored and read back. +- `lwa.rb`, `token.rb` — the LWA exchange and the frozen `Token`. +- `rdt.rb` — `RDT::Resource`, presets, the `Cache` (own mutex; lock order + is cache then credentials). +- `errors.rb`, `error_mapper.rb` — the `V2::Error` tree and the + status/exception mapping. Wrap only `ErrorMapper::TRANSPORT_ERRORS`, + never `StandardError`. +- `documents.rb` — presigned S3 upload/download. +- `api.rb` — base class of the generated classes. ## Generated code contract -The generator emits API classes matching the old swagger-codegen output: +Two template sets. v1 (`vendor/`) matches the old swagger-codegen output: - everything lives under the `AmazonSpClients` namespace, - generated APIs take a `Session` and use `AmazonSpClients::ApiClient`, @@ -50,9 +75,24 @@ The generator emits API classes matching the old swagger-codegen output: per-vendor api_client/configuration. `vendor//` holds exactly `lib/sp_.rb` plus `lib/sp_/api/*.rb`, nothing else. +V2 (`lib/amazon_sp_clients/v2/apis/.rb` plus `apis.rb`): + +- one class per module, `AmazonSpClients::V2:: < V2::Api`, + built by `client.`, +- required params positional in v1 order, optional params as keywords, + plus `rdt:`; nil keywords are left off the wire, +- every operation returns `ApiResponse`, +- `apis.rb` holds an autoload and a `Client` accessor per module. + +`codegen-config.yml` lists each module's template sets (`templates:`). +The generator refuses to run while tracked files under `vendor/`, +`lib/amazon_sp_clients/sp_*.rb` or the V2 apis paths belong to no +configured module, and fails on names Ruby or the V2 signature use. + To change generated code, change the generator or its templates, run `rake generate`, and review the diff. CI runs `rake generate:verify`, which fails if committed output drifts from regeneration at the pin. +The V2 templates are also pinned by `spec/generator/v2_spec.rb`. ## Commands @@ -62,6 +102,7 @@ bundle exec rubocop # lint (vendor/ and sp_*.rb excluded) bundle exec rake generate # regenerate vendor/ at the pinned SHA bundle exec rake generate:verify # regenerate + fail on drift (CI) bundle exec rake generate:update # advance the pin + regenerate +bundle exec rake yard:verify # every public V2 object documented (CI) bin/console # irb with the gem loaded ``` diff --git a/Gemfile.lock b/Gemfile.lock index 25c7120..098712a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - amazon_sp_clients (1.9.0) + amazon_sp_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) diff --git a/README.md b/README.md index a00818b..d51a755 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,107 @@ addr_resp = orders_api.get_order_address('113-1435144-7135426', auth_names: [:pii]) ``` +## V2 client + +`AmazonSpClients::V2` is the second-generation client. It fixes the v1 +design flaws: no global config, a thread-safe token source, restricted +data tokens as a plain argument, and typed errors. v1 stays in the gem, +so you can migrate one class at a time. + +```ruby +require 'amazon_sp_clients/v2' + +config = AmazonSpClients::V2::Config.new( + endpoint: 'na', # 'na', 'eu', 'fe' or a country code such as 'de' + sandbox: false, + timeout: 60, # read/write seconds; open_timeout: 10 + client_id: nil, # LWA app credentials; only refresh-token clients and LWA need them + client_secret: nil +) + +# The block runs before every request and returns the current access token. +client = AmazonSpClients::V2::Client.new(config) { store.access_token } + +# Or let the client exchange a refresh token itself (needs client_id and client_secret). +client = AmazonSpClients::V2::Client.with_refresh_token(config, refresh_token) + +orders = client.orders_v0.get_orders(['ATVPDKIKX0DER'], created_after: '2026-09-01T00:00:00Z') +orders.payload[:Orders] # symbol keys, as in v1 +orders.payload[:NextToken] +orders.reported_rate_limit # Float from x-amzn-RateLimit-Limit, or nil +``` + +One client per merchant. It owns one connection and is safe to share +across threads. Required parameters are positional, in the same order +as v1; optional ones are keywords. Unknown keywords raise +`ArgumentError` (v1 ignored them), so pass only the parameters the +operation has. + +### Restricted data tokens + +Operations that return PII take `rdt:`, a list of restricted resources. +The client fetches the token, caches it until it expires, and sends it +instead of the access token. + +```ruby +rdt = AmazonSpClients::V2::RDT +client.orders_v0.get_orders(ids, created_after: since, rdt: rdt::ORDERS_AND_ITEMS) + +path = "/reports/2021-06-30/documents/#{doc_id}" +client.reports_2021.get_report_document(doc_id, rdt: [rdt.resource('GET', path)]) +``` + +### Errors + +Every failure is an `AmazonSpClients::V2::Error`. Match on the class +and on `code`, never on the message. + +| Class | When | +|---|---| +| `ThrottledError` | 429. Not a `ClientError`, so rescuing `ClientError` does not swallow it. | +| `UnauthorizedError`, `ForbiddenError` | 401, 403 | +| `NotFoundError` | 404 | +| `BadRequestError`, `ClientError` | 400, other 4xx. `code` holds the SP-API error code, e.g. `InvalidInput`. | +| `ServerError` | 5xx | +| `InvalidGrantError`, `InvalidClientError`, `AuthError` | LWA rejected the token request; `code` is `invalid_grant`, `invalid_client`, ... | +| `TimeoutError`, `ConnectionError` | no usable response; the original exception is `cause` | +| `ParseError` | a 2xx body that is not JSON | +| `DocumentError` | a presigned S3 upload or download failed | + +Rescue subclasses before parents. Every error carries `status`, +`request_id`, `request` and `response`, with secrets redacted. + +### Feed and report documents + +```ruby +client.upload_feed_document(feed_document_payload, 'text/xml; charset=UTF-8', body) +client.download_feed_result(feed_document_payload) # Hash with string keys +client.download_report_document(report_document_payload) # String, gunzipped when needed +``` + +### Migrating from v1 + +| v1 | V2 | +|---|---| +| `AmazonSpClients.configure` block | `Config.new(endpoint: ...)`, one per merchant | +| `AmazonSpClients.new_callback_session { token }` | `Client.new(config) { token }` | +| `AmazonSpClients.new_session(refresh_token)` | `Client.with_refresh_token(config, refresh_token)` | +| `TokenExchangeAuth.new(refresh_token).exchange` | `LWA.new(config).exchange(refresh_token: refresh_token)` | +| `response[:access_token]` | `token.access_token`, `token.expires_in`, `token.expires_at` | +| `SpOrdersV0::OrdersV0Api.new(session)` | `client.orders_v0` | +| `get_orders(ids, opts)` with an options Hash | `get_orders(ids, **opts)` with real parameter names only | +| `auth_names: [:orders_and_items]` | `rdt: RDT::ORDERS_AND_ITEMS` | +| `auth_names: [{ method: 'GET', path: path }]` | `rdt: [RDT.resource('GET', path)]` | +| `rescue Faraday::RetriableResponse` | `rescue V2::ThrottledError` | +| `rescue Faraday::ForbiddenError, Faraday::UnauthorizedError` | `rescue V2::ForbiddenError, V2::UnauthorizedError` | +| message starts with `Service 'token'` | `rescue V2::AuthError`, then `e.code` | +| message matches `InvalidInput` | `e.code == 'InvalidInput'` | +| `upload_feed_data`, `download_feed_report`, `download_report_document` | `client.upload_feed_document`, `client.download_feed_result`, `client.download_report_document` (the last one gunzips for you) | + ## Code generation -The API classes under `vendor/` are generated by `lib/generator` (plain +The v1 API classes under `vendor/` and the V2 classes under +`lib/amazon_sp_clients/v2/apis/` are generated by `lib/generator` (plain Ruby + ERB, no external tools) from Amazon's official [selling-partner-api-models](https://github.com/amzn/selling-partner-api-models) specs. The generator clones that repo into `amzn-models/` (gitignored) @@ -98,9 +196,13 @@ bundle exec rake generate:verify # regenerate and fail on any drift (runs in C bundle exec rake generate:update # pull latest specs, regenerate, advance the pin ``` -Which APIs get generated is controlled by `codegen-config.yml`. To adopt -newer Amazon specs, run `rake generate:update` and review the diff — -the pin file change plus the regenerated files — in its own PR. +Which APIs get generated, and with which template sets (`v1`, `v2`), is +controlled by `codegen-config.yml`. To adopt newer Amazon specs, run +`rake generate:update` and review the diff — the pin file change plus +the regenerated files — in its own PR. + +`bundle exec rake yard:verify` fails when a public V2 object has no doc +comment; CI runs it. Generated files carry a `Generated by: lib/generator` header. Never edit them by hand; change the generator (or the templates in diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index 86ce264..18ba05a 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (1.9.0) + amazon_sp_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -120,7 +120,7 @@ DEPENDENCIES CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (1.9.0) + amazon_sp_clients (2.0.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 @@ -168,7 +168,7 @@ CHECKSUMS unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d - yard (0.9.45) + yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51 BUNDLED WITH 4.0.11 diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index 3f5a12a..2ed0965 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (1.9.0) + amazon_sp_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -109,7 +109,7 @@ DEPENDENCIES CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (1.9.0) + amazon_sp_clients (2.0.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 @@ -151,7 +151,7 @@ CHECKSUMS unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d - yard (0.9.45) + yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51 BUNDLED WITH 4.0.11 diff --git a/lib/amazon_sp_clients/version.rb b/lib/amazon_sp_clients/version.rb index d6ead8d..332c284 100644 --- a/lib/amazon_sp_clients/version.rb +++ b/lib/amazon_sp_clients/version.rb @@ -1,3 +1,3 @@ module AmazonSpClients - VERSION = '1.9.0'.freeze + VERSION = '2.0.0'.freeze end From e369ef7e3063c9800c9dc712cb328d75f1ca4790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:39:07 +0200 Subject: [PATCH 50/83] Carry request context on parse errors ParseError was built from the status and body alone, so it lacked the request id and the redacted request every other V2 error carries, and the LWA variant could have leaked the token request body. The mapper now builds it from the same context as the rest. Found in review. --- lib/amazon_sp_clients/v2/client.rb | 12 ++---------- lib/amazon_sp_clients/v2/error_mapper.rb | 10 ++++++++++ lib/amazon_sp_clients/v2/lwa.rb | 8 ++------ spec/amazon_sp_clients/v2/client_spec.rb | 18 +++++++++++++----- spec/amazon_sp_clients/v2/error_mapper_spec.rb | 18 ++++++++++++++++++ spec/amazon_sp_clients/v2/lwa_spec.rb | 8 ++++++-- 6 files changed, 51 insertions(+), 23 deletions(-) diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb index 3028afc..5249b63 100644 --- a/lib/amazon_sp_clients/v2/client.rb +++ b/lib/amazon_sp_clients/v2/client.rb @@ -162,14 +162,7 @@ def parse(response) parsed = JSON.parse(body, symbolize_names: true) parsed.is_a?(Hash) ? parsed : { payload: parsed } rescue JSON::ParserError => e - raise ParseError.new("response body is not JSON: #{e.message}", **parse_context(response)) - end - - def parse_context(response) - { - status: response.status, - response: { status: response.status, headers: response.headers, body: response.body } - } + raise @errors.parse_error("response body is not JSON: #{e.message}", response) end # The Tokens API call inside the fetch goes out with the normal @@ -185,8 +178,7 @@ def fetch_restricted_token(resources) payload = response.payload token = payload[:restrictedDataToken] unless token - raise ParseError.new('token response has no restrictedDataToken', - **parse_context(response.response)) + raise @errors.parse_error('token response has no restrictedDataToken', response.response) end expires_in = payload[:expiresIn] diff --git a/lib/amazon_sp_clients/v2/error_mapper.rb b/lib/amazon_sp_clients/v2/error_mapper.rb index 749af11..b5dacea 100644 --- a/lib/amazon_sp_clients/v2/error_mapper.rb +++ b/lib/amazon_sp_clients/v2/error_mapper.rb @@ -76,6 +76,16 @@ def check!(response) raise error_for(env) end + # A 2xx response whose body could not be used, with the same + # redacted context every other error carries. + # + # @param message [String] + # @param response [Faraday::Response] + # @return [ParseError] + def parse_error(message, response) + ParseError.new(message, **context(response.env)) + end + # Wraps an exception raised by the transport. Call it inside the # rescue, so Ruby records the original exception as +cause+. # diff --git a/lib/amazon_sp_clients/v2/lwa.rb b/lib/amazon_sp_clients/v2/lwa.rb index 501108b..695fe5a 100644 --- a/lib/amazon_sp_clients/v2/lwa.rb +++ b/lib/amazon_sp_clients/v2/lwa.rb @@ -91,13 +91,9 @@ def parse(response) body = JSON.parse(response.body, symbolize_names: true) return body if body.is_a?(Hash) && body[:access_token] - raise ParseError.new('LWA response has no access_token', **parse_context(response)) + raise @errors.parse_error('LWA response has no access_token', response) rescue JSON::ParserError => e - raise ParseError.new("LWA response is not JSON: #{e.message}", **parse_context(response)) - end - - def parse_context(response) - { status: response.status, response: { status: response.status, body: response.body } } + raise @errors.parse_error("LWA response is not JSON: #{e.message}", response) end end end diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb index 761797e..5fd7dcd 100644 --- a/spec/amazon_sp_clients/v2/client_spec.rb +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -167,10 +167,16 @@ def rdt_body(token = 'RDT', expires_in: 3600) expect(client.request(:get, '/orders/v0/orders').payload).to eq([1, 2]) end - it 'raises ParseError on a 2xx body that is not JSON' do - stub_request(:get, orders_url).to_return(status: 200, body: '') - - expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::ParseError) + it 'raises ParseError with the request context on a 2xx body that is not JSON' do + stub_request(:get, orders_url) + .to_return(status: 200, body: '', headers: { 'x-amzn-RequestId' => 'RID' }) + + expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::ParseError) do |err| + expect(err.status).to eq(200) + expect(err.request_id).to eq('RID') + expect(err.request[:path]).to eq('/orders/v0/orders') + expect(err.request[:headers]['x-amz-access-token']).to eq('[FILTERED]') + end end it 'raises the mapped error on a non-2xx response' do @@ -312,7 +318,9 @@ def rdt_body(token = 'RDT', expires_in: 3600) stub_request(:post, tokens_url).to_return(status: 200, body: '{"expiresIn":3600}') expect { client.request(:get, '/orders/v0/orders', rdt: resources) } - .to raise_error(v2::ParseError, /restrictedDataToken/) + .to raise_error(v2::ParseError, /restrictedDataToken/) do |err| + expect(err.request[:path]).to eq('/tokens/2021-03-01/restrictedDataToken') + end end # The cache lock is held while the token request runs, and that diff --git a/spec/amazon_sp_clients/v2/error_mapper_spec.rb b/spec/amazon_sp_clients/v2/error_mapper_spec.rb index b356be9..d39ad30 100644 --- a/spec/amazon_sp_clients/v2/error_mapper_spec.rb +++ b/spec/amazon_sp_clients/v2/error_mapper_spec.rb @@ -208,6 +208,24 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") end end + describe '#parse_error' do + it 'builds a ParseError that carries the redacted request context' do + stub_request(:post, "#{base_url}/auth/o2/token") + .to_return(status: 200, body: 'x', headers: { 'x-amzn-RequestId' => 'RID' }) + response = conn.run_request(:post, '/auth/o2/token', 'client_secret=S', {}) + + err = mapper(:lwa).parse_error('bad body', response) + + expect(err).to be_a(v2::ParseError) + expect(err.message).to eq('bad body') + expect(err.status).to eq(200) + expect(err.request_id).to eq('RID') + expect(err.request[:path]).to eq('/auth/o2/token') + expect(err.request[:body]).to eq('[FILTERED]') + expect(err.response[:body]).to eq('x') + end + end + describe '#transport_error' do it 'wraps timeouts as TimeoutError and keeps the cause' do err = wrapped(Faraday::TimeoutError.new('slow')) diff --git a/spec/amazon_sp_clients/v2/lwa_spec.rb b/spec/amazon_sp_clients/v2/lwa_spec.rb index 6131e0c..0212ead 100644 --- a/spec/amazon_sp_clients/v2/lwa_spec.rb +++ b/spec/amazon_sp_clients/v2/lwa_spec.rb @@ -65,11 +65,15 @@ end end - it 'raises ParseError on a 2xx body that is not JSON' do + it 'raises ParseError with a redacted request on a 2xx body that is not JSON' do stub_request(:post, token_url).to_return(status: 200, body: '') expect { lwa.exchange(refresh_token: 'REFRESH_TOKEN') } - .to raise_error(v2::ParseError) { |err| expect(err.status).to eq(200) } + .to raise_error(v2::ParseError) do |err| + expect(err.status).to eq(200) + expect(err.request[:path]).to eq('/auth/o2/token') + expect(err.request[:body]).to eq('[FILTERED]') + end end it 'raises ParseError on a 2xx body without an access token' do From c2e7503de8df33918caeafff69316b4129626cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:46:47 +0200 Subject: [PATCH 51/83] Raise DocumentError on bodies that will not parse A feed result that is not valid JSON or XML, or a report marked GZIP that is not gzipped, escaped as a Zlib, JSON or MultiXml exception. Consumers rescue V2::Error; these now arrive as DocumentError with the original exception as cause. Found in review. --- lib/amazon_sp_clients/v2/documents.rb | 4 ++++ spec/amazon_sp_clients/v2/documents_spec.rb | 22 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lib/amazon_sp_clients/v2/documents.rb b/lib/amazon_sp_clients/v2/documents.rb index 67b7209..6bf61b4 100644 --- a/lib/amazon_sp_clients/v2/documents.rb +++ b/lib/amazon_sp_clients/v2/documents.rb @@ -90,12 +90,16 @@ def inflate(body, document) return body unless document[:compressionAlgorithm].to_s.casecmp?(GZIP) Zlib.gunzip(body).force_encoding(Encoding::UTF_8) + rescue Zlib::Error => e + raise DocumentError, "could not inflate the document: #{e.message}" end def parse(body, content_type) return JSON.parse(body) if content_type.to_s.match?(JSON_TYPES) MultiXml.parse(body) + rescue JSON::ParserError, MultiXml::ParseError => e + raise DocumentError, "could not parse the document: #{e.message}" end end end diff --git a/spec/amazon_sp_clients/v2/documents_spec.rb b/spec/amazon_sp_clients/v2/documents_spec.rb index e265732..e7f5a9a 100644 --- a/spec/amazon_sp_clients/v2/documents_spec.rb +++ b/spec/amazon_sp_clients/v2/documents_spec.rb @@ -52,6 +52,21 @@ expect(result.dig('AmazonEnvelope', 'Message')).to have_key('ProcessingReport') end + it 'raises DocumentError on a body that does not parse' do + stub_request(:get, url).to_return(status: 200, body: 'not json', + headers: { 'Content-Type' => 'application/json' }) + + expect { documents.download_feed_result(document) } + .to raise_error(v2::DocumentError, /parse/) { |err| expect(err.cause).to be_a(JSON::ParserError) } + end + + it 'raises DocumentError on XML that does not parse' do + stub_request(:get, url).to_return(status: 200, body: '', + headers: { 'Content-Type' => 'text/xml' }) + + expect { documents.download_feed_result(document) }.to raise_error(v2::DocumentError) + end + it 'inflates a gzipped document first' do stub_request(:get, url).to_return(status: 200, body: Zlib.gzip('{"ok":true}'), headers: { 'Content-Type' => 'application/json' }) @@ -79,6 +94,13 @@ expect(result).to be_valid_encoding end + it 'raises DocumentError when a document marked GZIP is not gzipped' do + stub_request(:get, url).to_return(status: 200, body: 'plain text') + + expect { documents.download_report_document(document.merge(compressionAlgorithm: 'GZIP')) } + .to raise_error(v2::DocumentError, /inflate/) { |err| expect(err.cause).to be_a(Zlib::Error) } + end + it 'raises DocumentError on a failed download' do stub_request(:get, url).to_return(status: 404, body: '') From bfac3d374a19889ff8a4deedb91163e395d39004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:46:47 +0200 Subject: [PATCH 52/83] Harden the error mapper against odd bodies and LWA 429 An errors array with entries that are not objects made the mapper itself raise, hiding the real status. It now keeps the object entries and drops the rest. A throttled LWA token request was mapped to AuthError, which reads as bad credentials; it is now ThrottledError, as on the SP-API side. FILTERED moves to the V2 module so other classes can redact too. Found in review. --- lib/amazon_sp_clients/v2/error_mapper.rb | 24 +++++++++++++++---- lib/amazon_sp_clients/v2/errors.rb | 4 ++++ .../amazon_sp_clients/v2/error_mapper_spec.rb | 19 +++++++++++++++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/lib/amazon_sp_clients/v2/error_mapper.rb b/lib/amazon_sp_clients/v2/error_mapper.rb index b5dacea..34f36ac 100644 --- a/lib/amazon_sp_clients/v2/error_mapper.rb +++ b/lib/amazon_sp_clients/v2/error_mapper.rb @@ -27,6 +27,9 @@ class ErrorMapper Faraday::Error, HTTPClient::KeepAliveDisconnected, SystemCallError, IOError, SocketError ].freeze + # Too Many Requests; also what LWA answers when the token endpoint + # is called too often. + THROTTLED_STATUS = 429 # SP-API statuses with their own error class; other 4xx and 5xx # fall to ClientError and ServerError. STATUS_ERRORS = { @@ -34,7 +37,7 @@ class ErrorMapper 401 => UnauthorizedError, 403 => ForbiddenError, 404 => NotFoundError, - 429 => ThrottledError + THROTTLED_STATUS => ThrottledError }.freeze # Statuses mapped to ClientError when not in STATUS_ERRORS. CLIENT_ERROR_STATUSES = (400...500) @@ -53,7 +56,7 @@ class ErrorMapper RATE_LIMIT_HEADER = 'x-amzn-RateLimit-Limit' # The error ends up in consumer logs; keep secrets out of it. - FILTERED = '[FILTERED]' + FILTERED = V2::FILTERED # Request headers replaced by FILTERED on the error. SENSITIVE_HEADERS = %w[authorization x-amz-access-token x-amz-security-token].freeze @@ -112,7 +115,7 @@ def error_for(env) def api_error(env) parsed = parse_json(env.body) - errors = parsed ? ApiError.new(parsed).errors : [] + errors = api_errors(parsed) messages = parsed && errors.map { |e| describe(e) } klass = STATUS_ERRORS.fetch(env.status) { generic_class(env.status) } @@ -120,6 +123,16 @@ def api_error(env) errors: errors, rate_limit: rate_limit(env), **context(env)) end + # The documented shape is {errors: [{code, message, details}]}; this + # is the last line of defence, so anything else yields no errors + # rather than an exception. + def api_errors(parsed) + list = parsed.is_a?(Hash) ? parsed[:errors] : parsed + return [] unless list.is_a?(Array) + + ApiError.new(list.grep(Hash)).errors + end + def lwa_error(env) return lwa_server_error(env) if SERVER_ERROR_STATUSES.cover?(env.status) @@ -128,10 +141,11 @@ def lwa_error(env) code = parsed&.fetch(:error, nil) description = parsed&.fetch(:error_description, nil) messages = parsed && [[code, description].compact.join(': ')].reject(&:empty?) + message = "#{env.status} #{summary(env.body, messages)}" + return ThrottledError.new(message, **context(env)) if env.status == THROTTLED_STATUS LWA_ERRORS.fetch(code, AuthError) - .new("#{env.status} #{summary(env.body, messages)}", - code: code, description: description, **context(env)) + .new(message, code: code, description: description, **context(env)) end def lwa_server_error(env) diff --git a/lib/amazon_sp_clients/v2/errors.rb b/lib/amazon_sp_clients/v2/errors.rb index d54c6f8..ebd714a 100644 --- a/lib/amazon_sp_clients/v2/errors.rb +++ b/lib/amazon_sp_clients/v2/errors.rb @@ -2,6 +2,10 @@ module AmazonSpClients module V2 + # Replaces a secret wherever V2 renders one: error payloads and + # inspect output. + FILTERED = '[FILTERED]' + # Base class of every error V2 raises. # # Match on the class and on +code+, never on the message. Rescue diff --git a/spec/amazon_sp_clients/v2/error_mapper_spec.rb b/spec/amazon_sp_clients/v2/error_mapper_spec.rb index d39ad30..e322e90 100644 --- a/spec/amazon_sp_clients/v2/error_mapper_spec.rb +++ b/spec/amazon_sp_clients/v2/error_mapper_spec.rb @@ -88,6 +88,16 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") expect(err.errors.size).to eq(2) end + it 'survives an errors array with entries that are not objects' do + body = '{"errors":["oops",null,{"code":"X","message":"m"}]}' + + err = error_for(:api, status: 500, body: body) + + expect(err).to be_an_instance_of(v2::ServerError) + expect(err.errors.map(&:code)).to eq(['X']) + expect(err.message).to eq('500 X: m') + end + it 'says so when the body is empty or not JSON' do expect(error_for(:api, status: 500, body: '').message).to eq('500 (no body)') expect(error_for(:api, status: 502, body: '').message).to eq('502 (body is not JSON)') @@ -183,6 +193,15 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") .to be_an_instance_of(v2::ServerError) end + # A throttled token request is not a credentials problem. + it 'maps 429 to ThrottledError' do + err = error_for(:lwa, status: 429, body: '{"error":"TooManyRequests"}', method: :post, + path: token_path) + + expect(err).to be_an_instance_of(v2::ThrottledError) + expect(err.request[:body]).to eq('[FILTERED]') + end + # The token request body carries client_secret and refresh_token. it 'filters the request body' do err = error_for(:lwa, status: 400, body: '{"error":"invalid_grant"}', method: :post, From 2e276cac331c4819b583d2574cfa15f914e9861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:46:47 +0200 Subject: [PATCH 53/83] Treat an empty rdt list as no RDT; stop freezing caller arrays Array(list) returns the caller's own array, which the cache then froze. An empty rdt: list made a Tokens API call Amazon rejects; it now sends the normal access token, so consumers can forward an optional list as it is. Found in review. --- lib/amazon_sp_clients/v2/client.rb | 9 +++++++-- lib/amazon_sp_clients/v2/rdt.rb | 8 +++++++- spec/amazon_sp_clients/v2/client_spec.rb | 11 +++++++++++ spec/amazon_sp_clients/v2/rdt_spec.rb | 8 ++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb index 5249b63..edaa9c9 100644 --- a/lib/amazon_sp_clients/v2/client.rb +++ b/lib/amazon_sp_clients/v2/client.rb @@ -82,12 +82,13 @@ def api(klass) # @param query [Hash] query parameters; nil values are left out # @param headers [Hash] extra request headers # @param body [Hash, Array, String, nil] JSON-encoded unless already a String - # @param rdt [Array, nil] send a restricted data token for these resources + # @param rdt [Array, nil] send a restricted data token for these + # resources; nil or empty sends the normal access token # @return [AmazonSpClients::ApiResponse] # @raise [Error] a ResponseError subclass on a non-2xx status, ConnectionError or # TimeoutError when no response arrived, ParseError on a non-JSON body def request(method, path, query: {}, headers: {}, body: nil, rdt: nil) - token = rdt ? restricted_token(rdt) : @credentials.access_token + token = restricted?(rdt) ? restricted_token(rdt) : @credentials.access_token response = send_request(method, path, query, headers.merge(auth_headers(token)), body) ApiResponse.new(parse(response), response) @@ -165,6 +166,10 @@ def parse(response) raise @errors.parse_error("response body is not JSON: #{e.message}", response) end + def restricted?(rdt) + !(rdt.nil? || rdt.empty?) + end + # The Tokens API call inside the fetch goes out with the normal # access token (no rdt:), so it never comes back to the cache lock # that is held around it. Lock order is cache, then credentials. diff --git a/lib/amazon_sp_clients/v2/rdt.rb b/lib/amazon_sp_clients/v2/rdt.rb index 739cbff..a7cf78e 100644 --- a/lib/amazon_sp_clients/v2/rdt.rb +++ b/lib/amazon_sp_clients/v2/rdt.rb @@ -58,7 +58,7 @@ def initialize # @yieldreturn [Token] a fresh restricted token, asked for on a miss # @return [String] the restricted data token def fetch(resources) - key = Array(resources).freeze + key = cache_key(resources) @mutex.synchronize do entry = @entries[key] @@ -76,6 +76,12 @@ def size = @mutex.synchronize { @entries.size } private + # A frozen copy, so the caller's own array is left alone. + def cache_key(resources) + list = Array(resources) + list.frozen? ? list : list.dup.freeze + end + def sweep @entries.delete_if { |_, token| token.expired? } end diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb index 5fd7dcd..8910b75 100644 --- a/spec/amazon_sp_clients/v2/client_spec.rb +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -254,6 +254,17 @@ def rdt_body(token = 'RDT', expires_in: 3600) expect(orders).to have_been_requested end + it 'treats an empty resource list as no restricted token' do + tokens = stub_request(:post, tokens_url).to_return(status: 200, body: rdt_body) + orders = stub_request(:get, orders_url).with(headers: { 'x-amz-access-token' => 'ACCESS' }) + .to_return(status: 200, body: '{}') + + client.request(:get, '/orders/v0/orders', rdt: []) + + expect(tokens).not_to have_been_requested + expect(orders).to have_been_requested + end + it 'reuses the restricted token while it is fresh' do tokens = stub_request(:post, tokens_url).to_return(status: 200, body: rdt_body) stub_request(:get, orders_url).to_return(status: 200, body: '{}') diff --git a/spec/amazon_sp_clients/v2/rdt_spec.rb b/spec/amazon_sp_clients/v2/rdt_spec.rb index 5d93f0b..ffc0a9f 100644 --- a/spec/amazon_sp_clients/v2/rdt_spec.rb +++ b/spec/amazon_sp_clients/v2/rdt_spec.rb @@ -88,6 +88,14 @@ def token(value, expires_in: 3600) expect(value).to eq('RDT1') end + it 'leaves the caller\'s resource array unfrozen' do + resources = [v2::RDT.resource('GET', '/documents/D1')] + + cache.fetch(resources) { token('RDT1') } + + expect(resources).not_to be_frozen + end + it 'keeps separate tokens for different resource lists' do cache.fetch(orders) { token('RDT1') } From 0375c24f48364c9a07970dd2dc378c69f3422c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:46:47 +0200 Subject: [PATCH 54/83] Keep secrets out of inspect output Consoles, pp and error trackers inspect clients. Config, Token and RefreshToken credentials now print [FILTERED] for the client secret, access token and refresh tokens, so inspecting a client leaks nothing. Found in review. --- lib/amazon_sp_clients/v2/config.rb | 10 ++++++++++ lib/amazon_sp_clients/v2/credentials.rb | 8 ++++++++ lib/amazon_sp_clients/v2/token.rb | 12 ++++++++++++ spec/amazon_sp_clients/v2/config_spec.rb | 8 ++++++++ spec/amazon_sp_clients/v2/credentials_spec.rb | 11 +++++++++++ spec/amazon_sp_clients/v2/token_spec.rb | 10 ++++++++++ 6 files changed, 59 insertions(+) diff --git a/lib/amazon_sp_clients/v2/config.rb b/lib/amazon_sp_clients/v2/config.rb index 74bc3e8..75a99bb 100644 --- a/lib/amazon_sp_clients/v2/config.rb +++ b/lib/amazon_sp_clients/v2/config.rb @@ -2,6 +2,7 @@ require 'amazon_sp_clients/version' require 'amazon_sp_clients/marketplaces' +require 'amazon_sp_clients/v2/errors' module AmazonSpClients module V2 @@ -70,6 +71,15 @@ def host # @return [String] base URL of every API request def base_url = "https://#{host}" + + # Consoles and error trackers inspect configs; the secret stays out. + # + # @return [String] + def inspect + fields = to_h.merge(client_secret: client_secret && FILTERED) + + "#<#{self.class.name} #{fields.map { |k, v| "#{k}=#{v.inspect}" }.join(' ')}>" + end end end end diff --git a/lib/amazon_sp_clients/v2/credentials.rb b/lib/amazon_sp_clients/v2/credentials.rb index 0807839..7ffa2f7 100644 --- a/lib/amazon_sp_clients/v2/credentials.rb +++ b/lib/amazon_sp_clients/v2/credentials.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'amazon_sp_clients/v2/errors' require 'amazon_sp_clients/v2/token' module AmazonSpClients @@ -67,6 +68,13 @@ def refresh_token @token&.refresh_token || @initial_refresh_token end + # Refresh tokens stay out of consoles and error trackers. + # + # @return [String] + def inspect + "#<#{self.class.name} refresh_token=#{FILTERED} token=#{@token.inspect}>" + end + private # LWA may leave refresh_token out of the response; keep the one diff --git a/lib/amazon_sp_clients/v2/token.rb b/lib/amazon_sp_clients/v2/token.rb index 7232a71..466083d 100644 --- a/lib/amazon_sp_clients/v2/token.rb +++ b/lib/amazon_sp_clients/v2/token.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'amazon_sp_clients/v2/errors' + module AmazonSpClients module V2 # An access token with its expiry, as returned by LWA or by the @@ -22,6 +24,16 @@ def expired?(now = Time.now.utc) now >= expires_at - EXPIRY_SKEW end + + # Token values stay out of consoles and error trackers. + # + # @return [String] + def inspect + fields = to_h.merge(access_token: access_token && FILTERED, + refresh_token: refresh_token && FILTERED) + + "#<#{self.class.name} #{fields.map { |k, v| "#{k}=#{v.inspect}" }.join(' ')}>" + end end end end diff --git a/spec/amazon_sp_clients/v2/config_spec.rb b/spec/amazon_sp_clients/v2/config_spec.rb index f24b610..dca38e7 100644 --- a/spec/amazon_sp_clients/v2/config_spec.rb +++ b/spec/amazon_sp_clients/v2/config_spec.rb @@ -67,6 +67,14 @@ expect(variant.client_id).to eq('ID') end + # Consoles and error trackers inspect objects; the secret must not print. + it 'hides the client secret from inspect' do + config = described_class.new(client_id: 'ID', client_secret: 'TOP-SECRET') + + expect(config.inspect).to include('ID').and include('[FILTERED]') + expect(config.inspect).not_to include('TOP-SECRET') + end + it 'rejects unknown settings' do expect { described_class.new(region: 'us-east-1') }.to raise_error(ArgumentError) end diff --git a/spec/amazon_sp_clients/v2/credentials_spec.rb b/spec/amazon_sp_clients/v2/credentials_spec.rb index 3944ed1..f60c09a 100644 --- a/spec/amazon_sp_clients/v2/credentials_spec.rb +++ b/spec/amazon_sp_clients/v2/credentials_spec.rb @@ -109,5 +109,16 @@ def exchange(refresh_token:) it 'reports the initial refresh token before any exchange' do expect(creds.refresh_token).to eq('RT0') end + + it 'hides the refresh tokens from inspect, also through a client' do + creds.access_token + client = v2::Client.new(v2::Config.new, credentials: creds) + + expect(creds.inspect).to include('[FILTERED]') + expect(creds.inspect).not_to include('RT0') + expect(creds.inspect).not_to include('RT1') + expect(client.inspect).not_to include('RT0') + expect(client.inspect).not_to include('TOKEN_1') + end end end diff --git a/spec/amazon_sp_clients/v2/token_spec.rb b/spec/amazon_sp_clients/v2/token_spec.rb index cd49dcc..496e2d1 100644 --- a/spec/amazon_sp_clients/v2/token_spec.rb +++ b/spec/amazon_sp_clients/v2/token_spec.rb @@ -29,4 +29,14 @@ def token(expires_at) it 'is frozen' do expect(token(now + 3600)).to be_frozen end + + it 'hides the token values from inspect' do + token = described_class.new(access_token: 'Atza|SECRET-A', token_type: 'bearer', + expires_in: 3600, expires_at: now + 3600, + refresh_token: 'Atzr|SECRET-R') + + expect(token.inspect).to include('bearer').and include('[FILTERED]') + expect(token.inspect).not_to include('SECRET-A') + expect(token.inspect).not_to include('SECRET-R') + end end From 9db9097962b3105e00d947332034cff2162b62a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:32:28 +0200 Subject: [PATCH 55/83] Drop nil headers; tighten the generator name guard An optional header keyword left nil went out as an empty header; the client now drops nil headers the way it drops nil query values. The name guard also rejects the locals the generated method body builds (query, headers) and any name that is not a Ruby identifier, so a spec update cannot produce code that is wrong on the wire or fails to load. Found in review. --- lib/amazon_sp_clients/v2/client.rb | 5 +++-- lib/generator/names.rb | 16 +++++++++++++-- spec/amazon_sp_clients/v2/client_spec.rb | 10 +++++---- spec/fixtures/generator/things.json | 7 +++++++ spec/generator/v2_spec.rb | 26 +++++++++++++++++++++--- 5 files changed, 53 insertions(+), 11 deletions(-) diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb index edaa9c9..aa50fc8 100644 --- a/lib/amazon_sp_clients/v2/client.rb +++ b/lib/amazon_sp_clients/v2/client.rb @@ -80,7 +80,7 @@ def api(klass) # @param method [Symbol] :get, :post, :put, :patch, :delete # @param path [String] request path, already percent-encoded # @param query [Hash] query parameters; nil values are left out - # @param headers [Hash] extra request headers + # @param headers [Hash] extra request headers; nil values are left out # @param body [Hash, Array, String, nil] JSON-encoded unless already a String # @param rdt [Array, nil] send a restricted data token for these # resources; nil or empty sends the normal access token @@ -89,7 +89,8 @@ def api(klass) # TimeoutError when no response arrived, ParseError on a non-JSON body def request(method, path, query: {}, headers: {}, body: nil, rdt: nil) token = restricted?(rdt) ? restricted_token(rdt) : @credentials.access_token - response = send_request(method, path, query, headers.merge(auth_headers(token)), body) + all_headers = headers.compact.merge(auth_headers(token)) + response = send_request(method, path, query, all_headers, body) ApiResponse.new(parse(response), response) end diff --git a/lib/generator/names.rb b/lib/generator/names.rb index 8d49cfb..0a15dde 100644 --- a/lib/generator/names.rb +++ b/lib/generator/names.rb @@ -15,8 +15,12 @@ module Names true undef unless until when while yield __FILE__ __LINE__ __ENCODING__ ].freeze - # Every generated method already takes these. - SIGNATURE_NAMES = %w[rdt body].freeze + # Names every generated method already uses: its rdt: and body + # arguments and the locals its body builds. + SIGNATURE_NAMES = %w[rdt body query headers].freeze + + # What a snake_case name must look like to be a Ruby identifier. + IDENTIFIER = /\A[a-z_][a-z0-9_]*\z/ # The generated accessors live here; they are not collisions. APIS_FILE = %r{/v2/apis\.rb\z} @@ -25,18 +29,26 @@ module Names # A parameter that is not the body: positional or keyword. def check_param!(name, operation:) + check_identifier!(name, "Parameter #{name.inspect} of #{operation}") return unless RUBY_KEYWORDS.include?(name) || SIGNATURE_NAMES.include?(name) raise "Parameter #{name.inspect} of #{operation} cannot be a method argument" end def check_method!(name) + check_identifier!(name, "Operation #{name.inspect}") taken = RUBY_KEYWORDS.include?(name) || methods_of(AmazonSpClients::V2::Api).include?(name) return unless taken raise "Operation #{name.inspect} collides with a Ruby or Api method" end + def check_identifier!(name, what) + return if name.match?(IDENTIFIER) + + raise "#{what} is not a Ruby identifier" + end + def check_module!(name) return unless methods_of(AmazonSpClients::V2::Client).include?(name) diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb index 8910b75..c3b6edb 100644 --- a/spec/amazon_sp_clients/v2/client_spec.rb +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -127,11 +127,13 @@ def rdt_body(token = 'RDT', expires_in: 3600) expect(stub).to have_been_requested end - it 'merges per-request headers' do - stub = stub_request(:get, orders_url).with(headers: { 'x-custom' => 'yes' }) - .to_return(status: 200, body: '{}') + it 'merges per-request headers and drops nil ones' do + stub = stub_request(:get, orders_url) + .with(headers: { 'x-custom' => 'yes' }) + .with { |req| !req.headers.key?('X-Opt') } + .to_return(status: 200, body: '{}') - client.request(:get, '/orders/v0/orders', headers: { 'x-custom' => 'yes' }) + client.request(:get, '/orders/v0/orders', headers: { 'x-custom' => 'yes', 'x-opt' => nil }) expect(stub).to have_been_requested end diff --git a/spec/fixtures/generator/things.json b/spec/fixtures/generator/things.json index fe4dea0..8fa7bd4 100644 --- a/spec/fixtures/generator/things.json +++ b/spec/fixtures/generator/things.json @@ -42,6 +42,13 @@ "required": false, "type": "integer", "description": "Page size." + }, + { + "name": "x-request-note", + "in": "header", + "required": false, + "type": "string", + "description": "Optional note." } ], "responses": { diff --git a/spec/generator/v2_spec.rb b/spec/generator/v2_spec.rb index b16106f..4db5cc6 100644 --- a/spec/generator/v2_spec.rb +++ b/spec/generator/v2_spec.rb @@ -65,7 +65,8 @@ def things_class it 'keeps required params positional in v1 order and makes the rest keywords' do expect(things_class.instance_method(:list_things).parameters).to eq( - [%i[req ids], %i[key next_token], %i[key details], %i[key max_results], %i[key rdt]] + [%i[req ids], %i[key next_token], %i[key details], %i[key max_results], + %i[key x_request_note], %i[key rdt]] ) expect(things_class.instance_method(:create_thing).parameters).to eq( [%i[req body], %i[req thing_id], %i[req x_amzn_idempotency_token], %i[key rdt]] @@ -108,9 +109,10 @@ def things_class expect(response.payload).to eq(things: []) end - it 'sends no optional params when none are given' do + it 'sends no optional params or headers when none are given' do stub = stub_request(:get, "#{base_url}/things/v1/things") .with(query: { 'Ids' => 'A' }) + .with { |req| !req.headers.key?('X-Request-Note') } .to_return(status: 200, body: '{}') api.list_things(['A']) @@ -118,6 +120,16 @@ def things_class expect(stub).to have_been_requested end + it 'sends an optional header when given' do + stub = stub_request(:get, "#{base_url}/things/v1/things") + .with(query: { 'Ids' => 'A' }, headers: { 'x-request-note' => 'hi' }) + .to_return(status: 200, body: '{}') + + api.list_things(['A'], x_request_note: 'hi') + + expect(stub).to have_been_requested + end + it 'encodes path params and sends header params and the JSON body' do stub = stub_request(:post, "#{base_url}/things/v1/things/x%20y") .with(body: '{"name":"n"}', headers: { 'x-amzn-idempotency-token' => 'TOKEN' }) @@ -159,13 +171,21 @@ def things_class describe 'name guard' do names = Generator::Names - it 'rejects parameter names Ruby or the V2 signature already use' do + it 'rejects parameter names Ruby or the generated method body already use' do expect { names.check_param!('end', operation: 'op') }.to raise_error(/end/) expect { names.check_param!('rdt', operation: 'op') }.to raise_error(/rdt/) expect { names.check_param!('body', operation: 'op') }.to raise_error(/body/) + expect { names.check_param!('query', operation: 'op') }.to raise_error(/query/) + expect { names.check_param!('headers', operation: 'op') }.to raise_error(/headers/) expect { names.check_param!('next_token', operation: 'op') }.not_to raise_error end + it 'rejects names that are not Ruby identifiers' do + expect { names.check_param!('1st_param', operation: 'op') }.to raise_error(/identifier/) + expect { names.check_method!('1st') }.to raise_error(/identifier/) + expect { names.check_method!('get_1st') }.not_to raise_error + end + it 'rejects method names that collide with Ruby, Object or the Api base' do expect { names.check_method!('class') }.to raise_error(/class/) expect { names.check_method!('freeze') }.to raise_error(/freeze/) From 0fef2af4665667ea6c63cbb51f49113e6c9b30a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:32:28 +0200 Subject: [PATCH 56/83] Correct V2 docs from review Show how to read a rotated refresh token back (build the credentials yourself and keep the reference), and say that report documents are UTF-8 tagged only when Amazon gzipped them. --- CHANGELOG.md | 3 ++- README.md | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0599e7f..a0ff465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,8 @@ considered breaking and do not trigger a major version bump. modules. Responses are the same `ApiResponse`. The README has the usage and the v1 to V2 migration table. - Feed upload, feed result download and report download on the V2 - client. Report documents come back gunzipped and UTF-8 tagged. + client. Report documents come back gunzipped and UTF-8 tagged when + Amazon gzipped them. - `rake yard:verify` and a CI job that fail when a public V2 object has no doc comment. - A second template set in the generator. Each `codegen-config.yml` diff --git a/README.md b/README.md index d51a755..caa050a 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,16 @@ orders.payload[:NextToken] orders.reported_rate_limit # Float from x-amzn-RateLimit-Limit, or nil ``` +To read a rotated refresh token back, build the credentials yourself +and keep the reference: + +```ruby +lwa = AmazonSpClients::V2::LWA.new(config) +creds = AmazonSpClients::V2::Credentials::RefreshToken.new(lwa, refresh_token) +client = AmazonSpClients::V2::Client.new(config, credentials: creds) +creds.refresh_token # the latest one LWA returned; persist it when it changes +``` + One client per merchant. It owns one connection and is safe to share across threads. Required parameters are positional, in the same order as v1; optional ones are keywords. Unknown keywords raise From 720ad3226970b710a0f5c658ab5a57f952717a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:28:56 +0200 Subject: [PATCH 57/83] Complete the migration table from the dry runs Two agents rewrote active_cart and active_fulfillment against V2 and hit the same doc gaps. The error rows now say that v1's Faraday classes covered the token endpoint too, so every token failure is an AuthError in V2 whatever the status, and that a timeout moves from ServerError to ConnectionError. Added the rows for the settings consumers still pass but V2 drops, for reading the region back, for sandbox on a frozen config, for the user agent, and for the missing rescue branches. --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index caa050a..c120f9f 100644 --- a/README.md +++ b/README.md @@ -177,15 +177,22 @@ client.download_report_document(report_document_payload) # String, gunzipped whe | `AmazonSpClients.configure` block | `Config.new(endpoint: ...)`, one per merchant | | `AmazonSpClients.new_callback_session { token }` | `Client.new(config) { token }` | | `AmazonSpClients.new_session(refresh_token)` | `Client.with_refresh_token(config, refresh_token)` | -| `TokenExchangeAuth.new(refresh_token).exchange` | `LWA.new(config).exchange(refresh_token: refresh_token)` | +| `TokenExchangeAuth.new(refresh_token).exchange` | `LWA.new(config).exchange(refresh_token: refresh_token)`. The config must carry `client_id` and `client_secret`; `LWA.new` raises `ArgumentError` when they are missing, where v1 sent the request and got an LWA error back. | | `response[:access_token]` | `token.access_token`, `token.expires_in`, `token.expires_at` | | `SpOrdersV0::OrdersV0Api.new(session)` | `client.orders_v0` | | `get_orders(ids, opts)` with an options Hash | `get_orders(ids, **opts)` with real parameter names only | | `auth_names: [:orders_and_items]` | `rdt: RDT::ORDERS_AND_ITEMS` | | `auth_names: [{ method: 'GET', path: path }]` | `rdt: [RDT.resource('GET', path)]` | +| `AmazonSpClients.configure.region` | `config.region` | +| `AmazonSpClients.configure.sandbox_env!` / `disable_sandbox!` | `Config.new(sandbox: true)`. The config is frozen, so a client cannot be switched after it is built. | +| `c.logger`, `c.role_arn`, `c.access_key`, `c.secret_key`, `c.credentials_provider` | nothing. v1 has ignored them since 1.8.0; delete the lines, and the AWS credential code that fed them. | +| the `Dropstream/1.0` user agent | `Config.new(user_agent: 'YourApp/1.0 ...')`. The default names this gem; Amazon asks for the application name. | | `rescue Faraday::RetriableResponse` | `rescue V2::ThrottledError` | -| `rescue Faraday::ForbiddenError, Faraday::UnauthorizedError` | `rescue V2::ForbiddenError, V2::UnauthorizedError` | -| message starts with `Service 'token'` | `rescue V2::AuthError`, then `e.code` | +| `rescue Faraday::ForbiddenError, Faraday::UnauthorizedError` | `rescue V2::ForbiddenError, V2::UnauthorizedError`. In v1 these also covered the token endpoint; in V2 those are `AuthError` (see the next row). | +| message starts with `Service 'token'` | `rescue V2::AuthError`, then `e.code`. Every token-endpoint failure is an `AuthError`, 401 and 403 included, so branch on `e.status` if you mapped those to an auth failure. | +| `rescue Faraday::ResourceNotFound` | `rescue V2::NotFoundError` | +| `rescue Faraday::BadRequestError, Faraday::ClientError` | `rescue V2::BadRequestError, V2::ClientError` | +| `rescue Faraday::ServerError` | `rescue V2::ServerError, V2::TimeoutError`. Faraday makes a timeout a `ServerError`; V2 makes it a `ConnectionError`, so add it where you treated 5xx as worth retrying. | | message matches `InvalidInput` | `e.code == 'InvalidInput'` | | `upload_feed_data`, `download_feed_report`, `download_report_document` | `client.upload_feed_document`, `client.download_feed_result`, `client.download_report_document` (the last one gunzips for you) | From d1d2cbb7e10e9695115bedcdf83d62504bfa9ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:32:25 +0200 Subject: [PATCH 58/83] Match v1 files, not the whole vendor directory The spec that proves V2 loads without v1 counted every loaded file under vendor/, and CI installs the bundle into vendor/bundle, so all four test jobs failed on 115 bundler gem files. It now matches the v1 layout, vendor//lib/sp_, which no gem path can look like. Checked both ways: 3 files seen when a v1 module is required, 0 when only V2 is. --- spec/amazon_sp_clients/v2/loading_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/amazon_sp_clients/v2/loading_spec.rb b/spec/amazon_sp_clients/v2/loading_spec.rb index 77e40b6..7962416 100644 --- a/spec/amazon_sp_clients/v2/loading_spec.rb +++ b/spec/amazon_sp_clients/v2/loading_spec.rb @@ -15,8 +15,10 @@ AuthResponse Middlewares] loaded_v1 = v1_only.select { |c| AmazonSpClients.const_defined?(c, false) } loaded_v1 += AmazonSpClients.constants.grep(/\\ASp[A-Z]/) - vendor_dir = File.expand_path('vendor') - vendored = $LOADED_FEATURES.select { |f| f.start_with?("\#{vendor_dir}/") } + # The v1 API files are vendor//lib/sp_...; match that + # layout, not the whole directory, because bundler installs the gems + # themselves under vendor/bundle on CI. + vendored = $LOADED_FEATURES.grep(%r{/vendor/[^/]+/lib/sp_}) client = AmazonSpClients::V2::Client accessors = client.instance_methods(false).count do |m| client.instance_method(m).source_location.first.end_with?('/v2/apis.rb') From a08db50f81fc6598ebf4542aaa561f879059f5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:10:53 +0200 Subject: [PATCH 59/83] Correct the LWA error row in the migration table The row said every token-endpoint failure is an AuthError. Three cases are not: an LWA 429 raises ThrottledError, an LWA 5xx raises ServerError, and a 200 without an access_token raises ParseError. A consumer writing its rescue chain from that row would miss all three and let them fall through to a generic handler. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c120f9f..c9388d1 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ client.download_report_document(report_document_payload) # String, gunzipped whe | the `Dropstream/1.0` user agent | `Config.new(user_agent: 'YourApp/1.0 ...')`. The default names this gem; Amazon asks for the application name. | | `rescue Faraday::RetriableResponse` | `rescue V2::ThrottledError` | | `rescue Faraday::ForbiddenError, Faraday::UnauthorizedError` | `rescue V2::ForbiddenError, V2::UnauthorizedError`. In v1 these also covered the token endpoint; in V2 those are `AuthError` (see the next row). | -| message starts with `Service 'token'` | `rescue V2::AuthError`, then `e.code`. Every token-endpoint failure is an `AuthError`, 401 and 403 included, so branch on `e.status` if you mapped those to an auth failure. | +| message starts with `Service 'token'` | `rescue V2::AuthError`, then `e.code`. A token-endpoint 4xx other than 429 is an `AuthError`, 401 and 403 included, so branch on `e.status` if you mapped those to an auth failure. The other three cases are not `AuthError`: 429 is a `ThrottledError`, 5xx is a `ServerError`, and a 200 with no `access_token` is a `ParseError`. | | `rescue Faraday::ResourceNotFound` | `rescue V2::NotFoundError` | | `rescue Faraday::BadRequestError, Faraday::ClientError` | `rescue V2::BadRequestError, V2::ClientError` | | `rescue Faraday::ServerError` | `rescue V2::ServerError, V2::TimeoutError`. Faraday makes a timeout a `ServerError`; V2 makes it a `ConnectionError`, so add it where you treated 5xx as worth retrying. | From bd6f963d0f78176a722e2775eeb9942d19061b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:47:32 +0200 Subject: [PATCH 60/83] Ship only the library in the built gem The gem carried its CI config, Rakefile, bin/ scripts, lockfile, dotfiles and the generator config. Consumers need none of it. The built gem now holds lib/, vendor/, the gemspec and the top-level docs. --- CHANGELOG.md | 3 +++ amazon_sp_clients.gemspec | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ff465..4058ad3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ considered breaking and do not trigger a major version bump. ### Changed +- The built gem ships only `lib/`, `vendor/`, the gemspec and the + top-level docs. Tests, the generator, CI config and dev tooling stay + out of it. - The deprecated AWS IAM and logger settings stay as no-ops. They were announced for removal in 2.0, but every consumer still sets them, so they leave together with the v1 API in a later major. diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 7afd211..65dd4f7 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -19,12 +19,16 @@ Gem::Specification.new do |spec| # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + # Only lib/, vendor/, the gemspec and the top-level docs ship. Tests, + # the generator, CI config, dotfiles and the dev tooling stay behind. + dev_files = %r{ + ^(test|spec|features|amzn-models|gemfiles|bin)/ | + ^lib/generator | + ^\. | + ^(Gemfile(\.lock)?|Rakefile|CLAUDE\.md|codegen-config\.yml|selling-partner-api-models\.sha)$ + }x spec.files = Dir.chdir(File.expand_path(__dir__)) do - `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features|amzn-models|gemfiles)/|^lib/generator|^\.yardopts}) - end + `git ls-files -z`.split("\x0").reject { |f| f.match(dev_files) } end spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } From c8b8631826ada8f1404bb8520b37516731c1b3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:47:32 +0200 Subject: [PATCH 61/83] Publish only to GitHub Packages The gemspec had no allowed_push_host, so `rake release` would have pushed this public repo's gem to rubygems.org. Set the Dropstream registry as the only push host, name the repository the package belongs to, and fill in the source and changelog links. Disable the bundler `release` task. Releases run from a version tag in CI, not from a laptop. A spec pins the push host and the list of shipped files. --- Rakefile | 11 +++++++++++ amazon_sp_clients.gemspec | 11 +++++++---- spec/gemspec_spec.rb | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 spec/gemspec_spec.rb diff --git a/Rakefile b/Rakefile index 95de82d..13f6180 100644 --- a/Rakefile +++ b/Rakefile @@ -3,6 +3,17 @@ require 'bundler/gem_tasks' require 'rspec/core/rake_task' +# Releases run from a version tag through .github/workflows/release.yml. +# The bundler `release` task would tag, push and publish from a laptop. +%w[release release:rubygem_push].each do |name| + Rake::Task[name].clear if Rake::Task.task_defined?(name) +end + +desc 'Disabled, push an annotated vX.Y.Z tag instead (README, "Releasing")' +task :release do + abort 'Releases run from a version tag. Push an annotated vX.Y.Z tag; see README, "Releasing".' +end + RSpec::Core::RakeTask.new(:spec) task default: :spec diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 65dd4f7..e7ec944 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -7,17 +7,20 @@ Gem::Specification.new do |spec| spec.email = ['351015+nina-saule@users.noreply.github.com'] spec.summary = 'Amazon Selling Partner APIs' - spec.description = 'Collection of SwaggerCodegen gems wrapped into one gem' + spec.description = 'Ruby clients for the Amazon Selling Partner API (SP-API)' spec.homepage = 'https://github.com/dropstream/amazon_sp_clients' spec.license = 'MIT' spec.required_ruby_version = Gem::Requirement.new('>= 3.3') - # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + # Releases go to the Dropstream registry on GitHub Packages, never to + # rubygems.org. `github_repo` ties the package to this repository. + spec.metadata['allowed_push_host'] = 'https://rubygems.pkg.github.com/dropstream' + spec.metadata['github_repo'] = 'ssh://github.com/dropstream/amazon_sp_clients' spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['source_code_uri'] = spec.homepage + spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md" spec.metadata['rubygems_mfa_required'] = 'true' - # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." - # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." # Only lib/, vendor/, the gemspec and the top-level docs ship. Tests, # the generator, CI config, dotfiles and the dev tooling stay behind. diff --git a/spec/gemspec_spec.rb b/spec/gemspec_spec.rb new file mode 100644 index 0000000..bfc35b0 --- /dev/null +++ b/spec/gemspec_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# The gem is published to the Dropstream registry on GitHub Packages. +# These examples keep a `gem push` from ever reaching rubygems.org and +# keep development files out of the built gem. +RSpec.describe 'amazon_sp_clients.gemspec' do + subject(:gemspec) do + Gem::Specification.load(File.expand_path('../amazon_sp_clients.gemspec', __dir__)) + end + + let(:dev_file) do + %r{ + ^(spec|gemfiles|bin|lib/generator|\.github)/ | + ^\. | + ^(Gemfile|Gemfile\.lock|Rakefile|CLAUDE\.md)$ + }x + end + + it 'allows pushes only to the Dropstream registry on GitHub Packages' do + expect(gemspec.metadata['allowed_push_host']).to eq('https://rubygems.pkg.github.com/dropstream') + end + + it 'names the repository the package belongs to' do + expect(gemspec.metadata['github_repo']).to eq('ssh://github.com/dropstream/amazon_sp_clients') + end + + it 'ships the library, the generated clients and the top-level docs' do + expect(gemspec.files).to include( + 'README.md', 'CHANGELOG.md', 'LICENSE', 'amazon_sp_clients.gemspec', + 'lib/amazon_sp_clients.rb', 'lib/amazon_sp_clients/v2.rb', + 'lib/amazon_sp_clients/v2/apis/orders_v0.rb', 'vendor/orders_v0/lib/sp_orders_v0.rb' + ) + end + + it 'ships no development files' do + expect(gemspec.files).not_to include(a_string_matching(dev_file)) + end +end From 7bfd8e6586a5a4c08fd7d23f90e357e88280d237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:47:32 +0200 Subject: [PATCH 62/83] Publish the gem from version tags A push of a v* tag runs the suite, builds the gem, pushes it to the Dropstream registry on GitHub Packages with the workflow token, and opens a GitHub Release with the CHANGELOG entry for that version. The job stops when the tag does not match AmazonSpClients::VERSION or when CHANGELOG.md has no entry for it, so a wrong tag publishes nothing. GitHub Packages rejects a version it already has, so a failed release needs a new version, not a re-run. --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 3 ++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..281677f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +# A version tag is the only release path. It builds the gem, pushes it +# to the Dropstream registry on GitHub Packages and opens a GitHub +# Release with that version's CHANGELOG entry. See README, "Releasing". +on: + push: + tags: ["v*"] + +permissions: + contents: write # the GitHub Release + packages: write # the gem push + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + # The tag must be "v" plus AmazonSpClients::VERSION. + - name: Check the tag against version.rb + run: | + version=$(ruby -Ilib -e 'require "amazon_sp_clients/version"; puts AmazonSpClients::VERSION') + if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then + echo "Tag ${GITHUB_REF_NAME} does not match version ${version}" >&2 + exit 1 + fi + + # The release notes are the CHANGELOG section for this version. + - name: Extract the CHANGELOG entry + run: | + awk -v v="${GITHUB_REF_NAME#v}" '$0 ~ "^## \\[" v "\\]" {p=1; next} /^## \[/ {p=0} p' CHANGELOG.md > release_notes.md + if [ ! -s release_notes.md ]; then + echo "CHANGELOG.md has no entry for ${GITHUB_REF_NAME#v}" >&2 + exit 1 + fi + + - run: bundle exec rspec + - run: gem build amazon_sp_clients.gemspec + + # GitHub Packages takes the workflow token; no extra secret. + - name: Push the gem to GitHub Packages + run: | + mkdir -p ~/.gem + echo ":github: Bearer ${GITHUB_TOKEN}" > ~/.gem/credentials + chmod 0600 ~/.gem/credentials + gem push --key github --host "https://rubygems.pkg.github.com/${GITHUB_REPOSITORY_OWNER}" amazon_sp_clients-*.gem + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create the GitHub Release + run: gh release create "${GITHUB_REF_NAME}" amazon_sp_clients-*.gem --title "${GITHUB_REF_NAME}" --notes-file release_notes.md + env: + GH_TOKEN: ${{ github.token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4058ad3..fc554a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ considered breaking and do not trigger a major version bump. entry lists its template sets. Generation now refuses to run while tracked generated files belong to no configured module, and fails on names that Ruby or the V2 method signature already use. +- A release workflow. Pushing a `v*` tag publishes the gem to the + Dropstream registry on GitHub Packages and opens a GitHub Release + with the CHANGELOG entry. `rake release` is disabled. ### Changed From 55edfa6d9b5cc2821960154797c8f0f298fbe6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:47:32 +0200 Subject: [PATCH 63/83] Document installing and releasing the gem README: install from the GitHub Packages source block, pin a tag if a git source stays, and the release steps (version, re-lock, changelog date, annotated tag). CLAUDE.md: the release path, and why master must not take 2.0.0 before consumers move off git sources. --- CLAUDE.md | 8 ++++++++ README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7a5b6ee..6d34765 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -109,3 +109,11 @@ bin/console # irb with the gem loaded Regeneration rewrites the generated files for every module in `codegen-config.yml`. Review that diff carefully before committing; advance the pin only in its own PR. + +## Releases + +Published to the Dropstream registry on GitHub Packages by +`.github/workflows/release.yml` when a `v*` tag is pushed; steps in +README, "Releasing". `rake release` is disabled. Consumers still install +the gem from git master, so master takes 2.0.0 only after they move to +the versioned dependency. diff --git a/README.md b/README.md index c9388d1..f3f8e0d 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,27 @@ # AmazonSpClients -*NOTE*: This is still in development. - ## Installation +The gem is published to the Dropstream registry on GitHub Packages. +Add it inside that registry's `source` block, next to the other +Dropstream gems: + ```ruby -gem 'amazon_sp_clients' +source 'https://rubygems.pkg.github.com/dropstream' do + gem 'amazon_sp_clients', '~> 2.0' +end ``` -This will require only the main (root) gem, but won't load any of the generated -SP APIs. The idea is to generate code for all APIs we may need across our -system, but allow requiring per project/repo basis. Because of that, each API -must be required explicitly: +Bundler needs a GitHub token with `read:packages` for that host. Apps +that already install `active_cart` from there have one. + +A git source (`gem 'amazon_sp_clients', git: ...`) still works, but it +follows a branch instead of a version. If you keep one, pin a `tag:`. + +Either way this requires only the main (root) gem, but won't load any of +the generated SP APIs. The idea is to generate code for all APIs we may +need across our system, but allow requiring per project/repo basis. +Because of that, each API must be required explicitly: ```ruby require 'amazon_sp_clients' # you can skip if you use Bundle.setup @@ -224,3 +234,33 @@ comment; CI runs it. Generated files carry a `Generated by: lib/generator` header. Never edit them by hand; change the generator (or the templates in `lib/generator/templates/`) and regenerate. + +## Releasing + +A release is a version tag. Nothing else publishes. The `Release` +workflow (`.github/workflows/release.yml`) checks the tag against the +version, runs the suite, builds the gem, pushes it to GitHub Packages +and opens a GitHub Release with the CHANGELOG entry. + +1. Set `AmazonSpClients::VERSION` in `lib/amazon_sp_clients/version.rb`. +2. Re-lock all three lockfiles, or CI's frozen install fails: + + ```sh + bundle lock --local + BUNDLE_GEMFILE=gemfiles/faraday_1.gemfile bundle lock --local + BUNDLE_GEMFILE=gemfiles/faraday_2.gemfile bundle lock --local + ``` + +3. Give the CHANGELOG entry its release date: `## [X.Y.Z] - YYYY-MM-DD`. + The workflow stops when the version has no entry. +4. Commit, then push an annotated tag on that commit: + + ```sh + git tag -a vX.Y.Z -m 'vX.Y.Z' + git push origin vX.Y.Z + ``` + +The tag must be `v` plus the version, or the workflow stops before it +builds. GitHub Packages rejects a version it already has, so a failed +release needs a new version and a new tag, not a re-run. `rake release` +is disabled; it would tag and push from a laptop. From 238fd4f134a5edbd18cdee4764416c7839271dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:00:53 +0200 Subject: [PATCH 64/83] Encode request bodies with to_json JSON.generate calls to_json with a State, and ActiveSupport's to_json then defers to the stdlib. So a Time in a request body went out as Time#to_s ("2026-08-31 15:50:50 UTC") instead of ISO 8601. Amazon rejects that in createReport's dataStartTime, which active_cart's returns import sends as a TimeWithZone. v1 called to_json; V2 does again, so a consumer's encoders apply. --- lib/amazon_sp_clients/v2/client.rb | 6 ++++-- spec/amazon_sp_clients/v2/client_spec.rb | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/amazon_sp_clients/v2/client.rb b/lib/amazon_sp_clients/v2/client.rb index aa50fc8..3491b27 100644 --- a/lib/amazon_sp_clients/v2/client.rb +++ b/lib/amazon_sp_clients/v2/client.rb @@ -81,7 +81,7 @@ def api(klass) # @param path [String] request path, already percent-encoded # @param query [Hash] query parameters; nil values are left out # @param headers [Hash] extra request headers; nil values are left out - # @param body [Hash, Array, String, nil] JSON-encoded unless already a String + # @param body [Hash, Array, String, nil] sent through to_json unless already a String # @param rdt [Array, nil] send a restricted data token for these # resources; nil or empty sends the normal access token # @return [AmazonSpClients::ApiResponse] @@ -151,10 +151,12 @@ def send_request(method, path, query, headers, body) raise @errors.transport_error(e, method: method, url: "#{@config.base_url}#{path}") end + # The body's own to_json, not JSON.generate: ActiveSupport's encoder + # (ISO 8601 times) only runs through to_json, and v1 called it too. def encode(body) return body if body.nil? || body.is_a?(String) - JSON.generate(body) + body.to_json end def parse(response) diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb index c3b6edb..16c5b33 100644 --- a/spec/amazon_sp_clients/v2/client_spec.rb +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -108,6 +108,25 @@ def rdt_body(token = 'RDT', expires_in: 3600) expect(stub).to have_been_requested end + # ActiveSupport's to_json (ToJsonWithActiveSupportEncoder) runs its + # own encoder, which writes Time as ISO 8601, but defers to the stdlib + # when JSON.generate calls it with a State. So JSON.generate(body) + # loses the consumer's encoding and body.to_json keeps it, as v1 did. + # The class below behaves the same way. + it 'encodes the body with its own to_json' do + body = Class.new(Hash) do + def to_json(options = nil) + options.is_a?(JSON::State) ? super : '{"at":"2026-09-06T00:00:00.000Z"}' + end + end.new + stub = stub_request(:post, orders_url).with(body: '{"at":"2026-09-06T00:00:00.000Z"}') + .to_return(status: 200, body: '{}') + + client.request(:post, '/orders/v0/orders', body: body) + + expect(stub).to have_been_requested + end + it 'sends a String body as it is' do stub = stub_request(:put, orders_url).with(body: 'raw').to_return(status: 200, body: '{}') From 54c197751c8b7c996ad6314cfc1b3462c607943e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:00:53 +0200 Subject: [PATCH 65/83] Keep the LWA and gateway text in error messages An LWA 5xx dropped its error and error_description, so the message read "503 (no error details)" and a consumer's retry rule on the text could not match. A 4xx from API Gateway carries {"message": ...} instead of an errors array and read the same way. Both now show the text the server sent. --- lib/amazon_sp_clients/v2/error_mapper.rb | 18 ++++++++----- .../amazon_sp_clients/v2/error_mapper_spec.rb | 27 ++++++++++++++++--- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/lib/amazon_sp_clients/v2/error_mapper.rb b/lib/amazon_sp_clients/v2/error_mapper.rb index 34f36ac..8d35c5a 100644 --- a/lib/amazon_sp_clients/v2/error_mapper.rb +++ b/lib/amazon_sp_clients/v2/error_mapper.rb @@ -116,7 +116,7 @@ def error_for(env) def api_error(env) parsed = parse_json(env.body) errors = api_errors(parsed) - messages = parsed && errors.map { |e| describe(e) } + messages = parsed && api_messages(parsed, errors) klass = STATUS_ERRORS.fetch(env.status) { generic_class(env.status) } klass.new("#{env.status} #{summary(env.body, messages)}", @@ -133,25 +133,29 @@ def api_errors(parsed) ApiError.new(list.grep(Hash)).errors end - def lwa_error(env) - return lwa_server_error(env) if SERVER_ERROR_STATUSES.cover?(env.status) + # The documented errors, or the one-line body API Gateway sends when + # a request never reaches SP-API, e.g. {"message":"Forbidden"}. + def api_messages(parsed, errors) + return errors.map { |e| describe(e) } if errors.any? + + message = parsed[:message] if parsed.is_a?(Hash) + message.to_s.empty? ? [] : [message.to_s] + end + def lwa_error(env) parsed = parse_json(env.body) parsed = nil unless parsed.is_a?(Hash) code = parsed&.fetch(:error, nil) description = parsed&.fetch(:error_description, nil) messages = parsed && [[code, description].compact.join(': ')].reject(&:empty?) message = "#{env.status} #{summary(env.body, messages)}" + return ServerError.new(message, **context(env)) if SERVER_ERROR_STATUSES.cover?(env.status) return ThrottledError.new(message, **context(env)) if env.status == THROTTLED_STATUS LWA_ERRORS.fetch(code, AuthError) .new(message, code: code, description: description, **context(env)) end - def lwa_server_error(env) - ServerError.new("#{env.status} #{summary(env.body, [])}", **context(env)) - end - def document_error(env) DocumentError.new("#{env.status} #{env.reason_phrase}".strip, **context(env)) end diff --git a/spec/amazon_sp_clients/v2/error_mapper_spec.rb b/spec/amazon_sp_clients/v2/error_mapper_spec.rb index e322e90..3e3285c 100644 --- a/spec/amazon_sp_clients/v2/error_mapper_spec.rb +++ b/spec/amazon_sp_clients/v2/error_mapper_spec.rb @@ -103,6 +103,16 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") expect(error_for(:api, status: 502, body: '').message).to eq('502 (body is not JSON)') end + # API Gateway answers for SP-API before a request reaches it, with a + # one-line body instead of an errors array. + it 'falls back to a top-level message when the body has no errors' do + err = error_for(:api, status: 403, body: '{"message":"Forbidden"}') + + expect(err).to be_an_instance_of(v2::ForbiddenError) + expect(err.message).to eq('403 Forbidden') + expect(err.errors).to eq([]) + end + it 'reads the request id and rate limit headers in any case' do err = error_for( :api, status: 429, @@ -188,9 +198,20 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") expect(err.code).to eq('unauthorized_client') end - it 'maps 5xx to ServerError' do - expect(error_for(:lwa, status: 500, method: :post, path: token_path)) - .to be_an_instance_of(v2::ServerError) + it 'maps 5xx to ServerError and keeps the LWA error in the message' do + body = '{"error":"ServerError","error_description":"Please try again"}' + + err = error_for(:lwa, status: 503, body: body, method: :post, path: token_path) + + expect(err).to be_an_instance_of(v2::ServerError) + expect(err.message).to eq('503 ServerError: Please try again') + end + + it 'maps a 5xx without a body to ServerError' do + err = error_for(:lwa, status: 500, method: :post, path: token_path) + + expect(err).to be_an_instance_of(v2::ServerError) + expect(err.message).to eq('500 (no body)') end # A throttled token request is not a credentials problem. From ac5a2142b9744063d688a666a2ac9c88b72a08f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:00:53 +0200 Subject: [PATCH 66/83] Name the missing url in a document payload A string-keyed or url-less Hash raised KeyError from deep inside the helper. It is a caller error: the payload must be ApiResponse#payload, with symbol keys. Raise ArgumentError saying so, with the keys given. --- lib/amazon_sp_clients/v2/documents.rb | 13 +++++++++++-- spec/amazon_sp_clients/v2/documents_spec.rb | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/amazon_sp_clients/v2/documents.rb b/lib/amazon_sp_clients/v2/documents.rb index 6bf61b4..f6cfb54 100644 --- a/lib/amazon_sp_clients/v2/documents.rb +++ b/lib/amazon_sp_clients/v2/documents.rb @@ -40,7 +40,7 @@ def initialize(config) # @return [nil] # @raise [DocumentError, ConnectionError] def upload(document, content_type, body) - send_request(:put, document.fetch(:url), body, CONTENT_TYPE_HEADER => content_type) + send_request(:put, url_of(document), body, CONTENT_TYPE_HEADER => content_type) nil end @@ -74,7 +74,16 @@ def build_connection end def fetch(document) - send_request(:get, document.fetch(:url), nil, {}) + send_request(:get, url_of(document), nil, {}) + end + + # The payload of createFeedDocument, getFeedDocument or + # getReportDocument as ApiResponse#payload returns it: symbol keys. + def url_of(document) + document.fetch(:url) do + keys = document.keys.inspect + raise ArgumentError, "document payload without a :url key (keys: #{keys})" + end end def send_request(method, url, body, headers) diff --git a/spec/amazon_sp_clients/v2/documents_spec.rb b/spec/amazon_sp_clients/v2/documents_spec.rb index e7f5a9a..c90a94f 100644 --- a/spec/amazon_sp_clients/v2/documents_spec.rb +++ b/spec/amazon_sp_clients/v2/documents_spec.rb @@ -112,6 +112,12 @@ expect { documents.download_report_document(document) }.to raise_error(v2::TimeoutError) end + + # The payload comes from ApiResponse#payload, so its keys are symbols. + it 'names the missing url when the payload has string keys' do + expect { documents.download_report_document({ 'url' => url }) } + .to raise_error(ArgumentError, /:url/) + end end # WebMock hides how the adapter puts bytes on the wire, so these talk From d3e323990eec2423682d60c956ebc3e700b0782d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:00:53 +0200 Subject: [PATCH 67/83] Add an RDT preset for report documents Every consumer that downloads a restricted report builds the same GET /reports/2021-06-30/documents/ resource by hand, path literal included. RDT.report_document(id) returns it. A spec checks the path against the one the generated getReportDocument requests, so the preset cannot drift when the module moves. --- CHANGELOG.md | 2 ++ README.md | 7 ++++--- lib/amazon_sp_clients/v2/rdt.rb | 15 ++++++++++++++- spec/amazon_sp_clients/v2/rdt_spec.rb | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc554a5..4cc28ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ considered breaking and do not trigger a major version bump. - Feed upload, feed result download and report download on the V2 client. Report documents come back gunzipped and UTF-8 tagged when Amazon gzipped them. +- `RDT.report_document(id)`, the resource list for a restricted report + document, next to the `ORDERS` and `ORDERS_AND_ITEMS` presets. - `rake yard:verify` and a CI job that fail when a public V2 object has no doc comment. - A second template set in the generator. Each `codegen-config.yml` diff --git a/README.md b/README.md index f3f8e0d..2ca2888 100644 --- a/README.md +++ b/README.md @@ -147,9 +147,10 @@ instead of the access token. ```ruby rdt = AmazonSpClients::V2::RDT client.orders_v0.get_orders(ids, created_after: since, rdt: rdt::ORDERS_AND_ITEMS) +client.reports_2021.get_report_document(doc_id, rdt: rdt.report_document(doc_id)) -path = "/reports/2021-06-30/documents/#{doc_id}" -client.reports_2021.get_report_document(doc_id, rdt: [rdt.resource('GET', path)]) +# Any other restricted resource: method, path template, PII fields wanted. +rdt.resource('GET', '/orders/v0/orders/{orderId}', %w[buyerInfo shippingAddress]) ``` ### Errors @@ -192,7 +193,7 @@ client.download_report_document(report_document_payload) # String, gunzipped whe | `SpOrdersV0::OrdersV0Api.new(session)` | `client.orders_v0` | | `get_orders(ids, opts)` with an options Hash | `get_orders(ids, **opts)` with real parameter names only | | `auth_names: [:orders_and_items]` | `rdt: RDT::ORDERS_AND_ITEMS` | -| `auth_names: [{ method: 'GET', path: path }]` | `rdt: [RDT.resource('GET', path)]` | +| `auth_names: [{ method: 'GET', path: path }]` | `rdt: RDT.report_document(doc_id)` for a report document, `rdt: [RDT.resource('GET', path)]` for anything else | | `AmazonSpClients.configure.region` | `config.region` | | `AmazonSpClients.configure.sandbox_env!` / `disable_sandbox!` | `Config.new(sandbox: true)`. The config is frozen, so a client cannot be switched after it is built. | | `c.logger`, `c.role_arn`, `c.access_key`, `c.secret_key`, `c.credentials_provider` | nothing. v1 has ignored them since 1.8.0; delete the lines, and the AWS credential code that fed them. | diff --git a/lib/amazon_sp_clients/v2/rdt.rb b/lib/amazon_sp_clients/v2/rdt.rb index a7cf78e..b152ba6 100644 --- a/lib/amazon_sp_clients/v2/rdt.rb +++ b/lib/amazon_sp_clients/v2/rdt.rb @@ -9,7 +9,7 @@ module V2 # that token instead of the normal access token. # # client.orders_v0.get_orders(ids, rdt: RDT::ORDERS_AND_ITEMS) - # client.reports_2021.get_report_document(id, rdt: [RDT.resource('GET', path)]) + # client.reports_2021.get_report_document(id, rdt: RDT.report_document(id)) module RDT # One restricted resource: HTTP method, path template and the PII # data elements wanted. A value object, so equal resources make @@ -44,6 +44,19 @@ def self.resource(http_method, path, data_elements = nil) Resource.new(http_method: http_method, path: path, data_elements: data_elements) end + # Path prefix of getReportDocument in reports_2021. A token is only + # good for the exact path it names, document id included. + REPORT_DOCUMENTS_PATH = '/reports/2021-06-30/documents' + + # The resource list for a restricted report document (PII report + # types such as order and returns reports). + # + # @param document_id [String] the reportDocumentId + # @return [Array] + def self.report_document(document_id) + [resource('GET', "#{REPORT_DOCUMENTS_PATH}/#{document_id}")].freeze + end + # Restricted tokens per resource list, with expiry. One lock, held # while a missing token is fetched, so concurrent callers for the # same resources cause one Tokens API call. The fetch block runs diff --git a/spec/amazon_sp_clients/v2/rdt_spec.rb b/spec/amazon_sp_clients/v2/rdt_spec.rb index ffc0a9f..eb0e048 100644 --- a/spec/amazon_sp_clients/v2/rdt_spec.rb +++ b/spec/amazon_sp_clients/v2/rdt_spec.rb @@ -58,6 +58,25 @@ def token(value, expires_in: 3600) end end + describe '.report_document' do + it 'names the getReportDocument path for that document' do + expect(described_class.report_document('DOC1').map(&:to_request)) + .to eq([{ method: 'GET', path: '/reports/2021-06-30/documents/DOC1' }]) + end + + # The token is only good for the exact path of the request, so the + # preset must follow the generated operation when the module moves. + it 'matches the path the generated getReportDocument requests' do + requested = nil + stub_request(:get, %r{sellingpartnerapi-na\.amazon\.com/}) + .with { |req| requested = req.uri.path } + .to_return(status: 200, body: '{}', headers: { 'Content-Type' => 'application/json' }) + v2::Client.new(v2::Config.new) { 'ACCESS' }.reports_2021.get_report_document('DOC1') + + expect(described_class.report_document('DOC1').first.path).to eq(requested) + end + end + describe described_class::Cache do let(:cache) { described_class.new } let(:orders) { v2::RDT::ORDERS } From e895432e06531b77da11531c0b79fb76b3aad0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:00:53 +0200 Subject: [PATCH 68/83] Fill in the migration table from the cart review Rows the first V2 consumer needed and the table lacked: transport failures that fell through v1's last rescue are ConnectionError now, the message text changed and is not a contract, an empty array is still sent as an empty value, and upload_feed_document returns nil. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ca2888..78eab2c 100644 --- a/README.md +++ b/README.md @@ -204,8 +204,11 @@ client.download_report_document(report_document_payload) # String, gunzipped whe | `rescue Faraday::ResourceNotFound` | `rescue V2::NotFoundError` | | `rescue Faraday::BadRequestError, Faraday::ClientError` | `rescue V2::BadRequestError, V2::ClientError` | | `rescue Faraday::ServerError` | `rescue V2::ServerError, V2::TimeoutError`. Faraday makes a timeout a `ServerError`; V2 makes it a `ConnectionError`, so add it where you treated 5xx as worth retrying. | +| `Faraday::ConnectionFailed`, `Faraday::SSLError` reaching your last `rescue` | `rescue V2::ConnectionError`. v1 let them fall through untyped; V2 wraps every transport failure, `TimeoutError` included, with the original exception as `cause`. | +| `e.message =~ /Please try again/` and other text matches | Match on the class and on `code`. The text changed: `" : (
)"` for SP-API, `" : "` for LWA, `" (no body)"` and friends when there is nothing to show. The wording is not a contract. | +| `order_statuses: []` in the options Hash | The same on the wire: `[]` is sent as an empty value (`OrderStatuses=`), a nil keyword is left off. | | message matches `InvalidInput` | `e.code == 'InvalidInput'` | -| `upload_feed_data`, `download_feed_report`, `download_report_document` | `client.upload_feed_document`, `client.download_feed_result`, `client.download_report_document` (the last one gunzips for you) | +| `upload_feed_data`, `download_feed_report`, `download_report_document` | `client.upload_feed_document`, `client.download_feed_result`, `client.download_report_document`. The last one gunzips for you. The first returns nil; v1 returned the S3 response, which nothing read. | ## Code generation From a2656c026a0957ba0895c39bf645e47f4544736a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 10:03:49 +0200 Subject: [PATCH 69/83] Publish to rubygems.org instead of GitHub Packages The gem goes public. The tag workflow now pushes to rubygems.org through Trusted Publishing: the job's OIDC token is traded for a short-lived key, so no API key is stored anywhere. rubygems.org must trust the workflow first; README, "Releasing", has the one-time setup. Consumers install a version from rubygems.org instead of a git branch. The push host in the gemspec changes with it; the MFA rule stays. --- .github/workflows/release.yml | 23 +++++++++++------------ CHANGELOG.md | 4 ++-- CLAUDE.md | 10 +++++----- README.md | 29 ++++++++++++++++------------- amazon_sp_clients.gemspec | 6 ++---- spec/gemspec_spec.rb | 14 +++++++------- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 281677f..23ffb5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,16 @@ name: Release # A version tag is the only release path. It builds the gem, pushes it -# to the Dropstream registry on GitHub Packages and opens a GitHub -# Release with that version's CHANGELOG entry. See README, "Releasing". +# to rubygems.org through Trusted Publishing (no API key stored anywhere) +# and opens a GitHub Release with that version's CHANGELOG entry. +# rubygems.org trusts this workflow file by name; see README, "Releasing". on: push: tags: ["v*"] permissions: contents: write # the GitHub Release - packages: write # the gem push + id-token: write # the OIDC token rubygems.org exchanges for a push key jobs: publish: @@ -42,15 +43,13 @@ jobs: - run: bundle exec rspec - run: gem build amazon_sp_clients.gemspec - # GitHub Packages takes the workflow token; no extra secret. - - name: Push the gem to GitHub Packages - run: | - mkdir -p ~/.gem - echo ":github: Bearer ${GITHUB_TOKEN}" > ~/.gem/credentials - chmod 0600 ~/.gem/credentials - gem push --key github --host "https://rubygems.pkg.github.com/${GITHUB_REPOSITORY_OWNER}" amazon_sp_clients-*.gem - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Trades this job's OIDC token for a short-lived rubygems.org key + # that can push only this gem. Needs the trusted publisher set up + # on rubygems.org for repository dropstream/amazon_sp_clients and + # workflow release.yml. + - uses: rubygems/configure-rubygems-credentials@v2.1.0 + - name: Push the gem to rubygems.org + run: gem push amazon_sp_clients-*.gem - name: Create the GitHub Release run: gh release create "${GITHUB_REF_NAME}" amazon_sp_clients-*.gem --title "${GITHUB_REF_NAME}" --notes-file release_notes.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc28ae..48d90de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,8 @@ considered breaking and do not trigger a major version bump. entry lists its template sets. Generation now refuses to run while tracked generated files belong to no configured module, and fails on names that Ruby or the V2 method signature already use. -- A release workflow. Pushing a `v*` tag publishes the gem to the - Dropstream registry on GitHub Packages and opens a GitHub Release +- A release workflow. Pushing a `v*` tag publishes the gem to + rubygems.org through Trusted Publishing and opens a GitHub Release with the CHANGELOG entry. `rake release` is disabled. ### Changed diff --git a/CLAUDE.md b/CLAUDE.md index 6d34765..61c84ee 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -112,8 +112,8 @@ advance the pin only in its own PR. ## Releases -Published to the Dropstream registry on GitHub Packages by -`.github/workflows/release.yml` when a `v*` tag is pushed; steps in -README, "Releasing". `rake release` is disabled. Consumers still install -the gem from git master, so master takes 2.0.0 only after they move to -the versioned dependency. +Published to rubygems.org by `.github/workflows/release.yml` when a +`v*` tag is pushed, through Trusted Publishing; steps in README, +"Releasing". `rake release` is disabled. Consumers still install the +gem from git master, so master takes 2.0.0 only after they move to the +versioned dependency. diff --git a/README.md b/README.md index 78eab2c..1c52720 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,11 @@ ## Installation -The gem is published to the Dropstream registry on GitHub Packages. -Add it inside that registry's `source` block, next to the other -Dropstream gems: - ```ruby -source 'https://rubygems.pkg.github.com/dropstream' do - gem 'amazon_sp_clients', '~> 2.0' -end +gem 'amazon_sp_clients', '~> 2.0' ``` -Bundler needs a GitHub token with `read:packages` for that host. Apps -that already install `active_cart` from there have one. - +Releases are on [rubygems.org](https://rubygems.org/gems/amazon_sp_clients). A git source (`gem 'amazon_sp_clients', git: ...`) still works, but it follows a branch instead of a version. If you keep one, pin a `tag:`. @@ -243,8 +235,19 @@ them by hand; change the generator (or the templates in A release is a version tag. Nothing else publishes. The `Release` workflow (`.github/workflows/release.yml`) checks the tag against the -version, runs the suite, builds the gem, pushes it to GitHub Packages -and opens a GitHub Release with the CHANGELOG entry. +version, runs the suite, builds the gem, pushes it to rubygems.org and +opens a GitHub Release with the CHANGELOG entry. + +The push uses rubygems.org's Trusted Publishing: the job's GitHub OIDC +token is exchanged for a short-lived key, so no API key is stored +anywhere. rubygems.org has to trust this repository's workflow first. +Before the first release, sign in to rubygems.org, open the Trusted +publishers page of your profile and add a pending publisher: gem +`amazon_sp_clients`, repository owner `dropstream`, repository +`amazon_sp_clients`, workflow `release.yml`, environment empty. A +pending publisher expires when the first push does not follow soon +(12 hours at the time of writing). After the first release the +publisher belongs to the gem and stays. 1. Set `AmazonSpClients::VERSION` in `lib/amazon_sp_clients/version.rb`. 2. Re-lock all three lockfiles, or CI's frozen install fails: @@ -265,6 +268,6 @@ and opens a GitHub Release with the CHANGELOG entry. ``` The tag must be `v` plus the version, or the workflow stops before it -builds. GitHub Packages rejects a version it already has, so a failed +builds. rubygems.org rejects a version it already has, so a failed release needs a new version and a new tag, not a re-run. `rake release` is disabled; it would tag and push from a laptop. diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index e7ec944..84ec70a 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -12,10 +12,8 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.required_ruby_version = Gem::Requirement.new('>= 3.3') - # Releases go to the Dropstream registry on GitHub Packages, never to - # rubygems.org. `github_repo` ties the package to this repository. - spec.metadata['allowed_push_host'] = 'https://rubygems.pkg.github.com/dropstream' - spec.metadata['github_repo'] = 'ssh://github.com/dropstream/amazon_sp_clients' + # Releases go to rubygems.org through the tag workflow, never from a laptop. + spec.metadata['allowed_push_host'] = 'https://rubygems.org' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = spec.homepage diff --git a/spec/gemspec_spec.rb b/spec/gemspec_spec.rb index bfc35b0..2ac622d 100644 --- a/spec/gemspec_spec.rb +++ b/spec/gemspec_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -# The gem is published to the Dropstream registry on GitHub Packages. -# These examples keep a `gem push` from ever reaching rubygems.org and -# keep development files out of the built gem. +# The gem is published to rubygems.org by the tag workflow. These +# examples pin the push host and its MFA rule, and keep development +# files out of the built gem. RSpec.describe 'amazon_sp_clients.gemspec' do subject(:gemspec) do Gem::Specification.load(File.expand_path('../amazon_sp_clients.gemspec', __dir__)) @@ -16,12 +16,12 @@ }x end - it 'allows pushes only to the Dropstream registry on GitHub Packages' do - expect(gemspec.metadata['allowed_push_host']).to eq('https://rubygems.pkg.github.com/dropstream') + it 'allows pushes only to rubygems.org' do + expect(gemspec.metadata['allowed_push_host']).to eq('https://rubygems.org') end - it 'names the repository the package belongs to' do - expect(gemspec.metadata['github_repo']).to eq('ssh://github.com/dropstream/amazon_sp_clients') + it 'requires MFA of its owners on rubygems.org' do + expect(gemspec.metadata['rubygems_mfa_required']).to eq('true') end it 'ships the library, the generated clients and the top-level docs' do From c14212328669df058f55443006eab5efcfff1a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 10:03:49 +0200 Subject: [PATCH 70/83] Mark the gem experimental and point to peddler The README opens with the status: large changes in progress, interfaces may move between releases, and peddler is the recommended client for production use. The gemspec summary and description say the same, so the rubygems.org page does too. --- README.md | 6 ++++++ amazon_sp_clients.gemspec | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c52720..026e845 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # AmazonSpClients +> **Status: experimental.** This gem is in the middle of large changes: +> a new code generator, a second client (`V2`), and consumers still +> moving over. Interfaces can change between releases. For a maintained, +> complete SP-API client we recommend +> [peddler](https://github.com/lineofflight/peddler). + ## Installation ```ruby diff --git a/amazon_sp_clients.gemspec b/amazon_sp_clients.gemspec index 84ec70a..a6e6e5b 100644 --- a/amazon_sp_clients.gemspec +++ b/amazon_sp_clients.gemspec @@ -6,8 +6,9 @@ Gem::Specification.new do |spec| spec.authors = ['Dropstream'] spec.email = ['351015+nina-saule@users.noreply.github.com'] - spec.summary = 'Amazon Selling Partner APIs' - spec.description = 'Ruby clients for the Amazon Selling Partner API (SP-API)' + spec.summary = 'Experimental Ruby clients for the Amazon Selling Partner API' + spec.description = 'Ruby clients for the Amazon Selling Partner API (SP-API), generated from ' \ + "Amazon's models. Experimental; consider peddler for production use." spec.homepage = 'https://github.com/dropstream/amazon_sp_clients' spec.license = 'MIT' spec.required_ruby_version = Gem::Requirement.new('>= 3.3') From f90a0cadf2565b80481f506a21ab4359752d067b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:03:30 +0200 Subject: [PATCH 71/83] Rename the gem to sp_api_clients The gem goes public on rubygems.org, and "amazon" is Amazon's name, not ours. Only the gem name changes: the AmazonSpClients namespace, the require paths, vendor/ and the generator stay as they are, so a consumer changes one Gemfile line. lib/sp_api_clients.rb makes Bundler's automatic require work for the new name. The V2 default User-Agent names the gem, so it follows. The lockfiles, the release workflow and the rubocop todo follow the gemspec file name. --- .github/workflows/release.yml | 6 ++--- .rubocop_todo.yml | 2 +- CHANGELOG.md | 8 +++++++ Gemfile | 2 +- Gemfile.lock | 4 ++-- gemfiles/faraday_1.gemfile.lock | 6 ++--- gemfiles/faraday_2.gemfile.lock | 6 ++--- lib/amazon_sp_clients/v2/config.rb | 2 +- lib/sp_api_clients.rb | 6 +++++ ..._clients.gemspec => sp_api_clients.gemspec | 5 +++-- spec/amazon_sp_clients/v2/config_spec.rb | 2 +- spec/gemspec_spec.rb | 14 ++++++++---- spec/sp_api_clients_spec.rb | 22 +++++++++++++++++++ 13 files changed, 64 insertions(+), 21 deletions(-) create mode 100644 lib/sp_api_clients.rb rename amazon_sp_clients.gemspec => sp_api_clients.gemspec (94%) create mode 100644 spec/sp_api_clients_spec.rb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23ffb5d..7edba22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: fi - run: bundle exec rspec - - run: gem build amazon_sp_clients.gemspec + - run: gem build sp_api_clients.gemspec # Trades this job's OIDC token for a short-lived rubygems.org key # that can push only this gem. Needs the trusted publisher set up @@ -49,9 +49,9 @@ jobs: # workflow release.yml. - uses: rubygems/configure-rubygems-credentials@v2.1.0 - name: Push the gem to rubygems.org - run: gem push amazon_sp_clients-*.gem + run: gem push sp_api_clients-*.gem - name: Create the GitHub Release - run: gh release create "${GITHUB_REF_NAME}" amazon_sp_clients-*.gem --title "${GITHUB_REF_NAME}" --notes-file release_notes.md + run: gh release create "${GITHUB_REF_NAME}" sp_api_clients-*.gem --title "${GITHUB_REF_NAME}" --notes-file release_notes.md env: GH_TOKEN: ${{ github.token }} diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3fd280a..92d4e87 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -11,7 +11,7 @@ # SupportedStyles: Gemfile, gems.rb, gemspec Gemspec/DevelopmentDependencies: Exclude: - - 'amazon_sp_clients.gemspec' + - 'sp_api_clients.gemspec' # Offense count: 10 # This cop supports safe autocorrection (--autocorrect). diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d90de..fd3c500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,14 @@ considered breaking and do not trigger a major version bump. ### Changed +- The gem is named `sp_api_clients` on rubygems.org; the old name + started with a company name that is not ours. The `AmazonSpClients` + namespace and the `amazon_sp_clients/...` require paths are + unchanged, and `require 'sp_api_clients'` loads the v1 entry point. + A host that still installs `amazon_sp_clients` from git must drop + that line when it takes this gem: Bundler treats them as two gems, + and both ship the same files. The V2 default User-Agent names the + gem, so it changes too. - The built gem ships only `lib/`, `vendor/`, the gemspec and the top-level docs. Tests, the generator, CI config and dev tooling stay out of it. diff --git a/Gemfile b/Gemfile index 97f56a3..4126bb2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in amazon_sp_clients.gemspec +# The gem's dependencies live in sp_api_clients.gemspec gemspec # Dev-time pin only: keep the root lock on Faraday 1, which is what diff --git a/Gemfile.lock b/Gemfile.lock index 098712a..e56ec1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - amazon_sp_clients (2.0.0) + sp_api_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -107,12 +107,12 @@ PLATFORMS ruby DEPENDENCIES - amazon_sp_clients! dotenv faraday (~> 1.10.0) rake rspec rubocop (~> 1.86) + sp_api_clients! timecop webmock yard diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index 18ba05a..9c27097 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (2.0.0) + sp_api_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -108,19 +108,18 @@ PLATFORMS ruby DEPENDENCIES - amazon_sp_clients! dotenv faraday (~> 1.10) rake rspec rubocop (~> 1.86) + sp_api_clients! timecop webmock yard CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (2.0.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 @@ -164,6 +163,7 @@ CHECKSUMS rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef + sp_api_clients (2.0.0) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index 2ed0965..e40cdc1 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - amazon_sp_clients (2.0.0) + sp_api_clients (2.0.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -97,19 +97,18 @@ PLATFORMS ruby DEPENDENCIES - amazon_sp_clients! dotenv faraday (~> 2.0) rake rspec rubocop (~> 1.86) + sp_api_clients! timecop webmock yard CHECKSUMS addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af - amazon_sp_clients (2.0.0) ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 @@ -146,6 +145,7 @@ CHECKSUMS rubocop (1.90.0) sha256=9eb4c065b5c5154e4ef554c547972f3905a9eb6b53e657e580b6796b54bf8242 rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + sp_api_clients (2.0.0) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/lib/amazon_sp_clients/v2/config.rb b/lib/amazon_sp_clients/v2/config.rb index 75a99bb..d15ba7a 100644 --- a/lib/amazon_sp_clients/v2/config.rb +++ b/lib/amazon_sp_clients/v2/config.rb @@ -37,7 +37,7 @@ class Config # Seconds to open a connection. DEFAULT_OPEN_TIMEOUT = 10 # Names the gem and Ruby version, as Amazon asks. - DEFAULT_USER_AGENT = "amazon_sp_clients/#{VERSION} (Language=Ruby/#{RUBY_VERSION})".freeze + DEFAULT_USER_AGENT = "sp_api_clients/#{VERSION} (Language=Ruby/#{RUBY_VERSION})".freeze # Host prefix of the SP-API sandbox. SANDBOX_PREFIX = 'sandbox.' diff --git a/lib/sp_api_clients.rb b/lib/sp_api_clients.rb new file mode 100644 index 0000000..7a5c317 --- /dev/null +++ b/lib/sp_api_clients.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +# The gem is sp_api_clients; the code keeps its AmazonSpClients name. +# Bundler requires a gem by its name, so this file points it at the +# real entry point. `require 'amazon_sp_clients/v2'` loads V2 alone. +require 'amazon_sp_clients' diff --git a/amazon_sp_clients.gemspec b/sp_api_clients.gemspec similarity index 94% rename from amazon_sp_clients.gemspec rename to sp_api_clients.gemspec index a6e6e5b..17d0fb0 100644 --- a/amazon_sp_clients.gemspec +++ b/sp_api_clients.gemspec @@ -1,14 +1,15 @@ require_relative 'lib/amazon_sp_clients/version' Gem::Specification.new do |spec| - spec.name = 'amazon_sp_clients' + spec.name = 'sp_api_clients' spec.version = AmazonSpClients::VERSION spec.authors = ['Dropstream'] spec.email = ['351015+nina-saule@users.noreply.github.com'] spec.summary = 'Experimental Ruby clients for the Amazon Selling Partner API' spec.description = 'Ruby clients for the Amazon Selling Partner API (SP-API), generated from ' \ - "Amazon's models. Experimental; consider peddler for production use." + "Amazon's models. Experimental; consider peddler for production use. " \ + 'Not affiliated with Amazon.' spec.homepage = 'https://github.com/dropstream/amazon_sp_clients' spec.license = 'MIT' spec.required_ruby_version = Gem::Requirement.new('>= 3.3') diff --git a/spec/amazon_sp_clients/v2/config_spec.rb b/spec/amazon_sp_clients/v2/config_spec.rb index dca38e7..35071e1 100644 --- a/spec/amazon_sp_clients/v2/config_spec.rb +++ b/spec/amazon_sp_clients/v2/config_spec.rb @@ -20,7 +20,7 @@ it 'names the gem and Ruby in the user agent' do expect(config.user_agent).to eq( - "amazon_sp_clients/#{AmazonSpClients::VERSION} (Language=Ruby/#{RUBY_VERSION})" + "sp_api_clients/#{AmazonSpClients::VERSION} (Language=Ruby/#{RUBY_VERSION})" ) end diff --git a/spec/gemspec_spec.rb b/spec/gemspec_spec.rb index 2ac622d..9d04359 100644 --- a/spec/gemspec_spec.rb +++ b/spec/gemspec_spec.rb @@ -3,9 +3,9 @@ # The gem is published to rubygems.org by the tag workflow. These # examples pin the push host and its MFA rule, and keep development # files out of the built gem. -RSpec.describe 'amazon_sp_clients.gemspec' do +RSpec.describe 'sp_api_clients.gemspec' do subject(:gemspec) do - Gem::Specification.load(File.expand_path('../amazon_sp_clients.gemspec', __dir__)) + Gem::Specification.load(File.expand_path('../sp_api_clients.gemspec', __dir__)) end let(:dev_file) do @@ -16,6 +16,12 @@ }x end + # The name carries no vendor mark; the namespace and require paths + # keep the old name, so consumers change only their Gemfile. + it 'is named sp_api_clients' do + expect(gemspec.name).to eq('sp_api_clients') + end + it 'allows pushes only to rubygems.org' do expect(gemspec.metadata['allowed_push_host']).to eq('https://rubygems.org') end @@ -26,8 +32,8 @@ it 'ships the library, the generated clients and the top-level docs' do expect(gemspec.files).to include( - 'README.md', 'CHANGELOG.md', 'LICENSE', 'amazon_sp_clients.gemspec', - 'lib/amazon_sp_clients.rb', 'lib/amazon_sp_clients/v2.rb', + 'README.md', 'CHANGELOG.md', 'LICENSE', 'sp_api_clients.gemspec', + 'lib/sp_api_clients.rb', 'lib/amazon_sp_clients.rb', 'lib/amazon_sp_clients/v2.rb', 'lib/amazon_sp_clients/v2/apis/orders_v0.rb', 'vendor/orders_v0/lib/sp_orders_v0.rb' ) end diff --git a/spec/sp_api_clients_spec.rb b/spec/sp_api_clients_spec.rb new file mode 100644 index 0000000..17124bc --- /dev/null +++ b/spec/sp_api_clients_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' +require 'open3' +require 'rbconfig' + +# The gem is named sp_api_clients, the code keeps the AmazonSpClients +# namespace and require paths. This shim makes `gem 'sp_api_clients'` +# work with Bundler's automatic require. Fresh process: the suite has +# the gem loaded already. +RSpec.describe 'require "sp_api_clients"' do + it 'loads the v1 entry point' do + script = <<~RUBY + require 'sp_api_clients' + puts [defined?(AmazonSpClients::Session), defined?(AmazonSpClients::V2)].inspect + RUBY + + out, err, status = Open3.capture3(RbConfig.ruby, '-Ilib', '-e', script) + + expect(err).to eq('') + expect(status).to be_success + expect(out.strip).to eq('["constant", nil]') + end +end From 5778fb54d5da025951bf81775d56932e47e1d996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:03:56 +0200 Subject: [PATCH 72/83] Document the gem name in README and CLAUDE.md The install line, the rubygems.org link and the trusted publisher form use the new gem name. The repository keeps its old name, so the form asks for both. The README states that the project is not affiliated with Amazon. --- CLAUDE.md | 11 ++++++++--- README.md | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 61c84ee..4296048 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,8 +1,11 @@ -# amazon_sp_clients +# sp_api_clients Unofficial Ruby gem for the Amazon Selling Partner API (SP-API), used internally at Dropstream. It is one gem that wraps many generated API -clients: hand-written core code plus generated output. +clients: hand-written core code plus generated output. Published as +`sp_api_clients`; the code keeps the `AmazonSpClients` namespace and +the `amazon_sp_clients/...` require paths. `lib/sp_api_clients.rb` is +the one-line shim for the gem name. ## Layout @@ -116,4 +119,6 @@ Published to rubygems.org by `.github/workflows/release.yml` when a `v*` tag is pushed, through Trusted Publishing; steps in README, "Releasing". `rake release` is disabled. Consumers still install the gem from git master, so master takes 2.0.0 only after they move to the -versioned dependency. +versioned dependency. Bundler treats `amazon_sp_clients` (git) and +`sp_api_clients` as two gems that ship the same files, so a host drops +the git line in the same change that brings the new gem in. diff --git a/README.md b/README.md index 026e845..a879677 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AmazonSpClients +# sp_api_clients > **Status: experimental.** This gem is in the middle of large changes: > a new code generator, a second client (`V2`), and consumers still @@ -6,14 +6,18 @@ > complete SP-API client we recommend > [peddler](https://github.com/lineofflight/peddler). +The gem is `sp_api_clients`. The code keeps the `AmazonSpClients` +namespace and the `amazon_sp_clients/...` require paths. This project +is not affiliated with or endorsed by Amazon. + ## Installation ```ruby -gem 'amazon_sp_clients', '~> 2.0' +gem 'sp_api_clients', '~> 2.0' ``` -Releases are on [rubygems.org](https://rubygems.org/gems/amazon_sp_clients). -A git source (`gem 'amazon_sp_clients', git: ...`) still works, but it +Releases are on [rubygems.org](https://rubygems.org/gems/sp_api_clients). +A git source (`gem 'sp_api_clients', git: ...`) still works, but it follows a branch instead of a version. If you keep one, pin a `tag:`. Either way this requires only the main (root) gem, but won't load any of @@ -22,7 +26,7 @@ need across our system, but allow requiring per project/repo basis. Because of that, each API must be required explicitly: ```ruby -require 'amazon_sp_clients' # you can skip if you use Bundle.setup +require 'amazon_sp_clients' # or 'sp_api_clients'; Bundler.require does this for you # in active_cart require 'amazon_sp_clients/sp_orders_v0' # Orders API @@ -249,8 +253,9 @@ token is exchanged for a short-lived key, so no API key is stored anywhere. rubygems.org has to trust this repository's workflow first. Before the first release, sign in to rubygems.org, open the Trusted publishers page of your profile and add a pending publisher: gem -`amazon_sp_clients`, repository owner `dropstream`, repository -`amazon_sp_clients`, workflow `release.yml`, environment empty. A +`sp_api_clients`, repository owner `dropstream`, repository +`amazon_sp_clients` (the repository keeps its old name), workflow +`release.yml`, environment empty. A pending publisher expires when the first push does not follow soon (12 hours at the time of writing). After the first release the publisher belongs to the gem and stays. From 150cfc7d96c55746f80c5c61974997f5a900e6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 17:57:42 +0200 Subject: [PATCH 73/83] Add a standalone check of SP-API authorization examples/auth_check.rb runs live checks with nothing but the public gem: a made-up token is rejected, a real access token is accepted without any AWS signature, and a refresh needs the LWA client id and secret. It prints what each result means, so someone who does not know the gem can settle the question "what do we need in production" in a minute. Credentials come from environment variables only. The endpoint defaults to na and the marketplace to amazon.com. Loaded into a process that already runs under Bundler, the script uses the gem when that bundle has it, falls back to Net::HTTP with the same request otherwise, and never calls exit. Run from a shell it installs the public gem. examples/ stays out of the built gem. --- examples/auth_check.rb | 388 +++++++++++++++++++++++++++++++++++++++++ sp_api_clients.gemspec | 2 +- spec/gemspec_spec.rb | 2 +- 3 files changed, 390 insertions(+), 2 deletions(-) create mode 100755 examples/auth_check.rb diff --git a/examples/auth_check.rb b/examples/auth_check.rb new file mode 100755 index 0000000..8498362 --- /dev/null +++ b/examples/auth_check.rb @@ -0,0 +1,388 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Shows what Amazon needs to authorize an SP-API call. It pulls one order +# through the Orders API with nothing but an LWA access token, then shows +# what a token refresh needs. Read-only: it changes nothing on the seller +# account and stores nothing. Background notes are at the end of the file. +# +# Input comes from environment variables: +# +# SP_ACCESS_TOKEN a current access token (Atza|...); needed for check 2 +# SP_MARKETPLACE_ID default ATVPDKIKX0DER (amazon.com) +# SP_ENDPOINT default na; na, eu, fe or a country code such as de +# SP_REFRESH_TOKEN optional; enables check 3 +# SP_CLIENT_ID optional; with SP_CLIENT_SECRET, check 3 performs a real refresh +# SP_CLIENT_SECRET +# SP_LOOKBACK_DAYS default 30; how far back check 2 looks for an order +# SP_TRANSPORT gem (default when the gem is loaded) or http +# +# Run it from a shell. It installs the public gem into GEM_HOME and uses it: +# +# GEM_HOME=/tmp/gems ruby auth_check.rb +# +# Or load it into a Ruby process that already runs under Bundler, such as +# an application console: `load '/path/to/auth_check.rb'`. It then uses +# the gem when that bundle has it, and otherwise Ruby's Net::HTTP with the +# same URL and headers. Tokens are never printed, only a prefix and a length. + +# Under Bundler the bundle is fixed and bundler/inline would fight it. +if defined?(Bundler) && ENV.key?('BUNDLE_GEMFILE') + begin + require 'amazon_sp_clients/v2' + rescue LoadError + # Not in this bundle. Net::HTTP takes over below. + end +else + require 'bundler/inline' + + gemfile do + source 'https://rubygems.org' + gem 'sp_api_clients', '~> 2.0', require: 'amazon_sp_clients/v2' + end +end + +require 'json' +require 'net/http' +require 'time' +require 'uri' + +module AuthCheck + # SP-API host per endpoint code: a region or a country. + HOSTS = { + %w[na br ca mx us] => 'sellingpartnerapi-na.amazon.com', + %w[eu ae de eg es fr gb in it nl pl sa se tr] => 'sellingpartnerapi-eu.amazon.com', + %w[fe au jp sg] => 'sellingpartnerapi-fe.amazon.com' + }.freeze + DEFAULT_ENDPOINT = 'na' + # amazon.com + DEFAULT_MARKETPLACE_ID = 'ATVPDKIKX0DER' + # Shaped like a token so Amazon rejects it for its value, not its format. + BOGUS_TOKEN = 'Atza|this-token-is-not-valid' + LWA_TOKEN_URL = URI('https://api.amazon.com/auth/o2/token') + ORDERS_PATH = '/orders/v0/orders' + DEFAULT_LOOKBACK_DAYS = 30 + SECONDS_PER_DAY = 24 * 60 * 60 + # Enough of a token to recognise it, never enough to use it. + PREFIX_LENGTH = 5 + + # The headers gem 2.0.0 puts on every request. No signature among them. + ACCESS_TOKEN_HEADER = 'x-amz-access-token' + DATE_HEADER = 'x-amz-date' + DATE_FORMAT = '%Y%m%dT%H%M%SZ' + JSON_TYPE = 'application/json' + USER_AGENT = "sp_api_clients/2.0.0 auth_check (Language=Ruby/#{RUBY_VERSION})".freeze + RATE_LIMIT_HEADER = 'x-amzn-RateLimit-Limit' + REQUEST_ID_HEADER = 'x-amzn-RequestId' + HTTP_OK = 200 + + EXIT_PASS = 0 + EXIT_FAIL = 1 + EXIT_SKIPPED = 2 + + Orders = Struct.new(:status, :code, :message, :orders, :rate_limit, :request_id, + keyword_init: true) do + def ok? = status == HTTP_OK + end + + Exchange = Struct.new(:status, :access_token, :expires_in, :error, :description, + keyword_init: true) do + def ok? = status == HTTP_OK + end + + # Plain Net::HTTP with the gem's request shape. Used when the gem is + # not available in the running process. + module HttpTransport + module_function + + def name = 'Net::HTTP, same URL and headers as gem 2.0.0' + + def orders(token, endpoint, marketplace_id, created_after) + uri = URI("https://#{AuthCheck.host_for(endpoint)}#{ORDERS_PATH}") + uri.query = URI.encode_www_form(MarketplaceIds: marketplace_id, CreatedAfter: created_after, + MaxResultsPerPage: 1) + request = Net::HTTP::Get.new(uri) + headers(token).each { |name, value| request[name] = value } + response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) } + body = AuthCheck.parse_json(response.body) + + Orders.new(status: response.code.to_i, code: body.dig('errors', 0, 'code'), + message: body.dig('errors', 0, 'message'), + orders: body.dig('payload', 'Orders') || [], + rate_limit: response[RATE_LIMIT_HEADER], request_id: response[REQUEST_ID_HEADER]) + end + + def exchange(refresh_token, client_id, client_secret) + form = { 'grant_type' => 'refresh_token', 'refresh_token' => refresh_token } + form['client_id'] = client_id unless AuthCheck.blank?(client_id) + form['client_secret'] = client_secret unless AuthCheck.blank?(client_secret) + response = Net::HTTP.post_form(LWA_TOKEN_URL, form) + body = AuthCheck.parse_json(response.body) + + Exchange.new(status: response.code.to_i, access_token: body['access_token'], + expires_in: body['expires_in'], error: body['error'], + description: body['error_description']) + end + + def headers(token) + { ACCESS_TOKEN_HEADER => token, DATE_HEADER => Time.now.utc.strftime(DATE_FORMAT), + 'User-Agent' => USER_AGENT, 'Content-Type' => JSON_TYPE, 'Accept' => JSON_TYPE } + end + end + + # The gem itself, when it is loaded. + module GemTransport + module_function + + def name = "sp_api_clients #{AmazonSpClients::VERSION} (AmazonSpClients::V2)" + + def orders(token, endpoint, marketplace_id, created_after) + config = AmazonSpClients::V2::Config.new(endpoint: endpoint) + client = AmazonSpClients::V2::Client.new(config) { token } + response = client.orders_v0.get_orders([marketplace_id], created_after: created_after, + max_results_per_page: 1) + # String keys, like the raw body the other transport sees. + payload = JSON.parse(JSON.generate(response.payload)) + + Orders.new(status: HTTP_OK, orders: payload['Orders'] || [], + rate_limit: response.reported_rate_limit, + request_id: response.response.headers[REQUEST_ID_HEADER]) + rescue AmazonSpClients::V2::ResponseError => e + Orders.new(status: e.status, code: e.code, message: e.errors.first&.message, orders: [], + rate_limit: e.rate_limit, request_id: e.request_id) + end + + def exchange(refresh_token, client_id, client_secret) + config = AmazonSpClients::V2::Config.new(client_id: client_id.to_s, + client_secret: client_secret.to_s) + token = AmazonSpClients::V2::LWA.new(config).exchange(refresh_token: refresh_token) + + Exchange.new(status: HTTP_OK, access_token: token.access_token, expires_in: token.expires_in) + rescue AmazonSpClients::V2::AuthError => e + Exchange.new(status: e.status, error: e.code, description: e.description) + end + end + + module_function + + # @return [Integer] an exit code: 0 pass, 1 fail, 2 check 2 skipped + def run + unless host_for(endpoint) + say "FAIL: unknown endpoint code #{endpoint.inspect}; expected na, eu, fe or a country code." + return EXIT_FAIL + end + + environment + control + passed = real_token + refresh + loaded_libraries + + exit_code(passed) + end + + def environment + section 'Environment' + say "Ruby #{RUBY_VERSION}, transport: #{transport.name}" + say "endpoint #{endpoint} (#{host_for(endpoint)}), marketplace #{marketplace_id}" + file = ENV.fetch('AWS_WEB_IDENTITY_TOKEN_FILE', nil) + if file + size = File.exist?(file) ? "#{File.size(file)} bytes" : 'file missing' + say "AWS_WEB_IDENTITY_TOKEN_FILE is set (#{size}). This script never reads it." + else + say 'AWS_WEB_IDENTITY_TOKEN_FILE is not set. Not needed.' + end + say "AWS_ROLE_ARN is #{ENV.key?('AWS_ROLE_ARN') ? 'set' : 'not set'}. Not needed." + end + + # A request that reaches Amazon with a token Amazon cannot know. + def control + section 'Check 1: a made-up access token, no signature' + result = fetch_orders(BOGUS_TOKEN) + if result.ok? + say 'FAIL: Amazon accepted a made-up token. Something is wrong with this check.' + else + say "PASS: Amazon answered #{result.status} #{result.code}: #{result.message}" + say 'Meaning: the request reached Amazon and was rejected because of the token alone.' + end + rescue StandardError => e + say "FAIL: #{e.class}: #{e.message}" + end + + # The same request with a real access token. This is exactly what gem + # 2.0.0 sends: no AWS signature. + def real_token + section 'Check 2: your access token, no signature, one order' + token = ENV.fetch('SP_ACCESS_TOKEN', nil) + if blank?(token) + say 'SKIP: SP_ACCESS_TOKEN is not set.' + return nil + end + + say "token #{describe(token)}" + result = fetch_orders(token) + if result.ok? + report_orders(result) + say 'Meaning: the LWA access token is the only credential Amazon needs. ' \ + 'Gem 2.0.0 works as it is, for v1 and for V2.' + true + else + say "FAIL: Amazon answered #{result.status} #{result.code}: #{result.message} " \ + "(request id #{result.request_id})" + say 'Meaning: with code Unauthorized the token is expired or revoked. ' \ + 'Copy a fresh one and run again.' + false + end + rescue StandardError => e + say "FAIL: #{e.class}: #{e.message}" + false + end + + # Where new access tokens come from. + def refresh + section 'Check 3: what a token refresh needs (nothing is stored)' + refresh_token = ENV.fetch('SP_REFRESH_TOKEN', nil) + if blank?(refresh_token) + say 'SKIP: SP_REFRESH_TOKEN is not set.' + return + end + + client_id = ENV.fetch('SP_CLIENT_ID', nil) + client_secret = ENV.fetch('SP_CLIENT_SECRET', nil) + if blank?(client_id) || blank?(client_secret) + refresh_without_app(refresh_token) + else + refresh_with_app(refresh_token, client_id, client_secret) + end + rescue StandardError => e + say "FAIL: #{e.class}: #{e.message}" + end + + # Ask LWA the way a process without app credentials would have to. + def refresh_without_app(refresh_token) + say 'SP_CLIENT_ID and SP_CLIENT_SECRET are not set. Asking LWA with the refresh token only.' + result = transport.exchange(refresh_token, nil, nil) + say "Amazon answered #{result.status} #{result.error}: #{result.description}" + say 'Meaning: a refresh token alone cannot produce an access token. Whatever ' \ + 'renews the stored tokens every hour holds the client id and the client secret.' + end + + def refresh_with_app(refresh_token, client_id, client_secret) + result = transport.exchange(refresh_token, client_id, client_secret) + unless result.ok? + say "FAIL: LWA answered #{result.status} #{result.error}: #{result.description}" + return + end + + say "PASS: LWA issued a new access token (#{describe(result.access_token)}), " \ + "valid #{result.expires_in} s. Existing tokens stay valid too." + orders = fetch_orders(result.access_token) + if orders.ok? + say "PASS: the new token fetched orders: HTTP 200, #{orders.orders.size} order(s)" + else + say "FAIL: the new token was refused: #{orders.status} #{orders.code}: #{orders.message}" + end + say 'Meaning: refresh token plus client id plus client secret is the whole chain. ' \ + 'No AWS credential took part.' + end + + def loaded_libraries + section 'Loaded libraries' + aws = $LOADED_FEATURES.grep(/aws-sdk|aws-sigv4|aws_sigv4/) + if aws.empty? + say 'No AWS library was loaded during these checks.' + else + say "AWS libraries are loaded in this process (#{aws.size} files). " \ + 'These checks did not use them.' + end + end + + def report_orders(result) + say "PASS: HTTP 200, #{result.orders.size} order(s) in the first page of the last " \ + "#{lookback_days} days, rate limit #{result.rate_limit.inspect} per second" + first = result.orders.first + return unless first + + say "first order: #{first['AmazonOrderId']} #{first['OrderStatus']} #{first['PurchaseDate']}" + end + + def fetch_orders(token) + transport.orders(token, endpoint, marketplace_id, created_after) + end + + def transport + return HttpTransport if ENV.fetch('SP_TRANSPORT', nil) == 'http' + return HttpTransport unless defined?(::AmazonSpClients::V2) + + GemTransport + end + + def host_for(endpoint) + HOSTS.find { |codes, _host| codes.include?(endpoint.to_s) }&.last + end + + def endpoint = ENV.fetch('SP_ENDPOINT', DEFAULT_ENDPOINT) + def marketplace_id = ENV.fetch('SP_MARKETPLACE_ID', DEFAULT_MARKETPLACE_ID) + def lookback_days = ENV.fetch('SP_LOOKBACK_DAYS', DEFAULT_LOOKBACK_DAYS).to_i + def created_after = (Time.now.utc - (lookback_days * SECONDS_PER_DAY)).iso8601 + def blank?(value) = value.nil? || value.to_s.empty? + def describe(token) = "#{token[0, PREFIX_LENGTH]}... (#{token.length} characters)" + + def parse_json(body) + parsed = JSON.parse(body.to_s) + parsed.is_a?(Hash) ? parsed : {} + rescue JSON::ParserError + {} + end + + def exit_code(passed) + case passed + when true then EXIT_PASS + when false then EXIT_FAIL + else EXIT_SKIPPED + end + end + + def section(title) + puts + puts "== #{title}" + end + + def say(text) + puts " #{text}" + end +end + +code = AuthCheck.run +# Loaded into a console, the script must not end the console. +exit(code) if $PROGRAM_NAME == __FILE__ + +# Background, in plain words +# +# Two separate identity systems are involved. +# +# 1. AWS IAM. A pod's web identity token (AWS_WEB_IDENTITY_TOKEN_FILE) +# lets it assume an AWS role. Older SP-API clients used such a role to +# sign every request with AWS Signature Version 4. Since 2 October +# 2023 Amazon ignores that signature: "For requests with AWS Signature +# Version 4, we'll disregard the signature and proceed with LWA +# authorization." (developer-docs.amazon.com, changelog "SP-API no +# longer requires AWS IAM or AWS Signature Version 4"). Gem 2.0.0 +# sends no signature, on the v1 classes and on V2 alike. +# +# 2. Login with Amazon (LWA), OAuth 2.0. A seller authorizes your +# application once and you receive a refresh token (Atzr|...). Every +# hour you trade it for an access token (Atza|...) by sending the +# refresh token together with your application's client id and client +# secret to api.amazon.com. The access token goes on every request in +# the x-amz-access-token header. This is the only thing Amazon checks. +# +# Consequences: +# +# - A process that only calls Amazon needs only a current access token. +# It never needed the client id or secret, and gem 2.0.0 keeps it so. +# - Some process in your system must hold the client id and secret, or +# every store would stop working one hour after connecting. Find the +# process that renews stored access tokens; that is where they are. +# - An AWS role may still be needed for S3, SQS and other AWS services. +# Not for Amazon SP-API. diff --git a/sp_api_clients.gemspec b/sp_api_clients.gemspec index 17d0fb0..d05e9a5 100644 --- a/sp_api_clients.gemspec +++ b/sp_api_clients.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| # Only lib/, vendor/, the gemspec and the top-level docs ship. Tests, # the generator, CI config, dotfiles and the dev tooling stay behind. dev_files = %r{ - ^(test|spec|features|amzn-models|gemfiles|bin)/ | + ^(test|spec|features|amzn-models|gemfiles|bin|examples)/ | ^lib/generator | ^\. | ^(Gemfile(\.lock)?|Rakefile|CLAUDE\.md|codegen-config\.yml|selling-partner-api-models\.sha)$ diff --git a/spec/gemspec_spec.rb b/spec/gemspec_spec.rb index 9d04359..f690d9e 100644 --- a/spec/gemspec_spec.rb +++ b/spec/gemspec_spec.rb @@ -10,7 +10,7 @@ let(:dev_file) do %r{ - ^(spec|gemfiles|bin|lib/generator|\.github)/ | + ^(spec|gemfiles|bin|examples|lib/generator|\.github)/ | ^\. | ^(Gemfile|Gemfile\.lock|Rakefile|CLAUDE\.md)$ }x From 8e00882b3ba9a3d8a3fd92820e5855deda9c97b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 17:59:48 +0200 Subject: [PATCH 74/83] Drop internal project names from docs and specs The repository and the gem are public. Comments named the applications that consume the gem; the facts hold for any consumer. --- CLAUDE.md | 11 +++++------ README.md | 4 ++-- .../amazon_sp_clients/middlewares/raise_error_spec.rb | 2 +- spec/amazon_sp_clients/v2/client_spec.rb | 4 ++-- spec/amazon_sp_clients/v2/error_mapper_spec.rb | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4296048..2cc66af 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,11 +1,10 @@ # sp_api_clients -Unofficial Ruby gem for the Amazon Selling Partner API (SP-API), used -internally at Dropstream. It is one gem that wraps many generated API -clients: hand-written core code plus generated output. Published as -`sp_api_clients`; the code keeps the `AmazonSpClients` namespace and -the `amazon_sp_clients/...` require paths. `lib/sp_api_clients.rb` is -the one-line shim for the gem name. +Unofficial Ruby gem for the Amazon Selling Partner API (SP-API). It is +one gem that wraps many generated API clients: hand-written core code +plus generated output. Published as `sp_api_clients`; the code keeps +the `AmazonSpClients` namespace and the `amazon_sp_clients/...` require +paths. `lib/sp_api_clients.rb` is the one-line shim for the gem name. ## Layout diff --git a/README.md b/README.md index a879677..a9b292c 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ Because of that, each API must be required explicitly: ```ruby require 'amazon_sp_clients' # or 'sp_api_clients'; Bundler.require does this for you -# in active_cart +# a project that reads orders require 'amazon_sp_clients/sp_orders_v0' # Orders API # ...and others -# in active_fulfillment +# a project that reads inventory require 'amazon_sp_clients/sp_fba_inventory' # FBA Inventory API # ...and others ``` diff --git a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb index e893fd7..bc3ab73 100644 --- a/spec/amazon_sp_clients/middlewares/raise_error_spec.rb +++ b/spec/amazon_sp_clients/middlewares/raise_error_spec.rb @@ -66,7 +66,7 @@ def rescued_error end describe 'error message' do - # Callers (active_cart) match on the "Service 'token'" prefix. + # Consumers match on the "Service 'token'" prefix. it 'formats token errors from the JSON body' do stub_request(:post, "#{base_url}/auth/o2/token") .to_return(status: 400, body: fixture('token_error.json')) diff --git a/spec/amazon_sp_clients/v2/client_spec.rb b/spec/amazon_sp_clients/v2/client_spec.rb index 16c5b33..f19378f 100644 --- a/spec/amazon_sp_clients/v2/client_spec.rb +++ b/spec/amazon_sp_clients/v2/client_spec.rb @@ -50,7 +50,7 @@ def rdt_body(token = 'RDT', expires_in: 3600) expect(client.config).to be(config) end - # beagle_event_logger injects its middleware when the stack is + # A host's logging plugin may inject middleware when the stack is # locked, which must still happen at the first request, not at # construction. it 'leaves the middleware stack unlocked until the first request' do @@ -224,7 +224,7 @@ def to_json(options = nil) expect { client.request(:get, '/orders/v0/orders') }.to raise_error(v2::ConnectionError) end - # beagle_worker cancels a task by raising into the cart's thread. + # A host may cancel a task by raising into the thread that runs the request. it 'lets a foreign exception from the transport through unwrapped' do cancel = Class.new(StandardError) stub_request(:get, orders_url).to_raise(cancel.new('cancelled')) diff --git a/spec/amazon_sp_clients/v2/error_mapper_spec.rb b/spec/amazon_sp_clients/v2/error_mapper_spec.rb index 3e3285c..3e22431 100644 --- a/spec/amazon_sp_clients/v2/error_mapper_spec.rb +++ b/spec/amazon_sp_clients/v2/error_mapper_spec.rb @@ -296,8 +296,8 @@ def wrapped(exception, service: :api, url: "#{base_url}/thing") expect(err.request[:url]).to eq("#{base_url}/doc") end - # beagle_worker cancels a task by raising into the cart's thread; a - # blanket rescue would turn that into a connection error. + # A host may cancel a task by raising into the thread that runs the + # request; a blanket rescue would turn that into a connection error. it 'names only transport exceptions, never StandardError' do list = described_class::TRANSPORT_ERRORS From cff98aabbfbba1160235a08c9eecac11beb8f5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 18:58:15 +0200 Subject: [PATCH 75/83] Add a rake task that prepares a release rake release:prepare[X.Y.Z] refuses a dirty tree, a bad version, an existing tag or a missing CHANGELOG entry, then runs the suite, sets the version, dates the CHANGELOG heading, relocks the three lockfiles, commits and creates the annotated tag. It stops before the push: the tag push is the publish, and rubygems.org never accepts a version number twice, so the suite runs before anything is tagged. tasks/ stays out of the built gem. --- Rakefile | 17 ++++++ sp_api_clients.gemspec | 2 +- spec/gemspec_spec.rb | 2 +- spec/release_spec.rb | 69 +++++++++++++++++++++ tasks/release.rb | 135 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 spec/release_spec.rb create mode 100644 tasks/release.rb diff --git a/Rakefile b/Rakefile index 13f6180..3075319 100644 --- a/Rakefile +++ b/Rakefile @@ -18,6 +18,23 @@ RSpec::Core::RakeTask.new(:spec) task default: :spec +namespace :release do + desc 'Set the version, date the CHANGELOG, relock, run the suite, commit and tag' + task :prepare, [:version] do |_t, args| + require_relative 'tasks/release' + + release = Release::Preparer.new(args[:version]) + release.check! + Rake::Task[:spec].invoke + release.write_files + release.commit_and_tag + puts "Tagged #{release.tag}. Pushing the tag publishes the gem:" + puts " #{release.push_command}" + rescue Release::Error => e + abort e.message + end +end + desc 'Regenerate vendor/ API clients at the pinned spec revision' task :generate do require_relative 'lib/generator' diff --git a/sp_api_clients.gemspec b/sp_api_clients.gemspec index d05e9a5..94f4578 100644 --- a/sp_api_clients.gemspec +++ b/sp_api_clients.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| # Only lib/, vendor/, the gemspec and the top-level docs ship. Tests, # the generator, CI config, dotfiles and the dev tooling stay behind. dev_files = %r{ - ^(test|spec|features|amzn-models|gemfiles|bin|examples)/ | + ^(test|spec|features|amzn-models|gemfiles|bin|examples|tasks)/ | ^lib/generator | ^\. | ^(Gemfile(\.lock)?|Rakefile|CLAUDE\.md|codegen-config\.yml|selling-partner-api-models\.sha)$ diff --git a/spec/gemspec_spec.rb b/spec/gemspec_spec.rb index f690d9e..00e274d 100644 --- a/spec/gemspec_spec.rb +++ b/spec/gemspec_spec.rb @@ -10,7 +10,7 @@ let(:dev_file) do %r{ - ^(spec|gemfiles|bin|examples|lib/generator|\.github)/ | + ^(spec|gemfiles|bin|examples|lib/generator|tasks|\.github)/ | ^\. | ^(Gemfile|Gemfile\.lock|Rakefile|CLAUDE\.md)$ }x diff --git a/spec/release_spec.rb b/spec/release_spec.rb new file mode 100644 index 0000000..069e4bc --- /dev/null +++ b/spec/release_spec.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require 'date' +require_relative '../tasks/release' + +RSpec.describe Release do + let(:date) { Date.new(2026, 9, 7) } + + describe '.check_version!' do + it 'accepts X.Y.Z' do + expect { described_class.check_version!('2.0.1') }.not_to raise_error + end + + it 'rejects anything else' do + ['2.0', 'v2.0.1', '2.0.1.pre', '', nil].each do |bad| + expect { described_class.check_version!(bad) } + .to raise_error(Release::Error, /X\.Y\.Z/), bad.inspect + end + end + end + + describe '.stamp_changelog' do + let(:changelog) do + <<~MD + # Changelog + + ## [2.0.1] + + ### Fixed + + - Something. + + ## [2.0.0] - 2026-09-03 + MD + end + + it 'adds the date to the undated heading' do + out = described_class.stamp_changelog(changelog, '2.0.1', date) + + expect(out).to include("## [2.0.1] - 2026-09-07\n") + expect(out).to include("## [2.0.0] - 2026-09-03\n") + end + + it 'keeps a heading that already has a date' do + dated = changelog.sub('## [2.0.1]', '## [2.0.1] - 2026-09-01') + + expect(described_class.stamp_changelog(dated, '2.0.1', date)).to eq(dated) + end + + it 'raises when the version has no entry' do + expect { described_class.stamp_changelog(changelog, '2.0.2', date) } + .to raise_error(Release::Error, /no '## \[2\.0\.2\]' entry/) + end + end + + describe '.bump_version_file' do + let(:source) { "module AmazonSpClients\n VERSION = '2.0.0'.freeze\nend\n" } + + it 'replaces the constant and nothing else' do + expect(described_class.bump_version_file(source, '2.0.1')) + .to eq("module AmazonSpClients\n VERSION = '2.0.1'.freeze\nend\n") + end + + it 'raises when the constant is missing' do + expect { described_class.bump_version_file("module X\nend\n", '2.0.1') } + .to raise_error(Release::Error, /VERSION/) + end + end +end diff --git a/tasks/release.rb b/tasks/release.rb new file mode 100644 index 0000000..20b9509 --- /dev/null +++ b/tasks/release.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +require 'bundler' +require 'date' +require 'open3' + +# The laptop half of a release: version constant, CHANGELOG date, +# lockfiles, commit and tag. The push, and the gem push that tag +# triggers in CI, stay manual; see README, "Releasing". +# +# check! -> spec suite (Rakefile) -> write_files -> commit_and_tag +# +# Everything that can refuse does so before the first write, so a +# refused run leaves the tree as it found it. +module Release + # Any reason the release cannot go on; the rake task prints it and stops. + class Error < StandardError; end + + VERSION_PATTERN = /\A\d+\.\d+\.\d+\z/ + VERSION_FILE = 'lib/amazon_sp_clients/version.rb' + CHANGELOG_FILE = 'CHANGELOG.md' + # Every gemfile is relocked, or CI's frozen install fails. + GEMFILES = %w[Gemfile gemfiles/faraday_1.gemfile gemfiles/faraday_2.gemfile].freeze + LOCKFILES = GEMFILES.map { |gemfile| "#{gemfile}.lock" }.freeze + + module_function + + def check_version!(version) + return if version.to_s.match?(VERSION_PATTERN) + + raise Error, "version must look like X.Y.Z, got #{version.inspect}" + end + + # "## [2.0.1]" becomes "## [2.0.1] - 2026-09-07". A heading that + # already carries a date is left alone. + def stamp_changelog(text, version, date) + heading = "## [#{version}]" + return text if text.match?(/^#{Regexp.escape(heading)} - \d{4}-\d{2}-\d{2}$/) + + undated = /^#{Regexp.escape(heading)}$/ + raise Error, "#{CHANGELOG_FILE} has no '#{heading}' entry" unless text.match?(undated) + + text.sub(undated, "#{heading} - #{date.iso8601}") + end + + def bump_version_file(text, version) + constant = /VERSION = '[^']*'/ + raise Error, "#{VERSION_FILE} has no VERSION constant" unless text.match?(constant) + + text.sub(constant, "VERSION = '#{version}'") + end + + # The steps that touch git, files and bundler, in the order the + # Rakefile calls them. + class Preparer + def initialize(version, root: Dir.pwd, today: Date.today) + Release.check_version!(version) + + @version = version + @root = root + @today = today + end + + def tag + "v#{@version}" + end + + # Refuses before anything is written. Untracked files are fine; + # only the files below end up in the commit. + def check! + raise Error, 'HEAD is detached; check out a branch first' if branch.nil? + + dirty = git('status', '--porcelain', '--untracked-files=no') + raise Error, "the tree has uncommitted changes:\n#{dirty}" unless dirty.empty? + raise Error, "tag #{tag} already exists" if tag? + + Release.stamp_changelog(read(CHANGELOG_FILE), @version, @today) + end + + def write_files + write(VERSION_FILE, Release.bump_version_file(read(VERSION_FILE), @version)) + write(CHANGELOG_FILE, Release.stamp_changelog(read(CHANGELOG_FILE), @version, @today)) + GEMFILES.each { |gemfile| relock(gemfile) } + end + + def commit_and_tag + git('add', '--', VERSION_FILE, CHANGELOG_FILE, *LOCKFILES) + git('commit', '--quiet', '--message', "Release #{@version}") + git('tag', '--annotate', '--message', tag, tag) + end + + def push_command + "git push origin #{branch} #{tag}" + end + + private + + def branch + out, status = Open3.capture2('git', 'symbolic-ref', '--quiet', '--short', 'HEAD', + chdir: @root) + status.success? ? out.strip : nil + end + + def tag? + _out, status = Open3.capture2('git', 'rev-parse', '--quiet', '--verify', "refs/tags/#{tag}", + chdir: @root) + status.success? + end + + # `bundle exec` leaves its own bundle in the environment; the child + # must see only the gemfile it locks. + def relock(gemfile) + env = { 'BUNDLE_GEMFILE' => File.join(@root, gemfile) } + Bundler.with_unbundled_env do + out, status = Open3.capture2e(env, 'bundle', 'lock', '--local', chdir: @root) + raise Error, "bundle lock failed for #{gemfile}:\n#{out}" unless status.success? + end + end + + def git(*args) + out, status = Open3.capture2e('git', *args, chdir: @root) + raise Error, "git #{args.first} failed:\n#{out}" unless status.success? + + out.strip + end + + def read(path) + File.read(File.join(@root, path)) + end + + def write(path, text) + File.write(File.join(@root, path), text) + end + end +end From cb5632f3b9a9fb121710405476aa03f1360f10df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 18:58:15 +0200 Subject: [PATCH 76/83] Document the release task README, "Releasing" lists the three steps a release takes now; CLAUDE.md gets the command. --- CLAUDE.md | 15 +++++++++------ README.md | 25 +++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2cc66af..aa7ba24 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -105,6 +105,7 @@ bundle exec rake generate # regenerate vendor/ at the pinned SHA bundle exec rake generate:verify # regenerate + fail on drift (CI) bundle exec rake generate:update # advance the pin + regenerate bundle exec rake yard:verify # every public V2 object documented (CI) +bundle exec rake 'release:prepare[X.Y.Z]' # version, CHANGELOG date, locks, suite, commit, tag bin/console # irb with the gem loaded ``` @@ -115,9 +116,11 @@ advance the pin only in its own PR. ## Releases Published to rubygems.org by `.github/workflows/release.yml` when a -`v*` tag is pushed, through Trusted Publishing; steps in README, -"Releasing". `rake release` is disabled. Consumers still install the -gem from git master, so master takes 2.0.0 only after they move to the -versioned dependency. Bundler treats `amazon_sp_clients` (git) and -`sp_api_clients` as two gems that ship the same files, so a host drops -the git line in the same change that brings the new gem in. +`v*` tag is pushed, through Trusted Publishing. The local steps are +`rake release:prepare[X.Y.Z]`, which ends by printing the push command +(README, "Releasing"); the bundler `rake release` is disabled. +Consumers still install the gem from git master, so master takes 2.0.0 +only after they move to the versioned dependency. Bundler treats +`amazon_sp_clients` (git) and `sp_api_clients` as two gems that ship +the same files, so a host drops the git line in the same change that +brings the new gem in. diff --git a/README.md b/README.md index a9b292c..9b1280a 100644 --- a/README.md +++ b/README.md @@ -260,25 +260,26 @@ pending publisher expires when the first push does not follow soon (12 hours at the time of writing). After the first release the publisher belongs to the gem and stays. -1. Set `AmazonSpClients::VERSION` in `lib/amazon_sp_clients/version.rb`. -2. Re-lock all three lockfiles, or CI's frozen install fails: +1. Write the CHANGELOG entry under a `## [X.Y.Z]` heading. The task + adds the date. +2. Run the release task. It refuses a dirty tree, a bad version, an + existing tag or a missing CHANGELOG entry. Then it runs the suite, + sets `AmazonSpClients::VERSION`, relocks all three lockfiles (or + CI's frozen install fails), commits `Release X.Y.Z` and creates the + annotated tag `vX.Y.Z`. Nothing is pushed. ```sh - bundle lock --local - BUNDLE_GEMFILE=gemfiles/faraday_1.gemfile bundle lock --local - BUNDLE_GEMFILE=gemfiles/faraday_2.gemfile bundle lock --local + bundle exec rake 'release:prepare[X.Y.Z]' ``` -3. Give the CHANGELOG entry its release date: `## [X.Y.Z] - YYYY-MM-DD`. - The workflow stops when the version has no entry. -4. Commit, then push an annotated tag on that commit: +3. Push the branch and the tag. The task prints the exact command: ```sh - git tag -a vX.Y.Z -m 'vX.Y.Z' - git push origin vX.Y.Z + git push origin vX.Y.Z ``` The tag must be `v` plus the version, or the workflow stops before it builds. rubygems.org rejects a version it already has, so a failed -release needs a new version and a new tag, not a re-run. `rake release` -is disabled; it would tag and push from a laptop. +release needs a new version and a new tag, not a re-run. That is why +the task runs the suite before it tags. The bundler `rake release` is +disabled; it would push the gem from a laptop. From 5021942548c6fb7c2d250e0842c5d157ece4b442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 19:30:16 +0200 Subject: [PATCH 77/83] Add the 2.0.1 CHANGELOG entry --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd3c500..35961c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,26 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. +## [2.0.1] + +### Added + +- `examples/auth_check.rb`, a standalone script that shows which + credentials SP-API accepts. It calls the Orders API with a made-up + token and with a real access token, then asks LWA for a refresh with + and without the app credentials, and prints what each answer means. + It depends on nothing but this gem, or on Net::HTTP when the gem is + not in the bundle. `examples/` is not part of the built gem. +- `rake release:prepare[X.Y.Z]` prepares a release on a laptop: it + runs the suite, sets the version, dates the CHANGELOG entry, relocks + the lockfiles, commits and tags. Pushing the tag still publishes. + +### Changed + +- The README and the spec comments no longer name any particular + consumer of the gem. `lib/` and `vendor/` are unchanged; for a + consumer, 2.0.1 is 2.0.0 with a new README. + ## [2.0.0] - 2026-09-03 ### Added From ed10a8963386c58126e408bdb45672a74eb8a555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 19:31:28 +0200 Subject: [PATCH 78/83] Release 2.0.1 --- CHANGELOG.md | 2 +- Gemfile.lock | 2 +- gemfiles/faraday_1.gemfile.lock | 4 ++-- gemfiles/faraday_2.gemfile.lock | 4 ++-- lib/amazon_sp_clients/version.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35961c4..1585d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. -## [2.0.1] +## [2.0.1] - 2026-09-07 ### Added diff --git a/Gemfile.lock b/Gemfile.lock index e56ec1a..c687d1f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - sp_api_clients (2.0.0) + sp_api_clients (2.0.1) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index 9c27097..952efb1 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - sp_api_clients (2.0.0) + sp_api_clients (2.0.1) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -163,7 +163,7 @@ CHECKSUMS rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef - sp_api_clients (2.0.0) + sp_api_clients (2.0.1) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index e40cdc1..b41cd23 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - sp_api_clients (2.0.0) + sp_api_clients (2.0.1) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -145,7 +145,7 @@ CHECKSUMS rubocop (1.90.0) sha256=9eb4c065b5c5154e4ef554c547972f3905a9eb6b53e657e580b6796b54bf8242 rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 - sp_api_clients (2.0.0) + sp_api_clients (2.0.1) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/lib/amazon_sp_clients/version.rb b/lib/amazon_sp_clients/version.rb index 332c284..ae1a239 100644 --- a/lib/amazon_sp_clients/version.rb +++ b/lib/amazon_sp_clients/version.rb @@ -1,3 +1,3 @@ module AmazonSpClients - VERSION = '2.0.0'.freeze + VERSION = '2.0.1'.freeze end From 951ff1d2d4774cbd3dd5609041d5174729748035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:08:18 +0200 Subject: [PATCH 79/83] Advance the Amazon models pin to 2026-08-26 The Orders API v2026-01-01 model exists only upstream, so the pin moves from 3822f16 (2025-02-26) to 3659f96 (2026-08-26) before that module can be added. Regeneration changes 16 files, all of it description text except one new optional query parameter, enableContentEncodingUrlHeader, on getFeedDocument and getReportDocument. Upstream now marks every Orders v0 operation as deprecated. --- lib/amazon_sp_clients/v2/apis/feeds_2021.rb | 15 ++-- .../v2/apis/fulfillment_outbound_2020.rb | 20 ++--- .../v2/apis/listings_items_2021.rb | 44 +++++----- lib/amazon_sp_clients/v2/apis/orders_v0.rb | 34 ++++---- lib/amazon_sp_clients/v2/apis/reports_2021.rb | 9 +- .../v2/apis/vendor_orders.rb | 2 +- .../v2/apis/vendors_shipments.rb | 4 +- selling-partner-api-models.sha | 2 +- .../lib/sp_feeds_2021/api/feeds_api.rb | 15 ++-- .../api/fba_outbound_api.rb | 40 ++++----- .../lib/sp_listings_items_2021.rb | 2 +- .../api/listings_api.rb | 86 +++++++++---------- .../lib/sp_orders_v0/api/orders_v0_api.rb | 64 +++++++------- .../lib/sp_orders_v0/api/shipment_api.rb | 4 +- .../lib/sp_reports_2021/api/reports_api.rb | 3 + .../sp_vendor_orders/api/vendor_orders_api.rb | 4 +- .../api/vendor_shipping_api.rb | 8 +- 17 files changed, 186 insertions(+), 170 deletions(-) diff --git a/lib/amazon_sp_clients/v2/apis/feeds_2021.rb b/lib/amazon_sp_clients/v2/apis/feeds_2021.rb index a6d4bfa..0c398d4 100644 --- a/lib/amazon_sp_clients/v2/apis/feeds_2021.rb +++ b/lib/amazon_sp_clients/v2/apis/feeds_2021.rb @@ -12,7 +12,7 @@ module V2 # # OpenAPI spec version: 2021-06-30 class Feeds2021 < Api - # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/reference/getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/reference/getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller ID. # @param rdt [Array, nil] send a restricted data token for these resources @@ -21,7 +21,7 @@ def cancel_feed(feed_id, rdt: nil) request(:delete, "/feeds/2021-06-30/feeds/#{encode(feed_id)}", rdt: rdt) end - # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#post-feeds2021-06-30feeds) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). + # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). # # @param body [Hash] Information required to create the feed. (CreateFeedSpecification) # @param rdt [Array, nil] send a restricted data token for these resources @@ -30,7 +30,7 @@ def create_feed(body, rdt: nil) request(:post, '/feeds/2021-06-30/feeds', body: body, rdt: rdt) end - # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param body [Hash] Specifies the content type for the createFeedDocument operation. (CreateFeedDocumentSpecification) # @param rdt [Array, nil] send a restricted data token for these resources @@ -51,10 +51,15 @@ def get_feed(feed_id, rdt: nil) # Returns the information required for retrieving a feed document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param feed_document_id [String] The identifier of the feed document. + # @param enable_content_encoding_url_header [Boolean, nil] When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] - def get_feed_document(feed_document_id, rdt: nil) - request(:get, "/feeds/2021-06-30/documents/#{encode(feed_document_id)}", rdt: rdt) + def get_feed_document(feed_document_id, enable_content_encoding_url_header: nil, rdt: nil) + query = { + 'enableContentEncodingUrlHeader' => enable_content_encoding_url_header + } + + request(:get, "/feeds/2021-06-30/documents/#{encode(feed_document_id)}", query: query, rdt: rdt) end # Returns feed details for the feeds that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). diff --git a/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb b/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb index f1468c4..07d14ec 100644 --- a/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb +++ b/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb @@ -32,8 +32,8 @@ def create_fulfillment_order(body, rdt: nil) # Creates a fulfillment return. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param body [Hash] CreateFulfillmentReturnRequest parameter (CreateFulfillmentReturnRequest) - # @param seller_fulfillment_order_id [String] An identifier assigned by the seller to the fulfillment order at the time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value based on the buyer's request to return items. + # @param body [Hash] The request body of the `createFulfillmentReturn` operation. (CreateFulfillmentReturnRequest) + # @param seller_fulfillment_order_id [String] An identifier the seller assigns to the fulfillment order at the time it was created. The seller uses their own records to find the correct `sellerFulfillmentOrderId` value based on the buyer's request to return items. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def create_fulfillment_return(body, seller_fulfillment_order_id, rdt: nil) @@ -49,12 +49,12 @@ def delivery_offers(body, rdt: nil) request(:post, '/fba/outbound/2020-07-01/deliveryOffers', body: body, rdt: rdt) end - # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).. + # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param marketplace_id [String] The marketplace for which to return a list of the inventory that is eligible for the specified feature. # @param feature_name [String] The name of the feature for which to return a list of eligible inventory. - # @param next_token [String, nil] A string token returned in the response to your previous request that is used to return the next response page. A value of null will return the first page. - # @param query_start_date [String, nil] A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format yyyy-MM-ddTHH:mm:ss.sssZ + # @param next_token [String, nil] A string token returned in the response to your previous request that is used to return the next response page. A value of `null` will return the first page. + # @param query_start_date [String, nil] A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format `yyyy-MM-ddTHH:mm:ss.sssZ` # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil, rdt: nil) @@ -67,11 +67,11 @@ def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_s request(:get, "/fba/outbound/2020-07-01/features/inventory/#{encode(feature_name)}", query: query, rdt: rdt) end - # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified feature. Note that if the sellerSKU isn't eligible, the response will contain an empty skuInfo object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the number of items with the `sellerSku` you specify that can have orders fulfilled using the specified feature. Note that if the `sellerSku` isn't eligible, the response will contain an empty `skuInfo` object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param marketplace_id [String] The marketplace for which to return the count. # @param feature_name [String] The name of the feature. - # @param seller_sku [String] Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's `SellerId`, which is included with every operation that you submit. + # @param seller_sku [String] Used to identify an item in the given marketplace. `sellerSku` is qualified by the seller's `sellerId`, which is included with every operation that you submit. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_feature_sku(marketplace_id, feature_name, seller_sku, rdt: nil) @@ -115,7 +115,7 @@ def get_fulfillment_preview(body, rdt: nil) # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param package_number [Integer] The unencrypted package identifier returned by the `getFulfillmentOrder` operation. + # @param package_number [Integer] The unencrypted package identifier. You can obtain this value from the `getFulfillmentOrder` operation. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_package_tracking_details(package_number, rdt: nil) @@ -126,7 +126,7 @@ def get_package_tracking_details(package_number, rdt: nil) request(:get, '/fba/outbound/2020-07-01/tracking', query: query, rdt: rdt) end - # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next token parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) + # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the `nextToken` parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) # # @param query_start_date [String, nil] A date used to select fulfillment orders that were last updated after (or at) a specified time. An update is defined as any change in fulfillment order status, including the creation of a new fulfillment order. # @param next_token [String, nil] A string token returned in the response to your previous request. @@ -172,7 +172,7 @@ def submit_fulfillment_order_status_update(body, seller_fulfillment_order_id, rd # Updates and/or requests shipment for a fulfillment order with an order hold on it. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param body [Hash] UpdateFulfillmentOrderRequest parameter (UpdateFulfillmentOrderRequest) + # @param body [Hash] The request body of the `updateFulfillmentOrder` operation. (UpdateFulfillmentOrderRequest) # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the fulfillment order was created. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] diff --git a/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb b/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb index 71c6a26..2d80b75 100644 --- a/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb +++ b/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb @@ -8,16 +8,16 @@ module AmazonSpClients module V2 # Selling Partner API for Listings Items # - # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). + # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you can use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, refer to the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). # # OpenAPI spec version: 2021-08-01 class ListingsItems2021 < Api - # Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Delete a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. - # @param sku [String] A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. - # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param sku [String] A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids [Array] A comma-delimited list of Amazon store identifiers for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rdt: nil) @@ -29,12 +29,12 @@ def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rdt request(:delete, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, rdt: rdt) end - # Returns details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns details about a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. - # @param sku [String] A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. - # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param sku [String] A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids [Array] A comma-delimited list of Amazon store identifiers for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `summaries`. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] @@ -48,15 +48,15 @@ def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, includ request(:get, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, rdt: rdt) end - # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # # @param body [Hash] The request body schema for the `patchListingsItem` operation. (ListingsItemPatchRequest) - # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids [Array] A comma-delimited list of Amazon store identifiers for the request. # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. - # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param sku [String] A selling partner-provided identifier for an Amazon listing. # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `issues`. - # @param mode [String, nil] The mode of operation for the request. - # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param mode [String, nil] Describes the mode of operation for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def patch_listings_item(body, marketplace_ids, seller_id, sku, included_data: nil, mode: nil, issue_locale: nil, rdt: nil) @@ -70,15 +70,15 @@ def patch_listings_item(body, marketplace_ids, seller_id, sku, included_data: ni request(:patch, "/listings/2021-08-01/items/#{encode(seller_id)}/#{encode(sku)}", query: query, body: body, rdt: rdt) end - # Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a new or fully-updates an existing listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # # @param body [Hash] The request body schema for the `putListingsItem` operation. (ListingsItemPutRequest) - # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids [Array] A comma-delimited list of Amazon store identifiers for the request. # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. - # @param sku [String] A selling partner provided identifier for an Amazon listing. + # @param sku [String] A selling partner-provided identifier for an Amazon listing. # @param included_data [Array, nil] A comma-delimited list of data sets to include in the response. Default: `issues`. - # @param mode [String, nil] The mode of operation for the request. - # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @param mode [String, nil] Describes the mode of operation for the request. + # @param issue_locale [String, nil] A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def put_listings_item(body, marketplace_ids, seller_id, sku, included_data: nil, mode: nil, issue_locale: nil, rdt: nil) @@ -95,9 +95,9 @@ def put_listings_item(body, marketplace_ids, seller_id, sku, included_data: nil, # Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code. - # @param marketplace_ids [Array] A comma-delimited list of Amazon marketplace identifiers for the request. - # @param issue_locale [String, nil] A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". When a localization is not available in the specified locale, localized messages default to "en_US". - # @param included_data [Array, nil] A comma-delimited list of datasets that you want to include in the response. Default: `summaries`. + # @param marketplace_ids [Array] A comma-delimited list of Amazon store identifiers for the request. + # @param issue_locale [String, nil] A locale that is used to localize issues. When not provided, the default language code of the first Amazon store is used. Examples: "en_US", "fr_CA", "fr_FR". When a localization is not available in the specified locale, localized messages default to "en_US". + # @param included_data [Array, nil] A comma-delimited list of data sets that you want to include in the response. Default: `summaries`. # @param identifiers [Array, nil] A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`. # @param identifiers_type [String, nil] A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided. # @param variation_parent_sku [String, nil] Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request. diff --git a/lib/amazon_sp_clients/v2/apis/orders_v0.rb b/lib/amazon_sp_clients/v2/apis/orders_v0.rb index 3e46b5f..39275d2 100644 --- a/lib/amazon_sp_clients/v2/apis/orders_v0.rb +++ b/lib/amazon_sp_clients/v2/apis/orders_v0.rb @@ -12,7 +12,7 @@ module V2 # # OpenAPI spec version: v0 class OrdersV0 < Api - # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param body [Hash] Request body of `confirmShipment`. (ConfirmShipmentRequest) # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. @@ -22,7 +22,7 @@ def confirm_shipment(body, order_id, rdt: nil) request(:post, "/orders/v0/orders/#{encode(order_id)}/shipmentConfirmation", body: body, rdt: rdt) end - # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. # @param rdt [Array, nil] send a restricted data token for these resources @@ -31,25 +31,25 @@ def get_order(order_id, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}", rdt: rdt) end - # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # @param order_id [String] The Amazon order identifier in 3-7-7 format. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_order_address(order_id, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}/address", rdt: rdt) end - # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # @param order_id [String] The Amazon order identifier in 3-7-7 format. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_order_buyer_info(order_id, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}/buyerInfo", rdt: rdt) end - # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. # @param next_token [String, nil] A string token returned in the response of your previous request. @@ -63,7 +63,7 @@ def get_order_items(order_id, next_token: nil, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}/orderItems", query: query, rdt: rdt) end - # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. # @param next_token [String, nil] A string token returned in the response of your previous request. @@ -77,16 +77,16 @@ def get_order_items_buyer_info(order_id, next_token: nil, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}/orderItems/buyerInfo", query: query, rdt: rdt) end - # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # - # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param order_id [String] The Amazon order identifier in 3-7-7 format. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def get_order_regulated_info(order_id, rdt: nil) request(:get, "/orders/v0/orders/#{encode(order_id)}/regulatedInfo", rdt: rdt) end - # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param marketplace_ids [Array] A list of `MarketplaceId` values. Used to select orders that were placed in the specified marketplaces. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. # @param created_after [String, nil] Use this date to select orders created after (or at) a specified time. Only orders placed after the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and `LastUpdatedBefore` cannot be set when `CreatedAfter` is set. @@ -97,7 +97,7 @@ def get_order_regulated_info(order_id, rdt: nil) # @param fulfillment_channels [Array, nil] A list that indicates how an order was fulfilled. Filters the results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller). # @param payment_methods [Array, nil] A list of payment method values. Use this field to select orders that were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS` (convenience store), `Other` (Any payment method other than COD or CVS). # @param buyer_email [String, nil] The email address of a buyer. Used to select orders that contain the specified email address. - # @param seller_order_id [String, nil] An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified. + # @param seller_order_id [String, nil] An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, `LastUpdatedBefore`, and `BuyerEmail` cannot be specified. # @param max_results_per_page [Integer, nil] A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. # @param easy_ship_shipment_statuses [Array, nil] A list of `EasyShipShipmentStatus` values. Used to select Easy Ship orders with statuses that match the specified values. If `EasyShipShipmentStatus` is specified, only Amazon Easy Ship orders are returned. **Possible values:** - `PendingSchedule` (The package is awaiting the schedule for pick-up.) - `PendingPickUp` (Amazon has not yet picked up the package from the seller.) - `PendingDropOff` (The seller will deliver the package to the carrier.) - `LabelCanceled` (The seller canceled the pickup.) - `PickedUp` (Amazon has picked up the package from the seller.) - `DroppedOff` (The package is delivered to the carrier by the seller.) - `AtOriginFC` (The packaged is at the origin fulfillment center.) - `AtDestinationFC` (The package is at the destination fulfillment center.) - `Delivered` (The package has been delivered.) - `RejectedByBuyer` (The package has been rejected by the buyer.) - `Undeliverable` (The package cannot be delivered.) - `ReturningToSeller` (The package was not delivered and is being returned to the seller.) - `ReturnedToSeller` (The package was not delivered and was returned to the seller.) - `Lost` (The package is lost.) - `OutForDelivery` (The package is out for delivery.) - `Damaged` (The package was damaged by the carrier.) # @param electronic_invoice_statuses [Array, nil] A list of `ElectronicInvoiceStatus` values. Used to select orders with electronic invoice statuses that match the specified values. **Possible values:** - `NotRequired` (Electronic invoice submission is not required for this order.) - `NotFound` (The electronic invoice was not submitted for this order.) - `Processing` (The electronic invoice is being processed for this order.) - `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last submitted electronic invoice was submitted and accepted.) @@ -106,8 +106,8 @@ def get_order_regulated_info(order_id, rdt: nil) # @param actual_fulfillment_supply_source_id [String, nil] The `sourceId` of the location from where you want the order fulfilled. # @param is_ispu [Boolean, nil] When true, this order is marked to be picked up from a store rather than delivered. # @param store_chain_store_id [String, nil] The store chain store identifier. Linked to a specific store in a store chain. - # @param earliest_delivery_date_before [String, nil] Use this date to select orders with a earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - # @param earliest_delivery_date_after [String, nil] Use this date to select orders with a earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param earliest_delivery_date_before [String, nil] Use this date to select orders with an earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @param earliest_delivery_date_after [String, nil] Use this date to select orders with an earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @param latest_delivery_date_before [String, nil] Use this date to select orders with a latest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @param latest_delivery_date_after [String, nil] Use this date to select orders with a latest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @param rdt [Array, nil] send a restricted data token for these resources @@ -141,7 +141,7 @@ def get_orders(marketplace_ids, created_after: nil, created_before: nil, last_up request(:get, '/orders/v0/orders', query: query, rdt: rdt) end - # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param body [Hash] The request body for the `updateShipmentStatus` operation. (UpdateShipmentStatusRequest) # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. @@ -151,10 +151,10 @@ def update_shipment_status(body, order_id, rdt: nil) request(:post, "/orders/v0/orders/#{encode(order_id)}/shipment", body: body, rdt: rdt) end - # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param body [Hash] The request body for the `updateVerificationStatus` operation. (UpdateVerificationStatusRequest) - # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format. + # @param order_id [String] The Amazon order identifier in 3-7-7 format. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] def update_verification_status(body, order_id, rdt: nil) diff --git a/lib/amazon_sp_clients/v2/apis/reports_2021.rb b/lib/amazon_sp_clients/v2/apis/reports_2021.rb index d32968e..c0fbbc2 100644 --- a/lib/amazon_sp_clients/v2/apis/reports_2021.rb +++ b/lib/amazon_sp_clients/v2/apis/reports_2021.rb @@ -60,10 +60,15 @@ def get_report(report_id, rdt: nil) # Returns the information required for retrieving a report document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param report_document_id [String] The identifier for the report document. + # @param enable_content_encoding_url_header [Boolean, nil] When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @param rdt [Array, nil] send a restricted data token for these resources # @return [AmazonSpClients::ApiResponse] - def get_report_document(report_document_id, rdt: nil) - request(:get, "/reports/2021-06-30/documents/#{encode(report_document_id)}", rdt: rdt) + def get_report_document(report_document_id, enable_content_encoding_url_header: nil, rdt: nil) + query = { + 'enableContentEncodingUrlHeader' => enable_content_encoding_url_header + } + + request(:get, "/reports/2021-06-30/documents/#{encode(report_document_id)}", query: query, rdt: rdt) end # Returns report schedule details for the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). diff --git a/lib/amazon_sp_clients/v2/apis/vendor_orders.rb b/lib/amazon_sp_clients/v2/apis/vendor_orders.rb index d802200..97ab9a7 100644 --- a/lib/amazon_sp_clients/v2/apis/vendor_orders.rb +++ b/lib/amazon_sp_clients/v2/apis/vendor_orders.rb @@ -21,7 +21,7 @@ def get_purchase_order(purchase_order_number, rdt: nil) request(:get, "/vendor/orders/v1/purchaseOrders/#{encode(purchase_order_number)}", rdt: rdt) end - # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range must not exceed 7 days and is available to pull data from the past 6 months. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # # @param limit [Integer, nil] The limit to the number of records returned. Default value is 100 records. # @param created_after [String, nil] Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format. diff --git a/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb b/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb index 30976db..7e19846 100644 --- a/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb +++ b/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb @@ -26,7 +26,7 @@ class VendorsShipments < Api # @param shipped_before [String, nil] Get Shipment Details by passing Shipped Date Before. Must be in ISO 8601 format. # @param shipped_after [String, nil] Get Shipment Details by passing Shipped Date After. Must be in ISO 8601 format. # @param estimated_delivery_before [String, nil] Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. - # @param estimated_delivery_after [String, nil] Get Shipment Details by passing Estimated Delivery Date Before. Must be in ISO 8601 format. + # @param estimated_delivery_after [String, nil] Get Shipment Details by passing Estimated Delivery Date After. Must be in ISO 8601 format. # @param shipment_delivery_before [String, nil] Get Shipment Details by passing Shipment Delivery Date Before. Must be in ISO 8601 format. # @param shipment_delivery_after [String, nil] Get Shipment Details by passing Shipment Delivery Date After. Must be in ISO 8601 format. # @param requested_pick_up_before [String, nil] Get Shipment Details by passing Before Requested pickup date. Must be in ISO 8601 format. @@ -75,7 +75,7 @@ def get_shipment_details(limit: nil, sort_order: nil, next_token: nil, created_a # # @param limit [Integer, nil] The limit to the number of records returned. Default value is 50 records. # @param sort_order [String, nil] Sort the list by shipment label creation date in ascending or descending order. - # @param next_token [String, nil] A token that is used to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. + # @param next_token [String, nil] A token that you use to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. # @param label_created_after [String, nil] Shipment labels created after this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @param label_created_before [String, nil] Shipment labels created before this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @param buyer_reference_number [String, nil] Get Shipment labels by passing buyer reference number. diff --git a/selling-partner-api-models.sha b/selling-partner-api-models.sha index db0c3a2..cbb9f4b 100644 --- a/selling-partner-api-models.sha +++ b/selling-partner-api-models.sha @@ -1 +1 @@ -3822f167b9625e0a12a3f3794a77ede7bb507cac +3659f96867bfc669aca7a524c2f95744ff0e4478 diff --git a/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb b/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb index ba08cf1..04edbec 100644 --- a/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb +++ b/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb @@ -16,7 +16,7 @@ class FeedsApi def initialize(session) @api_client = AmazonSpClients::ApiClient.new(session) end - # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/reference/getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/reference/getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param feed_id The identifier for the feed. This identifier is unique only in combination with a seller ID. # @param [Hash] opts the optional parameters # @return [nil] @@ -25,7 +25,7 @@ def cancel_feed(feed_id, opts = {}) return nil end - # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds are returned in subsequent calls to the [`getFeed`](https://developer-docs.amazon.com/sp-api/reference/getfeed) and [`getFeeds`](https://developer-docs.amazon.com/sp-api/reference/getfeeds) operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param feed_id The identifier for the feed. This identifier is unique only in combination with a seller ID. # @param [Hash] opts the optional parameters # @return [Array<(nil)>] nil, response status code and response headers @@ -70,7 +70,7 @@ def cancel_feed_with_http_info(feed_id, opts = {}) end return data end - # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#post-feeds2021-06-30feeds) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). + # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). # @param body Information required to create the feed. # @param [Hash] opts the optional parameters # @return [CreateFeedResponse] @@ -79,7 +79,7 @@ def create_feed(body, opts = {}) return data end - # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#post-feeds2021-06-30feeds) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). + # Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). The rate limit for the [`JSON_LISTINGS_FEED`](https://developer-docs.amazon.com/sp-api/docs/listings-feed-type-values#listings-feed) feed type differs from the rate limit for the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. For more information, refer to the [Building Listings Management Workflows Guide](https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#should-i-submit-in-bulk-using-the-json_listings_feed-or-individually-with-the-listings-items-api). # @param body Information required to create the feed. # @param [Hash] opts the optional parameters # @return [Array<(CreateFeedResponse)>] CreateFeedResponse data, response status code and response headers @@ -126,7 +126,7 @@ def create_feed_with_http_info(body, opts = {}) end return data end - # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body Specifies the content type for the createFeedDocument operation. # @param [Hash] opts the optional parameters # @return [CreateFeedDocumentResponse] @@ -135,7 +135,7 @@ def create_feed_document(body, opts = {}) return data end - # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a `feedDocumentId` value that you can pass in with a subsequent call to the [`createFeed`](https://developer-docs.amazon.com/sp-api/reference/createfeed) operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body Specifies the content type for the createFeedDocument operation. # @param [Hash] opts the optional parameters # @return [Array<(CreateFeedDocumentResponse)>] CreateFeedDocumentResponse data, response status code and response headers @@ -239,6 +239,7 @@ def get_feed_with_http_info(feed_id, opts = {}) # Returns the information required for retrieving a feed document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param feed_document_id The identifier of the feed document. # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :enable_content_encoding_url_header When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @return [FeedDocument] def get_feed_document(feed_document_id, opts = {}) data = get_feed_document_with_http_info(feed_document_id, opts) @@ -248,6 +249,7 @@ def get_feed_document(feed_document_id, opts = {}) # Returns the information required for retrieving a feed document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param feed_document_id The identifier of the feed document. # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :enable_content_encoding_url_header When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @return [Array<(FeedDocument)>] FeedDocument data, response status code and response headers def get_feed_document_with_http_info(feed_document_id, opts = {}) if @api_client.config.debugging @@ -262,6 +264,7 @@ def get_feed_document_with_http_info(feed_document_id, opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:'enableContentEncodingUrlHeader'] = opts[:'enable_content_encoding_url_header'] if !opts[:'enable_content_encoding_url_header'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb index e0f6f95..873bfe2 100644 --- a/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb +++ b/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb @@ -127,8 +127,8 @@ def create_fulfillment_order_with_http_info(body, opts = {}) return data end # Creates a fulfillment return. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body CreateFulfillmentReturnRequest parameter - # @param seller_fulfillment_order_id An identifier assigned by the seller to the fulfillment order at the time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value based on the buyer's request to return items. + # @param body The request body of the `createFulfillmentReturn` operation. + # @param seller_fulfillment_order_id An identifier the seller assigns to the fulfillment order at the time it was created. The seller uses their own records to find the correct `sellerFulfillmentOrderId` value based on the buyer's request to return items. # @param [Hash] opts the optional parameters # @return [CreateFulfillmentReturnResponse] def create_fulfillment_return(body, seller_fulfillment_order_id, opts = {}) @@ -137,8 +137,8 @@ def create_fulfillment_return(body, seller_fulfillment_order_id, opts = {}) end # Creates a fulfillment return. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body CreateFulfillmentReturnRequest parameter - # @param seller_fulfillment_order_id An identifier assigned by the seller to the fulfillment order at the time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value based on the buyer's request to return items. + # @param body The request body of the `createFulfillmentReturn` operation. + # @param seller_fulfillment_order_id An identifier the seller assigns to the fulfillment order at the time it was created. The seller uses their own records to find the correct `sellerFulfillmentOrderId` value based on the buyer's request to return items. # @param [Hash] opts the optional parameters # @return [Array<(CreateFulfillmentReturnResponse)>] CreateFulfillmentReturnResponse data, response status code and response headers def create_fulfillment_return_with_http_info(body, seller_fulfillment_order_id, opts = {}) @@ -244,24 +244,24 @@ def delivery_offers_with_http_info(body, opts = {}) end return data end - # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).. + # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_id The marketplace for which to return a list of the inventory that is eligible for the specified feature. # @param feature_name The name of the feature for which to return a list of eligible inventory. # @param [Hash] opts the optional parameters - # @option opts [String] :next_token A string token returned in the response to your previous request that is used to return the next response page. A value of null will return the first page. - # @option opts [DateTime] :query_start_date A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format yyyy-MM-ddTHH:mm:ss.sssZ + # @option opts [String] :next_token A string token returned in the response to your previous request that is used to return the next response page. A value of `null` will return the first page. + # @option opts [DateTime] :query_start_date A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format `yyyy-MM-ddTHH:mm:ss.sssZ` # @return [GetFeatureInventoryResponse] def get_feature_inventory(marketplace_id, feature_name, opts = {}) data = get_feature_inventory_with_http_info(marketplace_id, feature_name, opts) return data end - # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).. + # Returns a list of inventory items that are eligible for the fulfillment feature you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_id The marketplace for which to return a list of the inventory that is eligible for the specified feature. # @param feature_name The name of the feature for which to return a list of eligible inventory. # @param [Hash] opts the optional parameters - # @option opts [String] :next_token A string token returned in the response to your previous request that is used to return the next response page. A value of null will return the first page. - # @option opts [DateTime] :query_start_date A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format yyyy-MM-ddTHH:mm:ss.sssZ + # @option opts [String] :next_token A string token returned in the response to your previous request that is used to return the next response page. A value of `null` will return the first page. + # @option opts [DateTime] :query_start_date A date that you can use to select inventory that has been updated since a specified date. An update is defined as any change in feature-enabled inventory availability. The date must be in the format `yyyy-MM-ddTHH:mm:ss.sssZ` # @return [Array<(GetFeatureInventoryResponse)>] GetFeatureInventoryResponse data, response status code and response headers def get_feature_inventory_with_http_info(marketplace_id, feature_name, opts = {}) if @api_client.config.debugging @@ -311,10 +311,10 @@ def get_feature_inventory_with_http_info(marketplace_id, feature_name, opts = {} end return data end - # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified feature. Note that if the sellerSKU isn't eligible, the response will contain an empty skuInfo object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the number of items with the `sellerSku` you specify that can have orders fulfilled using the specified feature. Note that if the `sellerSku` isn't eligible, the response will contain an empty `skuInfo` object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_id The marketplace for which to return the count. # @param feature_name The name of the feature. - # @param seller_sku Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's `SellerId`, which is included with every operation that you submit. + # @param seller_sku Used to identify an item in the given marketplace. `sellerSku` is qualified by the seller's `sellerId`, which is included with every operation that you submit. # @param [Hash] opts the optional parameters # @return [GetFeatureSkuResponse] def get_feature_sku(marketplace_id, feature_name, seller_sku, opts = {}) @@ -322,10 +322,10 @@ def get_feature_sku(marketplace_id, feature_name, seller_sku, opts = {}) return data end - # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified feature. Note that if the sellerSKU isn't eligible, the response will contain an empty skuInfo object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the number of items with the `sellerSku` you specify that can have orders fulfilled using the specified feature. Note that if the `sellerSku` isn't eligible, the response will contain an empty `skuInfo` object. The parameters for this operation may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_id The marketplace for which to return the count. # @param feature_name The name of the feature. - # @param seller_sku Used to identify an item in the given marketplace. `SellerSKU` is qualified by the seller's `SellerId`, which is included with every operation that you submit. + # @param seller_sku Used to identify an item in the given marketplace. `sellerSku` is qualified by the seller's `sellerId`, which is included with every operation that you submit. # @param [Hash] opts the optional parameters # @return [Array<(GetFeatureSkuResponse)>] GetFeatureSkuResponse data, response status code and response headers def get_feature_sku_with_http_info(marketplace_id, feature_name, seller_sku, opts = {}) @@ -544,7 +544,7 @@ def get_fulfillment_preview_with_http_info(body, opts = {}) return data end # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param package_number The unencrypted package identifier returned by the `getFulfillmentOrder` operation. + # @param package_number The unencrypted package identifier. You can obtain this value from the `getFulfillmentOrder` operation. # @param [Hash] opts the optional parameters # @return [GetPackageTrackingDetailsResponse] def get_package_tracking_details(package_number, opts = {}) @@ -553,7 +553,7 @@ def get_package_tracking_details(package_number, opts = {}) end # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param package_number The unencrypted package identifier returned by the `getFulfillmentOrder` operation. + # @param package_number The unencrypted package identifier. You can obtain this value from the `getFulfillmentOrder` operation. # @param [Hash] opts the optional parameters # @return [Array<(GetPackageTrackingDetailsResponse)>] GetPackageTrackingDetailsResponse data, response status code and response headers def get_package_tracking_details_with_http_info(package_number, opts = {}) @@ -598,7 +598,7 @@ def get_package_tracking_details_with_http_info(package_number, opts = {}) end return data end - # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next token parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) + # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the `nextToken` parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) # @param [Hash] opts the optional parameters # @option opts [DateTime] :query_start_date A date used to select fulfillment orders that were last updated after (or at) a specified time. An update is defined as any change in fulfillment order status, including the creation of a new fulfillment order. # @option opts [String] :next_token A string token returned in the response to your previous request. @@ -608,7 +608,7 @@ def list_all_fulfillment_orders(opts = {}) return data end - # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next token parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) + # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the `nextToken` parameter. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) # @param [Hash] opts the optional parameters # @option opts [DateTime] :query_start_date A date used to select fulfillment orders that were last updated after (or at) a specified time. An update is defined as any change in fulfillment order status, including the creation of a new fulfillment order. # @option opts [String] :next_token A string token returned in the response to your previous request. @@ -779,7 +779,7 @@ def submit_fulfillment_order_status_update_with_http_info(body, seller_fulfillme return data end # Updates and/or requests shipment for a fulfillment order with an order hold on it. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body UpdateFulfillmentOrderRequest parameter + # @param body The request body of the `updateFulfillmentOrder` operation. # @param seller_fulfillment_order_id The identifier assigned to the item by the seller when the fulfillment order was created. # @param [Hash] opts the optional parameters # @return [UpdateFulfillmentOrderResponse] @@ -789,7 +789,7 @@ def update_fulfillment_order(body, seller_fulfillment_order_id, opts = {}) end # Updates and/or requests shipment for a fulfillment order with an order hold on it. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param body UpdateFulfillmentOrderRequest parameter + # @param body The request body of the `updateFulfillmentOrder` operation. # @param seller_fulfillment_order_id The identifier assigned to the item by the seller when the fulfillment order was created. # @param [Hash] opts the optional parameters # @return [Array<(UpdateFulfillmentOrderResponse)>] UpdateFulfillmentOrderResponse data, response status code and response headers diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021.rb index b477df9..0745530 100644 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021.rb +++ b/vendor/listings_items_2021/lib/sp_listings_items_2021.rb @@ -1,7 +1,7 @@ =begin #Selling Partner API for Listings Items -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). +#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you can use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, refer to the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). OpenAPI spec version: 2021-08-01 diff --git a/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb b/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb index ed82ac9..0dcb485 100644 --- a/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb +++ b/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb @@ -1,7 +1,7 @@ =begin #Selling Partner API for Listings Items -#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). +#The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you can use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, refer to the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide). OpenAPI spec version: 2021-08-01 @@ -16,24 +16,24 @@ class ListingsApi def initialize(session) @api_client = AmazonSpClients::ApiClient.new(session) end - # Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Delete a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param sku A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [ListingsItemSubmissionResponse] def delete_listings_item(seller_id, sku, marketplace_ids, opts = {}) data = delete_listings_item_with_http_info(seller_id, sku, marketplace_ids, opts) return data end - # Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Delete a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param sku A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [Array<(ListingsItemSubmissionResponse)>] ListingsItemSubmissionResponse data, response status code and response headers def delete_listings_item_with_http_info(seller_id, sku, marketplace_ids, opts = {}) if @api_client.config.debugging @@ -86,12 +86,12 @@ def delete_listings_item_with_http_info(seller_id, sku, marketplace_ids, opts = end return data end - # Returns details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns details about a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param sku A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `summaries`. # @return [Item] def get_listings_item(seller_id, sku, marketplace_ids, opts = {}) @@ -99,12 +99,12 @@ def get_listings_item(seller_id, sku, marketplace_ids, opts = {}) return data end - # Returns details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns details about a listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param sku A selling partner-provided identifier for an Amazon listing. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `summaries`. # @return [Array<(Item)>] Item data, response status code and response headers def get_listings_item_with_http_info(seller_id, sku, marketplace_ids, opts = {}) @@ -162,30 +162,30 @@ def get_listings_item_with_http_info(seller_id, sku, marketplace_ids, opts = {}) end return data end - # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param body The request body schema for the `patchListingsItem` operation. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. + # @param sku A selling partner-provided identifier for an Amazon listing. # @param [Hash] opts the optional parameters # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `issues`. - # @option opts [String] :mode The mode of operation for the request. - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :mode Describes the mode of operation for the request. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [ListingsItemSubmissionResponse] def patch_listings_item(body, marketplace_ids, seller_id, sku, opts = {}) data = patch_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, opts) return data end - # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param body The request body schema for the `patchListingsItem` operation. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. + # @param sku A selling partner-provided identifier for an Amazon listing. # @param [Hash] opts the optional parameters # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `issues`. - # @option opts [String] :mode The mode of operation for the request. - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :mode Describes the mode of operation for the request. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [Array<(ListingsItemSubmissionResponse)>] ListingsItemSubmissionResponse data, response status code and response headers def patch_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, opts = {}) if @api_client.config.debugging @@ -252,30 +252,30 @@ def patch_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, op end return data end - # Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a new or fully-updates an existing listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param body The request body schema for the `putListingsItem` operation. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. + # @param sku A selling partner-provided identifier for an Amazon listing. # @param [Hash] opts the optional parameters # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `issues`. - # @option opts [String] :mode The mode of operation for the request. - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :mode Describes the mode of operation for the request. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [ListingsItemSubmissionResponse] def put_listings_item(body, marketplace_ids, seller_id, sku, opts = {}) data = put_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, opts) return data end - # Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Creates a new or fully-updates an existing listings item for a selling partner. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. # @param body The request body schema for the `putListingsItem` operation. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param sku A selling partner provided identifier for an Amazon listing. + # @param sku A selling partner-provided identifier for an Amazon listing. # @param [Hash] opts the optional parameters # @option opts [Array] :included_data A comma-delimited list of data sets to include in the response. Default: `issues`. - # @option opts [String] :mode The mode of operation for the request. - # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale. + # @option opts [String] :mode Describes the mode of operation for the request. + # @option opts [String] :issue_locale A locale for localization of issues. When not provided, the default language code of the first Amazon store is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when localization is not available for the specified locale. # @return [Array<(ListingsItemSubmissionResponse)>] ListingsItemSubmissionResponse data, response status code and response headers def put_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, opts = {}) if @api_client.config.debugging @@ -344,10 +344,10 @@ def put_listings_item_with_http_info(body, marketplace_ids, seller_id, sku, opts end # Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\". - # @option opts [Array] :included_data A comma-delimited list of datasets that you want to include in the response. Default: `summaries`. + # @option opts [String] :issue_locale A locale that is used to localize issues. When not provided, the default language code of the first Amazon store is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\". + # @option opts [Array] :included_data A comma-delimited list of data sets that you want to include in the response. Default: `summaries`. # @option opts [Array] :identifiers A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`. # @option opts [String] :identifiers_type A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided. # @option opts [String] :variation_parent_sku Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request. @@ -371,10 +371,10 @@ def search_listings_items(seller_id, marketplace_ids, opts = {}) # Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param seller_id A selling partner identifier, such as a merchant account or vendor code. - # @param marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. + # @param marketplace_ids A comma-delimited list of Amazon store identifiers for the request. # @param [Hash] opts the optional parameters - # @option opts [String] :issue_locale A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\". - # @option opts [Array] :included_data A comma-delimited list of datasets that you want to include in the response. Default: `summaries`. + # @option opts [String] :issue_locale A locale that is used to localize issues. When not provided, the default language code of the first Amazon store is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\". + # @option opts [Array] :included_data A comma-delimited list of data sets that you want to include in the response. Default: `summaries`. # @option opts [Array] :identifiers A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`. # @option opts [String] :identifiers_type A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided. # @option opts [String] :variation_parent_sku Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request. diff --git a/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb b/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb index 55f6c17..317071b 100644 --- a/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb +++ b/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb @@ -16,7 +16,7 @@ class OrdersV0Api def initialize(session) @api_client = AmazonSpClients::ApiClient.new(session) end - # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body Request body of `confirmShipment`. # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters @@ -26,7 +26,7 @@ def confirm_shipment(body, order_id, opts = {}) return nil end - # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 10 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body Request body of `confirmShipment`. # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters @@ -78,7 +78,7 @@ def confirm_shipment_with_http_info(body, order_id, opts = {}) end return data end - # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [GetOrderResponse] @@ -87,7 +87,7 @@ def get_order(order_id, opts = {}) return data end - # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [Array<(GetOrderResponse)>] GetOrderResponse data, response status code and response headers @@ -132,8 +132,8 @@ def get_order_with_http_info(order_id, opts = {}) end return data end - # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [GetOrderAddressResponse] def get_order_address(order_id, opts = {}) @@ -141,8 +141,8 @@ def get_order_address(order_id, opts = {}) return data end - # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [Array<(GetOrderAddressResponse)>] GetOrderAddressResponse data, response status code and response headers def get_order_address_with_http_info(order_id, opts = {}) @@ -186,8 +186,8 @@ def get_order_address_with_http_info(order_id, opts = {}) end return data end - # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [GetOrderBuyerInfoResponse] def get_order_buyer_info(order_id, opts = {}) @@ -195,8 +195,8 @@ def get_order_buyer_info(order_id, opts = {}) return data end - # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An `orderId` is an Amazon-defined order identifier, in 3-7-7 format. + # Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [Array<(GetOrderBuyerInfoResponse)>] GetOrderBuyerInfoResponse data, response status code and response headers def get_order_buyer_info_with_http_info(order_id, opts = {}) @@ -240,7 +240,7 @@ def get_order_buyer_info_with_http_info(order_id, opts = {}) end return data end - # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @option opts [String] :next_token A string token returned in the response of your previous request. @@ -250,7 +250,7 @@ def get_order_items(order_id, opts = {}) return data end - # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @option opts [String] :next_token A string token returned in the response of your previous request. @@ -297,7 +297,7 @@ def get_order_items_with_http_info(order_id, opts = {}) end return data end - # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @option opts [String] :next_token A string token returned in the response of your previous request. @@ -307,7 +307,7 @@ def get_order_items_buyer_info(order_id, opts = {}) return data end - # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters # @option opts [String] :next_token A string token returned in the response of your previous request. @@ -354,8 +354,8 @@ def get_order_items_buyer_info_with_http_info(order_id, opts = {}) end return data end - # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An Amazon-defined order identifier, in 3-7-7 format. + # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [GetOrderRegulatedInfoResponse] def get_order_regulated_info(order_id, opts = {}) @@ -363,8 +363,8 @@ def get_order_regulated_info(order_id, opts = {}) return data end - # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). - # @param order_id An Amazon-defined order identifier, in 3-7-7 format. + # Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [Array<(GetOrderRegulatedInfoResponse)>] GetOrderRegulatedInfoResponse data, response status code and response headers def get_order_regulated_info_with_http_info(order_id, opts = {}) @@ -408,7 +408,7 @@ def get_order_regulated_info_with_http_info(order_id, opts = {}) end return data end - # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_ids A list of `MarketplaceId` values. Used to select orders that were placed in the specified marketplaces. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. # @param [Hash] opts the optional parameters # @option opts [String] :created_after Use this date to select orders created after (or at) a specified time. Only orders placed after the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and `LastUpdatedBefore` cannot be set when `CreatedAfter` is set. @@ -419,7 +419,7 @@ def get_order_regulated_info_with_http_info(order_id, opts = {}) # @option opts [Array] :fulfillment_channels A list that indicates how an order was fulfilled. Filters the results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller). # @option opts [Array] :payment_methods A list of payment method values. Use this field to select orders that were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS` (convenience store), `Other` (Any payment method other than COD or CVS). # @option opts [String] :buyer_email The email address of a buyer. Used to select orders that contain the specified email address. - # @option opts [String] :seller_order_id An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified. + # @option opts [String] :seller_order_id An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, `LastUpdatedBefore`, and `BuyerEmail` cannot be specified. # @option opts [Integer] :max_results_per_page A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. # @option opts [Array] :easy_ship_shipment_statuses A list of `EasyShipShipmentStatus` values. Used to select Easy Ship orders with statuses that match the specified values. If `EasyShipShipmentStatus` is specified, only Amazon Easy Ship orders are returned. **Possible values:** - `PendingSchedule` (The package is awaiting the schedule for pick-up.) - `PendingPickUp` (Amazon has not yet picked up the package from the seller.) - `PendingDropOff` (The seller will deliver the package to the carrier.) - `LabelCanceled` (The seller canceled the pickup.) - `PickedUp` (Amazon has picked up the package from the seller.) - `DroppedOff` (The package is delivered to the carrier by the seller.) - `AtOriginFC` (The packaged is at the origin fulfillment center.) - `AtDestinationFC` (The package is at the destination fulfillment center.) - `Delivered` (The package has been delivered.) - `RejectedByBuyer` (The package has been rejected by the buyer.) - `Undeliverable` (The package cannot be delivered.) - `ReturningToSeller` (The package was not delivered and is being returned to the seller.) - `ReturnedToSeller` (The package was not delivered and was returned to the seller.) - `Lost` (The package is lost.) - `OutForDelivery` (The package is out for delivery.) - `Damaged` (The package was damaged by the carrier.) # @option opts [Array] :electronic_invoice_statuses A list of `ElectronicInvoiceStatus` values. Used to select orders with electronic invoice statuses that match the specified values. **Possible values:** - `NotRequired` (Electronic invoice submission is not required for this order.) - `NotFound` (The electronic invoice was not submitted for this order.) - `Processing` (The electronic invoice is being processed for this order.) - `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last submitted electronic invoice was submitted and accepted.) @@ -428,8 +428,8 @@ def get_order_regulated_info_with_http_info(order_id, opts = {}) # @option opts [String] :actual_fulfillment_supply_source_id The `sourceId` of the location from where you want the order fulfilled. # @option opts [BOOLEAN] :is_ispu When true, this order is marked to be picked up from a store rather than delivered. # @option opts [String] :store_chain_store_id The store chain store identifier. Linked to a specific store in a store chain. - # @option opts [String] :earliest_delivery_date_before Use this date to select orders with a earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - # @option opts [String] :earliest_delivery_date_after Use this date to select orders with a earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @option opts [String] :earliest_delivery_date_before Use this date to select orders with an earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @option opts [String] :earliest_delivery_date_after Use this date to select orders with an earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @option opts [String] :latest_delivery_date_before Use this date to select orders with a latest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @option opts [String] :latest_delivery_date_after Use this date to select orders with a latest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @return [GetOrdersResponse] @@ -438,7 +438,7 @@ def get_orders(marketplace_ids, opts = {}) return data end - # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # Returns orders that are created or updated during the specified time period. If you want to return specific types of orders, you can apply filters to your request. `NextToken` doesn't affect any filters that you include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param marketplace_ids A list of `MarketplaceId` values. Used to select orders that were placed in the specified marketplaces. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. # @param [Hash] opts the optional parameters # @option opts [String] :created_after Use this date to select orders created after (or at) a specified time. Only orders placed after the specified time are returned. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the `CreatedAfter` parameter or the `LastUpdatedAfter` parameter is required. Both cannot be empty. `LastUpdatedAfter` and `LastUpdatedBefore` cannot be set when `CreatedAfter` is set. @@ -449,7 +449,7 @@ def get_orders(marketplace_ids, opts = {}) # @option opts [Array] :fulfillment_channels A list that indicates how an order was fulfilled. Filters the results by fulfillment channel. **Possible values**: `AFN` (fulfilled by Amazon), `MFN` (fulfilled by seller). # @option opts [Array] :payment_methods A list of payment method values. Use this field to select orders that were paid with the specified payment methods. **Possible values**: `COD` (cash on delivery), `CVS` (convenience store), `Other` (Any payment method other than COD or CVS). # @option opts [String] :buyer_email The email address of a buyer. Used to select orders that contain the specified email address. - # @option opts [String] :seller_order_id An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, LastUpdatedBefore, and `BuyerEmail` cannot be specified. + # @option opts [String] :seller_order_id An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If `SellerOrderId` is specified, then `FulfillmentChannels`, `OrderStatuses`, `PaymentMethod`, `LastUpdatedAfter`, `LastUpdatedBefore`, and `BuyerEmail` cannot be specified. # @option opts [Integer] :max_results_per_page A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. # @option opts [Array] :easy_ship_shipment_statuses A list of `EasyShipShipmentStatus` values. Used to select Easy Ship orders with statuses that match the specified values. If `EasyShipShipmentStatus` is specified, only Amazon Easy Ship orders are returned. **Possible values:** - `PendingSchedule` (The package is awaiting the schedule for pick-up.) - `PendingPickUp` (Amazon has not yet picked up the package from the seller.) - `PendingDropOff` (The seller will deliver the package to the carrier.) - `LabelCanceled` (The seller canceled the pickup.) - `PickedUp` (Amazon has picked up the package from the seller.) - `DroppedOff` (The package is delivered to the carrier by the seller.) - `AtOriginFC` (The packaged is at the origin fulfillment center.) - `AtDestinationFC` (The package is at the destination fulfillment center.) - `Delivered` (The package has been delivered.) - `RejectedByBuyer` (The package has been rejected by the buyer.) - `Undeliverable` (The package cannot be delivered.) - `ReturningToSeller` (The package was not delivered and is being returned to the seller.) - `ReturnedToSeller` (The package was not delivered and was returned to the seller.) - `Lost` (The package is lost.) - `OutForDelivery` (The package is out for delivery.) - `Damaged` (The package was damaged by the carrier.) # @option opts [Array] :electronic_invoice_statuses A list of `ElectronicInvoiceStatus` values. Used to select orders with electronic invoice statuses that match the specified values. **Possible values:** - `NotRequired` (Electronic invoice submission is not required for this order.) - `NotFound` (The electronic invoice was not submitted for this order.) - `Processing` (The electronic invoice is being processed for this order.) - `Errored` (The last submitted electronic invoice was rejected for this order.) - `Accepted` (The last submitted electronic invoice was submitted and accepted.) @@ -458,8 +458,8 @@ def get_orders(marketplace_ids, opts = {}) # @option opts [String] :actual_fulfillment_supply_source_id The `sourceId` of the location from where you want the order fulfilled. # @option opts [BOOLEAN] :is_ispu When true, this order is marked to be picked up from a store rather than delivered. # @option opts [String] :store_chain_store_id The store chain store identifier. Linked to a specific store in a store chain. - # @option opts [String] :earliest_delivery_date_before Use this date to select orders with a earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. - # @option opts [String] :earliest_delivery_date_after Use this date to select orders with a earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @option opts [String] :earliest_delivery_date_before Use this date to select orders with an earliest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. + # @option opts [String] :earliest_delivery_date_after Use this date to select orders with an earliest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @option opts [String] :latest_delivery_date_before Use this date to select orders with a latest delivery date before (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @option opts [String] :latest_delivery_date_after Use this date to select orders with a latest delivery date after (or at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. # @return [Array<(GetOrdersResponse)>] GetOrdersResponse data, response status code and response headers @@ -526,9 +526,9 @@ def get_orders_with_http_info(marketplace_ids, opts = {}) end return data end - # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body The request body for the `updateVerificationStatus` operation. - # @param order_id An Amazon-defined order identifier, in 3-7-7 format. + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [nil] def update_verification_status(body, order_id, opts = {}) @@ -536,9 +536,9 @@ def update_verification_status(body, order_id, opts = {}) return nil end - # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body The request body for the `updateVerificationStatus` operation. - # @param order_id An Amazon-defined order identifier, in 3-7-7 format. + # @param order_id The Amazon order identifier in 3-7-7 format. # @param [Hash] opts the optional parameters # @return [Array<(nil)>] nil, response status code and response headers def update_verification_status_with_http_info(body, order_id, opts = {}) diff --git a/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb b/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb index 2eb4a70..208d17a 100644 --- a/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb +++ b/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb @@ -16,7 +16,7 @@ class ShipmentApi def initialize(session) @api_client = AmazonSpClients::ApiClient.new(session) end - # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body The request body for the `updateShipmentStatus` operation. # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters @@ -26,7 +26,7 @@ def update_shipment_status(body, order_id, opts = {}) return nil end - # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Update the shipment status for an order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param body The request body for the `updateShipmentStatus` operation. # @param order_id An Amazon-defined order identifier, in 3-7-7 format. # @param [Hash] opts the optional parameters diff --git a/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb b/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb index c1fca0d..87227a6 100644 --- a/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb +++ b/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb @@ -293,6 +293,7 @@ def get_report_with_http_info(report_id, opts = {}) # Returns the information required for retrieving a report document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param report_document_id The identifier for the report document. # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :enable_content_encoding_url_header When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @return [ReportDocument] def get_report_document(report_document_id, opts = {}) data = get_report_document_with_http_info(report_document_id, opts) @@ -302,6 +303,7 @@ def get_report_document(report_document_id, opts = {}) # Returns the information required for retrieving a report document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param report_document_id The identifier for the report document. # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :enable_content_encoding_url_header When `true`, the Content-Encoding header on the returned URL is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows automatic decompression by HTTP clients. # @return [Array<(ReportDocument)>] ReportDocument data, response status code and response headers def get_report_document_with_http_info(report_document_id, opts = {}) if @api_client.config.debugging @@ -316,6 +318,7 @@ def get_report_document_with_http_info(report_document_id, opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:'enableContentEncodingUrlHeader'] = opts[:'enable_content_encoding_url_header'] if !opts[:'enable_content_encoding_url_header'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb b/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb index cbabeb5..3a22878 100644 --- a/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb +++ b/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb @@ -70,7 +70,7 @@ def get_purchase_order_with_http_info(purchase_order_number, opts = {}) end return data end - # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range must not exceed 7 days and is available to pull data from the past 6 months. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param [Hash] opts the optional parameters # @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records. # @option opts [DateTime] :created_after Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format. @@ -90,7 +90,7 @@ def get_purchase_orders(opts = {}) return data end - # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + # Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range must not exceed 7 days and is available to pull data from the past 6 months. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). # @param [Hash] opts the optional parameters # @option opts [Integer] :limit The limit to the number of records returned. Default value is 100 records. # @option opts [DateTime] :created_after Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format. diff --git a/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb b/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb index 5227a4a..287a177 100644 --- a/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb +++ b/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb @@ -31,7 +31,7 @@ def initialize(session) # @option opts [DateTime] :shipped_before Get Shipment Details by passing Shipped Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipped_after Get Shipment Details by passing Shipped Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :estimated_delivery_before Get Shipment Details by passing Estimated Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. - # @option opts [DateTime] :estimated_delivery_after Get Shipment Details by passing Estimated Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. + # @option opts [DateTime] :estimated_delivery_after Get Shipment Details by passing Estimated Delivery Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipment_delivery_before Get Shipment Details by passing Shipment Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipment_delivery_after Get Shipment Details by passing Shipment Delivery Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :requested_pick_up_before Get Shipment Details by passing Before Requested pickup date. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. @@ -64,7 +64,7 @@ def get_shipment_details(opts = {}) # @option opts [DateTime] :shipped_before Get Shipment Details by passing Shipped Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipped_after Get Shipment Details by passing Shipped Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :estimated_delivery_before Get Shipment Details by passing Estimated Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. - # @option opts [DateTime] :estimated_delivery_after Get Shipment Details by passing Estimated Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. + # @option opts [DateTime] :estimated_delivery_after Get Shipment Details by passing Estimated Delivery Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipment_delivery_before Get Shipment Details by passing Shipment Delivery Date Before. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :shipment_delivery_after Get Shipment Details by passing Shipment Delivery Date After. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. # @option opts [DateTime] :requested_pick_up_before Get Shipment Details by passing Before Requested pickup date. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. @@ -145,7 +145,7 @@ def get_shipment_details_with_http_info(opts = {}) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit The limit to the number of records returned. Default value is 50 records. # @option opts [String] :sort_order Sort the list by shipment label creation date in ascending or descending order. - # @option opts [String] :next_token A token that is used to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. + # @option opts [String] :next_token A token that you use to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. # @option opts [DateTime] :label_created_after Shipment labels created after this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @option opts [DateTime] :label_created_before Shipment labels created before this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @option opts [String] :buyer_reference_number Get Shipment labels by passing buyer reference number. @@ -161,7 +161,7 @@ def get_shipment_labels(opts = {}) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit The limit to the number of records returned. Default value is 50 records. # @option opts [String] :sort_order Sort the list by shipment label creation date in ascending or descending order. - # @option opts [String] :next_token A token that is used to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. + # @option opts [String] :next_token A token that you use to retrieve the next page of results. The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages. # @option opts [DateTime] :label_created_after Shipment labels created after this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @option opts [DateTime] :label_created_before Shipment labels created before this time will be included in the result. This field must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format. # @option opts [String] :buyer_reference_number Get Shipment labels by passing buyer reference number. From fb56c62f8b7935a2c84b32583b50a1a35cb4afac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:11:15 +0200 Subject: [PATCH 80/83] Let a module opt out of the rdt keyword Every generated V2 method takes rdt: because the specs do not say which operations are restricted. The Orders API v2026-01-01 never uses restricted data tokens, so advertising the keyword there would be misleading. A module sets `rdt: false` in codegen-config.yml to drop the keyword, its doc line and the request argument. The default is unchanged, and regeneration of the 14 modules is byte-identical. --- lib/generator.rb | 2 +- lib/generator/api_module.rb | 10 ++++-- lib/generator/operation.rb | 22 ++++++++----- lib/generator/templates/v2_operation.erb | 6 ++-- spec/generator/v2_spec.rb | 40 ++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 12 deletions(-) diff --git a/lib/generator.rb b/lib/generator.rb index ca30082..aead376 100644 --- a/lib/generator.rb +++ b/lib/generator.rb @@ -63,7 +63,7 @@ def render_v2_apis(modules) def api_modules @api_modules ||= config.fetch('list_of_apis').map do |entry| ApiModule.new(name: entry.fetch('name'), spec_path: entry.fetch('path'), - templates: entry.fetch('templates')) + templates: entry.fetch('templates'), rdt: entry.fetch('rdt', true)) end end diff --git a/lib/generator/api_module.rb b/lib/generator/api_module.rb index 0fb2304..53d217d 100644 --- a/lib/generator/api_module.rb +++ b/lib/generator/api_module.rb @@ -20,12 +20,15 @@ module Generator # # v2 (AmazonSpClients::V2, one class per module): # lib/amazon_sp_clients/v2/apis/.rb + # + # Every V2 method takes rdt: unless the module sets `rdt: false`, for + # an API that never uses restricted data tokens. class ApiModule TEMPLATES = %w[v1 v2].freeze attr_reader :name, :spec_path, :templates - def initialize(name:, spec_path:, templates:, models_dir: Specs.models_dir) + def initialize(name:, spec_path:, templates:, rdt: true, models_dir: Specs.models_dir) unknown = templates - TEMPLATES raise ArgumentError, "unknown templates #{unknown.inspect} for #{name}" unless unknown.empty? raise ArgumentError, "no templates listed for #{name}" if templates.empty? @@ -33,6 +36,7 @@ def initialize(name:, spec_path:, templates:, models_dir: Specs.models_dir) @name = name @spec_path = spec_path @templates = templates + @rdt = rdt @models_dir = models_dir end @@ -41,6 +45,7 @@ def module_name = "Sp#{Naming.camelize(name)}" def v2_class_name = Naming.camelize(name) def v1? = templates.include?('v1') def v2? = templates.include?('v2') + def rdt? = @rdt # The spec title, for the V2 entry file. def title = spec.fetch('info').fetch('title').strip @@ -121,7 +126,8 @@ def classes seen[op_id] = true class_name = "#{Naming.camelize(op.fetch('tags').fetch(0))}Api" (grouped[class_name] ||= []) << - Operation.new(class_name: class_name, path: path, verb: verb, spec: op, root: spec) + Operation.new(class_name: class_name, path: path, verb: verb, spec: op, root: spec, + rdt: rdt?) end end grouped.transform_values { |ops| ops.sort_by(&:method_name) } diff --git a/lib/generator/operation.rb b/lib/generator/operation.rb index 61d6f40..7a5df7c 100644 --- a/lib/generator/operation.rb +++ b/lib/generator/operation.rb @@ -29,12 +29,13 @@ def self.v2_template ) end - def initialize(class_name:, path:, verb:, spec:, root:) + def initialize(class_name:, path:, verb:, spec:, root:, rdt: true) @class_name = class_name @path = path @verb = verb @spec = spec @root = root + @rdt = rdt @operation_id = spec.fetch('operationId') @method_name = Naming.underscore(@operation_id) @http_method = verb.upcase @@ -45,8 +46,8 @@ def render end # The V2 method: required params positional in v1 order, the rest - # keywords, plus rdt:. Names that would not survive as Ruby - # arguments fail here. + # keywords, plus rdt: when the module takes restricted data tokens. + # Names that would not survive as Ruby arguments fail here. def render_v2 Names.check_method!(method_name) Names.check_unique!(params.map(&:name), what: 'parameter') @@ -245,12 +246,17 @@ def optional_enum_guard(param, values) # -- V2 template pieces -------------------------------------------------- def v2_params = all_params + def rdt? = @rdt + # The parameter list with its parentheses, or nothing for a method + # that takes no arguments. def v2_signature parts = signature_params.map(&:name) parts += optional_params.map { |p| "#{p.name}: nil" } - parts << 'rdt: nil' - parts.join(', ') + parts << 'rdt: nil' if rdt? + return '' if parts.empty? + + "(#{parts.join(', ')})" end def query_params = params.select { |p| p.location == 'query' } @@ -271,12 +277,14 @@ def v2_path_expr "\"#{expr}\"" end + # Everything inside `request(...)`: the verb, the path and the + # pieces this operation has. def v2_request_args - args = [] + args = [":#{verb}", v2_path_expr] args << 'query: query' if query_params.any? args << 'headers: headers' if header_params.any? args << 'body: body' if body_param - args << 'rdt: rdt' + args << 'rdt: rdt' if rdt? args.join(', ') end diff --git a/lib/generator/templates/v2_operation.erb b/lib/generator/templates/v2_operation.erb index 2d0fb13..2a5c104 100644 --- a/lib/generator/templates/v2_operation.erb +++ b/lib/generator/templates/v2_operation.erb @@ -3,9 +3,11 @@ <%- v2_params.each do |p| -%> # <%= "@param #{p.name} [#{p.v2_doc_type}#{', nil' unless p.required?}] #{p.v2_description}".strip %> <%- end -%> +<%- if rdt? -%> # @param rdt [Array, nil] send a restricted data token for these resources +<%- end -%> # @return [AmazonSpClients::ApiResponse] - def <%= method_name %>(<%= v2_signature %>) + def <%= method_name %><%= v2_signature %> <%- if query_params.any? -%> query = { <%- query_params.each_with_index do |p, i| -%> @@ -23,5 +25,5 @@ <%- if query_params.any? || header_params.any? -%> <%- end -%> - request(:<%= verb %>, <%= v2_path_expr %>, <%= v2_request_args %>) + request(<%= v2_request_args %>) end diff --git a/spec/generator/v2_spec.rb b/spec/generator/v2_spec.rb index 4db5cc6..81944d4 100644 --- a/spec/generator/v2_spec.rb +++ b/spec/generator/v2_spec.rb @@ -14,6 +14,10 @@ templates: %w[v2], models_dir: fixtures) end let(:source) { api_module.render_v2 } + let(:plain_module) do + Generator::ApiModule.new(name: 'plain_v1', spec_path: 'things.json', + templates: %w[v2], rdt: false, models_dir: fixtures) + end # Loads the generated class once for the whole group. def things_class @@ -37,6 +41,11 @@ def things_class expect(api_module.owned_paths).to eq(['lib/amazon_sp_clients/v2/apis/things_v1.rb']) end + it 'takes restricted data tokens unless the module opts out' do + expect(api_module.rdt?).to be(true) + expect(plain_module.rdt?).to be(false) + end + it 'owns the v1 paths too when v1 is listed' do both = Generator::ApiModule.new(name: 'things_v1', spec_path: 'things.json', templates: %w[v1 v2], models_dir: fixtures) @@ -168,6 +177,37 @@ def things_class end end + describe 'a module that opts out of restricted data tokens' do + let(:plain_source) { plain_module.render_v2 } + + def plain_class + namespace = AmazonSpClients::V2 + return namespace::PlainV1 if namespace.const_defined?(:PlainV1) + + Object.class_eval(plain_source) + namespace::PlainV1 + end + + it 'leaves rdt out of the signatures and the docs' do + list_things = plain_class.instance_method(:list_things).parameters + + expect(plain_source).not_to include('rdt') + expect(list_things.last).to eq(%i[key x_request_note]) + expect(plain_class.instance_method(:cancel_thing).parameters).to eq([%i[req thing_id]]) + end + + it 'sends the access token' do + client = v2::Client.new(v2::Config.new) { 'ACCESS' } + stub = stub_request(:delete, 'https://sellingpartnerapi-na.amazon.com/things/v1/things/T1/cancel') + .with(headers: { 'x-amz-access-token' => 'ACCESS' }) + .to_return(status: 204, body: '') + + plain_class.new(client).cancel_thing('T1') + + expect(stub).to have_been_requested + end + end + describe 'name guard' do names = Generator::Names From 5df0c1defb15a557f4aa20be4fbb074d8c7ccf9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:13:05 +0200 Subject: [PATCH 81/83] Add the Orders API v2026-01-01 to V2 Amazon's next Orders API replaces the seven v0 read operations with searchOrders and getOrder, selects PII and other blocks with includedData instead of restricted data tokens, pages with paginationToken, and returns the body without a payload wrapper. The module is V2 only: `client.orders_2026` gives `Orders2026` with `search_orders` (every parameter optional) and `get_order`. Neither takes rdt:. `ApiResponse#payload` is the whole body, so consumers read `payload[:orders]` and `payload.dig(:pagination, :nextToken)`. Orders v0 stays in both v1 and V2; Amazon marks it deprecated. --- codegen-config.yml | 7 ++ lib/amazon_sp_clients/v2/apis.rb | 5 ++ lib/amazon_sp_clients/v2/apis/orders_2026.rb | 59 ++++++++++++++++ spec/amazon_sp_clients/v2/apis_spec.rb | 73 +++++++++++++++++--- spec/amazon_sp_clients/v2/loading_spec.rb | 2 +- 5 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 lib/amazon_sp_clients/v2/apis/orders_2026.rb diff --git a/codegen-config.yml b/codegen-config.yml index dc14efe..aee8ebd 100644 --- a/codegen-config.yml +++ b/codegen-config.yml @@ -20,6 +20,13 @@ list_of_apis: path: listings-items-api-model/listingsItems_2021-08-01.json templates: [v1, v2] + # V2 only. PII comes through includedData under role permissions, + # so the API takes no restricted data token. + - name: orders_2026 + path: orders-api-model/orders_2026-01-01.json + templates: [v2] + rdt: false + - name: orders_v0 path: orders-api-model/ordersV0.json templates: [v1, v2] diff --git a/lib/amazon_sp_clients/v2/apis.rb b/lib/amazon_sp_clients/v2/apis.rb index 8f892d7..cec1e45 100644 --- a/lib/amazon_sp_clients/v2/apis.rb +++ b/lib/amazon_sp_clients/v2/apis.rb @@ -10,6 +10,7 @@ module V2 autoload :Feeds2021, 'amazon_sp_clients/v2/apis/feeds_2021' autoload :FulfillmentOutbound2020, 'amazon_sp_clients/v2/apis/fulfillment_outbound_2020' autoload :ListingsItems2021, 'amazon_sp_clients/v2/apis/listings_items_2021' + autoload :Orders2026, 'amazon_sp_clients/v2/apis/orders_2026' autoload :OrdersV0, 'amazon_sp_clients/v2/apis/orders_v0' autoload :Reports2021, 'amazon_sp_clients/v2/apis/reports_2021' autoload :Tokens2021, 'amazon_sp_clients/v2/apis/tokens_2021' @@ -38,6 +39,10 @@ def fulfillment_outbound_2020 = api(FulfillmentOutbound2020) # @return [ListingsItems2021] def listings_items_2021 = api(ListingsItems2021) + # The Selling Partner API for Orders + # @return [Orders2026] + def orders_2026 = api(Orders2026) + # Selling Partner API for Orders # @return [OrdersV0] def orders_v0 = api(OrdersV0) diff --git a/lib/amazon_sp_clients/v2/apis/orders_2026.rb b/lib/amazon_sp_clients/v2/apis/orders_2026.rb new file mode 100644 index 0000000..96df717 --- /dev/null +++ b/lib/amazon_sp_clients/v2/apis/orders_2026.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Generated by lib/generator (bundle exec rake generate). Do not edit. + +require 'amazon_sp_clients/v2/api' + +module AmazonSpClients + module V2 + # The Selling Partner API for Orders + # + # The Selling Partner API for Orders returns orders information. This API supports the following types of orders: - FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available. + # + # OpenAPI spec version: 2026-01-01 + class Orders2026 < Api + # Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # + # @param order_id [String] An Amazon-defined order identifier. + # @param included_data [Array, nil] A list of datasets to include in the response. + # @return [AmazonSpClients::ApiResponse] + def get_order(order_id, included_data: nil) + query = { + 'includedData' => csv(included_data) + } + + request(:get, "/orders/2026-01-01/orders/#{encode(order_id)}", query: query) + end + + # Returns orders created or updated during the time period that you specify. You can filter the response for specific types of orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0056 | 20 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may receive higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation. + # + # @param created_after [String, nil] The response includes orders created at or after this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter` in your request. If `createdAfter` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided. + # @param created_before [String, nil] The response includes orders created at or before this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `createdAfter` in the request, `createdBefore` is optional, and if provided must be equal to or after the `createdAfter` date and at least two minutes before the time of the request. If `createdBefore` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided. + # @param last_updated_after [String, nil] The response includes orders updated at or after this time. An update is any change made by Amazon or the seller, including changes to order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter`. If `lastUpdatedAfter` is provided, neither `createdAfter` nor `createdBefore` may be provided. + # @param last_updated_before [String, nil] The response includes orders updated at or before this time. An update is any change made by Amazon or the seller, including changes to order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `lastUpdatedAfter` in the request, `lastUpdatedBefore` is optional, and if provided must be equal to or after the `lastUpdatedAfter` date and at least two minutes before the time of the request. If `lastUpdatedBefore` is provided, neither `createdAfter` nor `createdBefore` may be provided. + # @param fulfillment_statuses [Array, nil] A list of `FulfillmentStatus` values you can use to filter the results. + # @param marketplace_ids [Array, nil] The response includes orders that were placed in marketplaces you include in this list. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values. + # @param fulfilled_by [Array, nil] The response includes orders that are fulfilled by the parties that you include in this list. + # @param max_results_per_page [Integer, nil] The maximum number of orders that can be returned per page. The value must be between 1 and 100. **Default:** 100. + # @param pagination_token [String, nil] Pagination occurs when a request produces a response that exceeds the `maxResultsPerPage`. This means that the response is divided into individual pages. To retrieve the next page, you must pass the `nextToken` value as the `paginationToken` query parameter in the next request. You will not receive a `nextToken` value on the last page. + # @param included_data [Array, nil] A list of datasets to include in the response. + # @return [AmazonSpClients::ApiResponse] + def search_orders(created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil, fulfillment_statuses: nil, marketplace_ids: nil, fulfilled_by: nil, max_results_per_page: nil, pagination_token: nil, included_data: nil) + query = { + 'createdAfter' => created_after, + 'createdBefore' => created_before, + 'lastUpdatedAfter' => last_updated_after, + 'lastUpdatedBefore' => last_updated_before, + 'fulfillmentStatuses' => csv(fulfillment_statuses), + 'marketplaceIds' => csv(marketplace_ids), + 'fulfilledBy' => csv(fulfilled_by), + 'maxResultsPerPage' => max_results_per_page, + 'paginationToken' => pagination_token, + 'includedData' => csv(included_data) + } + + request(:get, '/orders/2026-01-01/orders', query: query) + end + end + end +end diff --git a/spec/amazon_sp_clients/v2/apis_spec.rb b/spec/amazon_sp_clients/v2/apis_spec.rb index 1c4c8fc..9285ce0 100644 --- a/spec/amazon_sp_clients/v2/apis_spec.rb +++ b/spec/amazon_sp_clients/v2/apis_spec.rb @@ -7,12 +7,17 @@ RSpec.describe 'V2 API classes' do v2 = AmazonSpClients::V2 + # Generated from both template sets; V2 must offer what v1 offers. modules = %w[ fba_inventory feeds_2021 fulfillment_outbound_2020 listings_items_2021 orders_v0 reports_2021 tokens_2021 vdf_inventory_v1 vdf_orders_v1 vdf_shipping_v1 vendor_invoices vendor_orders vendor_transaction_status vendors_shipments ].freeze + # V2 only, so there is no v1 module to compare with: the operations + # are listed here. + v2_only = { 'orders_2026' => %w[get_order search_orders] }.freeze + let(:base_url) { 'https://sellingpartnerapi-na.amazon.com' } let(:client) { v2::Client.new(v2::Config.new) { 'ACCESS' } } @@ -31,28 +36,45 @@ def v1_operations(name) end.grep_v(/_with_http_info\z|\Aapi_client/).sort end + shared_examples 'an API class' do |name| + it 'is an Api subclass the client hands out' do + klass = v2.const_get(camelize(name)) + + expect(klass.superclass).to be(v2::Api) + expect(client.public_send(name)).to be_a(klass) + expect(client.public_send(name)).to be(client.public_send(name)) + end + end + modules.each do |name| describe name do - it 'is an Api subclass the client hands out' do + include_examples 'an API class', name + + it 'offers the same operations as the v1 module' do klass = v2.const_get(camelize(name)) - expect(klass.superclass).to be(v2::Api) - expect(client.public_send(name)).to be_a(klass) - expect(client.public_send(name)).to be(client.public_send(name)) + expect(klass.public_instance_methods(false).map(&:to_s).sort).to eq(v1_operations(name)) end + end + end - it 'offers the same operations as the v1 module' do + v2_only.each do |name, operations| + describe name do + include_examples 'an API class', name + + it 'offers the listed operations' do klass = v2.const_get(camelize(name)) - expect(klass.public_instance_methods(false).map(&:to_s).sort).to eq(v1_operations(name)) + expect(klass.public_instance_methods(false).map(&:to_s).sort).to eq(operations) end end end - it 'covers all 72 operations' do - total = modules.sum { |name| v2.const_get(camelize(name)).public_instance_methods(false).size } + it 'covers all 74 operations' do + names = modules + v2_only.keys + total = names.sum { |name| v2.const_get(camelize(name)).public_instance_methods(false).size } - expect(total).to eq(72) + expect(total).to eq(74) end describe 'request shapes' do @@ -128,5 +150,38 @@ def v1_operations(name) expect { client.orders_v0.get_orders(['A'], order_status: 'Shipped') } .to raise_error(ArgumentError, /order_status/) end + + # The 2026 Orders API: every parameter optional, camelCase names, no + # payload wrapper around the body, and no restricted data tokens. + it 'sends the 2026 Orders search and returns the bare body' do + stub = stub_request(:get, "#{base_url}/orders/2026-01-01/orders") + .with(query: { 'marketplaceIds' => 'A,B', 'fulfillmentStatuses' => 'UNSHIPPED', + 'includedData' => 'BUYER,RECIPIENT', 'paginationToken' => 'T' }, + headers: { 'x-amz-access-token' => 'ACCESS' }) + .to_return(status: 200, body: '{"orders":[],"pagination":{"nextToken":"N"}}') + + response = client.orders_2026.search_orders(marketplace_ids: %w[A B], + fulfillment_statuses: ['UNSHIPPED'], + included_data: %w[BUYER RECIPIENT], + pagination_token: 'T') + + expect(stub).to have_been_requested + expect(response.payload).to eq(orders: [], pagination: { nextToken: 'N' }) + end + + it 'searches the 2026 Orders API with no parameters at all' do + stub = stub_request(:get, "#{base_url}/orders/2026-01-01/orders") + .to_return(status: 200, body: '{"orders":[]}') + + client.orders_2026.search_orders + + expect(stub).to have_been_requested + end + + it 'takes no rdt on the 2026 Orders API' do + expect(v2::Orders2026.instance_method(:get_order).parameters) + .to eq([%i[req order_id], %i[key included_data]]) + expect { client.orders_2026.get_order('1', rdt: []) }.to raise_error(ArgumentError, /rdt/) + end end end diff --git a/spec/amazon_sp_clients/v2/loading_spec.rb b/spec/amazon_sp_clients/v2/loading_spec.rb index 7962416..f90ba18 100644 --- a/spec/amazon_sp_clients/v2/loading_spec.rb +++ b/spec/amazon_sp_clients/v2/loading_spec.rb @@ -33,6 +33,6 @@ expect(err).to eq('') expect(status).to be_success - expect(out.lines.map(&:strip)).to eq(['[]', '0', '14']) + expect(out.lines.map(&:strip)).to eq(['[]', '0', '15']) end end From b0f156c477b270a7bd809c2188bb24ba7f0a5814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:15:02 +0200 Subject: [PATCH 82/83] Document the 2026 Orders API README gains an "Orders API v2026-01-01" section with what a caller has to know: two operations, includedData instead of separate PII calls, no restricted data token, paginationToken with a 24 hour life, renamed status values and the lower default rate. The V2 example and the migration table use the new module; the code generation section explains `rdt: false`. CHANGELOG gets the undated 2.1.0 entry for the release task to stamp. --- CHANGELOG.md | 26 +++++++++++++++++++++++ CLAUDE.md | 10 +++++++-- README.md | 42 ++++++++++++++++++++++++++++++++----- lib/amazon_sp_clients/v2.rb | 2 +- 4 files changed, 72 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1585d85..4a29b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,32 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. +## [2.1.0] + +### Added + +- `client.orders_2026`, the Orders API v2026-01-01, in V2 only. + `search_orders` replaces `get_orders`; `get_order` returns the items + and, through `included_data:`, the buyer, recipient and other blocks + that v0 served from separate operations. The API takes no restricted + data token, so the methods have no `rdt:` keyword. The body has no + `payload` wrapper: read `payload[:orders]` and + `payload.dig(:pagination, :nextToken)`. README, "Orders API + v2026-01-01", lists the differences; Amazon's migration guide maps + the fields. +- `rdt: false` in `codegen-config.yml` drops the `rdt:` keyword from a + module whose API never uses restricted data tokens. +- `get_feed_document` and `get_report_document` take + `enable_content_encoding_url_header:` (V2), or the same key in `opts` + (v1), new in Amazon's specs. + +### Changed + +- The Amazon models pin moves from 2025-02-26 to 2026-08-26. Apart from + the parameter above, the regenerated code differs only in comments. + Amazon marks every Orders v0 operation deprecated; `orders_v0` stays + in v1 and V2 until v1 is removed. + ## [2.0.1] - 2026-09-07 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index aa7ba24..d80556d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,7 +15,8 @@ paths. `lib/sp_api_clients.rb` is the one-line shim for the gem name. edit by hand. It is overwritten on every regeneration. - `lib/generator/` — the code generator (pure Ruby + ERB, no Java). Not shipped with the gem. Templates live in `lib/generator/templates/`. -- `codegen-config.yml` — list of APIs to generate (name + spec path). +- `codegen-config.yml` — list of APIs to generate (name, spec path, + template sets, optional `rdt: false`). - `selling-partner-api-models.sha` — pinned revision of Amazon's spec repo (github.com/amzn/selling-partner-api-models). The generator clones it into `amzn-models/` (gitignored) and checks out this SHA. @@ -82,11 +83,16 @@ V2 (`lib/amazon_sp_clients/v2/apis/.rb` plus `apis.rb`): - one class per module, `AmazonSpClients::V2:: < V2::Api`, built by `client.`, - required params positional in v1 order, optional params as keywords, - plus `rdt:`; nil keywords are left off the wire, + plus `rdt:` unless the module sets `rdt: false`; nil keywords are left + off the wire, - every operation returns `ApiResponse`, - `apis.rb` holds an autoload and a `Client` accessor per module. `codegen-config.yml` lists each module's template sets (`templates:`). +A module whose API takes no restricted data token sets `rdt: false`, +and its V2 methods have no `rdt:` keyword. `orders_2026` (Orders API +v2026-01-01) is V2 only and set that way; Amazon marks `orders_v0` +deprecated, and it stays until v1 goes. The generator refuses to run while tracked files under `vendor/`, `lib/amazon_sp_clients/sp_*.rb` or the V2 apis paths belong to no configured module, and fails on names Ruby or the V2 signature use. diff --git a/README.md b/README.md index 9b1280a..f271b21 100644 --- a/README.md +++ b/README.md @@ -118,10 +118,12 @@ client = AmazonSpClients::V2::Client.new(config) { store.access_token } # Or let the client exchange a refresh token itself (needs client_id and client_secret). client = AmazonSpClients::V2::Client.with_refresh_token(config, refresh_token) -orders = client.orders_v0.get_orders(['ATVPDKIKX0DER'], created_after: '2026-09-01T00:00:00Z') -orders.payload[:Orders] # symbol keys, as in v1 -orders.payload[:NextToken] -orders.reported_rate_limit # Float from x-amzn-RateLimit-Limit, or nil +orders = client.orders_2026.search_orders(marketplace_ids: ['ATVPDKIKX0DER'], + created_after: '2026-09-01T00:00:00Z', + included_data: %w[BUYER RECIPIENT]) +orders.payload[:orders] # symbol keys; the body has no payload wrapper +orders.payload.dig(:pagination, :nextToken) # absent on the last page +orders.reported_rate_limit # Float from x-amzn-RateLimit-Limit, or nil ``` To read a rotated refresh token back, build the credentials yourself @@ -140,9 +142,36 @@ as v1; optional ones are keywords. Unknown keywords raise `ArgumentError` (v1 ignored them), so pass only the parameters the operation has. +### Orders API v2026-01-01 + +`orders_2026` is the current Orders API, and V2 only. Amazon marks every +Orders v0 operation deprecated; `orders_v0` stays until v1 is removed. +What a caller has to know: + +- Two operations. `search_orders` replaces `get_orders`. `get_order` + returns the items and, with `included_data:`, the blocks v0 served + from separate operations: `BUYER`, `RECIPIENT`, `PROCEEDS`, `EXPENSE`, + `PROMOTION`, `CANCELLATION`, `FULFILLMENT`, `PACKAGES`, `TAX`, + `PAYMENT`, `FULFILLMENT_ORDERS`. +- No restricted data tokens. PII needs role permissions only, so the + methods have no `rdt:` keyword. +- Every `search_orders` parameter is optional, but Amazon wants exactly + one of `created_after:` and `last_updated_after:`. +- Pages with `pagination_token:`. The response carries + `payload.dig(:pagination, :nextToken)`, missing on the last page. A + token expires after 24 hours. +- Renamed values: `fulfillment_statuses:` takes `UNSHIPPED`, `SHIPPED`, + `CANCELLED` and so on; `fulfilled_by:` takes `MERCHANT` or `AMAZON`. +- The default rate of `search_orders` is 0.0056 requests per second + with a burst of 20. v0 `get_orders` had 0.0167. + +Amazon's [migration guide](https://developer-docs.amazon/sp-api/docs/orders-api-migration-guide) +maps every v0 field to its new place. + ### Restricted data tokens Operations that return PII take `rdt:`, a list of restricted resources. +The 2026 Orders API is the exception (see above). The client fetches the token, caches it until it expires, and sends it instead of the access token. @@ -193,6 +222,7 @@ client.download_report_document(report_document_payload) # String, gunzipped whe | `TokenExchangeAuth.new(refresh_token).exchange` | `LWA.new(config).exchange(refresh_token: refresh_token)`. The config must carry `client_id` and `client_secret`; `LWA.new` raises `ArgumentError` when they are missing, where v1 sent the request and got an LWA error back. | | `response[:access_token]` | `token.access_token`, `token.expires_in`, `token.expires_at` | | `SpOrdersV0::OrdersV0Api.new(session)` | `client.orders_v0` | +| `get_orders`, then `get_order_items`, `get_order_buyer_info`, `get_order_address` per order | `client.orders_2026.search_orders(marketplace_ids: ids, ...)`, then `get_order(id, included_data: %w[BUYER RECIPIENT])`. The current Orders API; no `rdt:`. See "Orders API v2026-01-01". | | `get_orders(ids, opts)` with an options Hash | `get_orders(ids, **opts)` with real parameter names only | | `auth_names: [:orders_and_items]` | `rdt: RDT::ORDERS_AND_ITEMS` | | `auth_names: [{ method: 'GET', path: path }]` | `rdt: RDT.report_document(doc_id)` for a report document, `rdt: [RDT.resource('GET', path)]` for anything else | @@ -230,7 +260,9 @@ bundle exec rake generate:update # pull latest specs, regenerate, advance the ``` Which APIs get generated, and with which template sets (`v1`, `v2`), is -controlled by `codegen-config.yml`. To adopt newer Amazon specs, run +controlled by `codegen-config.yml`. A module whose API never uses +restricted data tokens sets `rdt: false` there, and its V2 methods have +no `rdt:` keyword. To adopt newer Amazon specs, run `rake generate:update` and review the diff — the pin file change plus the regenerated files — in its own PR. diff --git a/lib/amazon_sp_clients/v2.rb b/lib/amazon_sp_clients/v2.rb index dc37072..759c55d 100644 --- a/lib/amazon_sp_clients/v2.rb +++ b/lib/amazon_sp_clients/v2.rb @@ -27,7 +27,7 @@ module AmazonSpClients # # config = AmazonSpClients::V2::Config.new(endpoint: 'na') # client = AmazonSpClients::V2::Client.new(config) { current_access_token } - # client.orders_v0.get_orders(marketplace_ids, created_after: since) + # client.orders_2026.search_orders(marketplace_ids: ids, created_after: since) module V2 end end From d13b35a23efb07e62792aa63d2e1774f53baade7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Saul=C4=97?= <351015+nina-saule@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:29:53 +0200 Subject: [PATCH 83/83] Release 2.1.0 --- CHANGELOG.md | 2 +- Gemfile.lock | 2 +- gemfiles/faraday_1.gemfile.lock | 4 ++-- gemfiles/faraday_2.gemfile.lock | 4 ++-- lib/amazon_sp_clients/version.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a29b35..dd3e995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to this gem. The format follows Changes that only track updates to Amazon's API models are not considered breaking and do not trigger a major version bump. -## [2.1.0] +## [2.1.0] - 2026-09-07 ### Added diff --git a/Gemfile.lock b/Gemfile.lock index c687d1f..f3b6e96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - sp_api_clients (2.0.1) + sp_api_clients (2.1.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index 952efb1..bd37ab4 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - sp_api_clients (2.0.1) + sp_api_clients (2.1.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -163,7 +163,7 @@ CHECKSUMS rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef - sp_api_clients (2.0.1) + sp_api_clients (2.1.0) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index b41cd23..b7a025a 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - sp_api_clients (2.0.1) + sp_api_clients (2.1.0) faraday (>= 1.10, < 3) faraday-httpclient (>= 1.0, < 3) faraday-retry (>= 1.0, < 3) @@ -145,7 +145,7 @@ CHECKSUMS rubocop (1.90.0) sha256=9eb4c065b5c5154e4ef554c547972f3905a9eb6b53e657e580b6796b54bf8242 rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 - sp_api_clients (2.0.1) + sp_api_clients (2.1.0) timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542 unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f diff --git a/lib/amazon_sp_clients/version.rb b/lib/amazon_sp_clients/version.rb index ae1a239..abacc3b 100644 --- a/lib/amazon_sp_clients/version.rb +++ b/lib/amazon_sp_clients/version.rb @@ -1,3 +1,3 @@ module AmazonSpClients - VERSION = '2.0.1'.freeze + VERSION = '2.1.0'.freeze end